diff --git a/addon_files/redmatic/lib/package.json b/addon_files/redmatic/lib/package.json index 3e1d3b72..822d87a5 100644 --- a/addon_files/redmatic/lib/package.json +++ b/addon_files/redmatic/lib/package.json @@ -12,7 +12,7 @@ "node-red-contrib-mysensors": "3.3.0", "node-red-contrib-rfxcom": "2.8.1", "node-red-contrib-zigbee": "0.7.1", - "node-red-contrib-gpio": "0.14.0", + "node-red-contrib-johnny-five": "0.15.0", "node-red-contrib-enocean": "0.4.14", "redmatic-homekit": "2.3.3" } diff --git a/bundle-pkgs.js b/bundle-pkgs.js index 590b3e40..b0adb97e 100644 --- a/bundle-pkgs.js +++ b/bundle-pkgs.js @@ -14,7 +14,7 @@ const extraFiles = { 'redmatic-homekit': [ 'bin/ffmpeg' ], - 'node-red-contrib-gpio': [ + 'node-red-contrib-johnny-five': [ 'bin/pig2vcd', 'bin/pigpiod', 'bin/pigs', diff --git a/package.json b/package.json index dfba3b34..4033b6a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redmatic", - "version": "4.4.3", + "version": "4.5.0", "description": "Node-RED packaged as Homematic CCU addon", "repository": "github:rdmtc/redmatic", "private": true, @@ -32,7 +32,7 @@ "node-red-contrib-mysensors": "0.0.0 - 3.3.0", "node-red-contrib-rfxcom": "0.0.0 - 2.8.1", "node-red-contrib-zigbee": "0.0.0 - 0.7.1", - "node-red-contrib-gpio": "0.0.0 - 0.14.0", + "node-red-contrib-johnny-five": "0.0.0 - 0.15.0", "node-red-contrib-enocean": "0.0.0 - 0.4.14" }, "author": "Sebastian Raff ", diff --git a/prebuild.sh b/prebuild.sh index 4fff366c..01270857 100755 --- a/prebuild.sh +++ b/prebuild.sh @@ -9,7 +9,7 @@ cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependenc scp $DEST/package.json $REMOTE:$REMOTE_PATH ssh -t $REMOTE "cd $REMOTE_PATH ; npm install --global-style --unsafe-perm" -ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-gpio ; npm install --save --unsafe-perm --global-style raspi-io" +ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production raspi-io" rm -r ${DEST}/lib/node_modules @@ -29,9 +29,8 @@ while read -r binary; do scp -q ${from} ${dest} && echo "${binary}" done <<< "$files" -scp -r $REMOTE:$REMOTE_PATH/node_modules/node-red-contrib-gpio/node_modules/raspi-io $DEST/lib/node_modules/node-red-contrib-gpio/node_modules/ - +scp -r $REMOTE:$REMOTE_PATH/node_modules/node-red-contrib-johnny-five/node_modules $DEST/lib/node_modules/node-red-contrib-johnny-five cp -R $DEST/lib/node_modules/node-red-contrib-zigbee/node_modules/cc-znp/node_modules/@serialport $DEST/lib/node_modules/node-red-contrib-zigbee/node_modules/ -git add $DEST/lib \ No newline at end of file +git add $DEST/lib diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/firmata/node_modules/serialport/build/Release/serialport.node b/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/firmata/node_modules/serialport/build/Release/serialport.node deleted file mode 100755 index d5937414..00000000 Binary files a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/firmata/node_modules/serialport/build/Release/serialport.node and /dev/null differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/serialport/build/Release/serialport.node b/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/serialport/build/Release/serialport.node deleted file mode 100755 index 26488c57..00000000 Binary files a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/serialport/build/Release/serialport.node and /dev/null differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/detect-libc b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/detect-libc new file mode 100755 index 00000000..5486127f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/detect-libc @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +'use strict'; + +var spawnSync = require('child_process').spawnSync; +var libc = require('../'); + +var spawnOptions = { + env: process.env, + shell: true, + stdio: 'inherit' +}; + +if (libc.isNonGlibcLinux) { + spawnOptions.env.LIBC = process.env.LIBC || libc.family; +} + +process.exit(spawnSync(process.argv[2], process.argv.slice(3), spawnOptions).status); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mkdirp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mkdirp new file mode 100755 index 00000000..d95de15a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt new file mode 100755 index 00000000..d60f7bd6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt @@ -0,0 +1,41 @@ +#!/usr/bin/env node +'use strict' + +/* + * Copyright (c) 2015-2015 MQTT.js contributors. + * Copyright (c) 2011-2014 Adam Rudd. + * + * See LICENSE for more information + */ + +var MqttClient = require('./lib/client') +var connect = require('./lib/connect') +var Store = require('./lib/store') + +module.exports.connect = connect + +// Expose MqttClient +module.exports.MqttClient = MqttClient +module.exports.Client = MqttClient +module.exports.Store = Store + +function cli () { + var commist = require('commist')() + var helpMe = require('help-me')() + + commist.register('publish', require('./bin/pub')) + commist.register('subscribe', require('./bin/sub')) + commist.register('version', function () { + console.log('MQTT.js version:', require('./package.json').version) + }) + commist.register('help', helpMe.toStdout) + + if (commist.parse(process.argv.slice(2)) !== null) { + console.log('No such command:', process.argv[2], '\n') + helpMe.toStdout() + } +} + +if (require.main === module) { + cli() +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt_pub b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt_pub new file mode 100755 index 00000000..94b066b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt_pub @@ -0,0 +1,146 @@ +#!/usr/bin/env node + +'use strict' + +var mqtt = require('../') +var pump = require('pump') +var path = require('path') +var fs = require('fs') +var concat = require('concat-stream') +var Writable = require('readable-stream').Writable +var helpMe = require('help-me')({ + dir: path.join(__dirname, '..', 'doc') +}) +var minimist = require('minimist') +var split2 = require('split2') + +function send (args) { + var client = mqtt.connect(args) + client.on('connect', function () { + client.publish(args.topic, args.message, args, function (err) { + if (err) { + console.warn(err) + } + client.end() + }) + }) + client.on('error', function (err) { + console.warn(err) + client.end() + }) +} + +function multisend (args) { + var client = mqtt.connect(args) + var sender = new Writable({ + objectMode: true + }) + sender._write = function (line, enc, cb) { + client.publish(args.topic, line.trim(), args, cb) + } + + client.on('connect', function () { + pump(process.stdin, split2(), sender, function (err) { + client.end() + if (err) { + throw err + } + }) + }) +} + +function start (args) { + args = minimist(args, { + string: ['hostname', 'username', 'password', 'key', 'cert', 'ca', 'message', 'clientId', 'i', 'id'], + boolean: ['stdin', 'retain', 'help', 'insecure', 'multiline'], + alias: { + port: 'p', + hostname: ['h', 'host'], + topic: 't', + message: 'm', + qos: 'q', + clientId: ['i', 'id'], + retain: 'r', + username: 'u', + password: 'P', + stdin: 's', + multiline: 'M', + protocol: ['C', 'l'], + help: 'H', + ca: 'cafile' + }, + default: { + host: 'localhost', + qos: 0, + retain: false, + topic: '', + message: '' + } + }) + + if (args.help) { + return helpMe.toStdout('publish') + } + + if (args.key) { + args.key = fs.readFileSync(args.key) + } + + if (args.cert) { + args.cert = fs.readFileSync(args.cert) + } + + if (args.ca) { + args.ca = fs.readFileSync(args.ca) + } + + if (args.key && args.cert && !args.protocol) { + args.protocol = 'mqtts' + } + + if (args.port) { + if (typeof args.port !== 'number') { + console.warn('# Port: number expected, \'%s\' was given.', typeof args.port) + return + } + } + + if (args['will-topic']) { + args.will = {} + args.will.topic = args['will-topic'] + args.will.payload = args['will-message'] + args.will.qos = args['will-qos'] + args.will.retain = args['will-retain'] + } + + if (args.insecure) { + args.rejectUnauthorized = false + } + + args.topic = (args.topic || args._.shift()).toString() + args.message = (args.message || args._.shift()).toString() + + if (!args.topic) { + console.error('missing topic\n') + return helpMe.toStdout('publish') + } + + if (args.stdin) { + if (args.multiline) { + multisend(args) + } else { + process.stdin.pipe(concat(function (data) { + args.message = data + send(args) + })) + } + } else { + send(args) + } +} + +module.exports = start + +if (require.main === module) { + start(process.argv.slice(2)) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt_sub b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt_sub new file mode 100755 index 00000000..14bc5745 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/mqtt_sub @@ -0,0 +1,123 @@ +#!/usr/bin/env node + +var mqtt = require('../') +var path = require('path') +var fs = require('fs') +var helpMe = require('help-me')({ + dir: path.join(__dirname, '..', 'doc') +}) +var minimist = require('minimist') + +function start (args) { + args = minimist(args, { + string: ['hostname', 'username', 'password', 'key', 'cert', 'ca', 'clientId', 'i', 'id'], + boolean: ['stdin', 'help', 'clean', 'insecure'], + alias: { + port: 'p', + hostname: ['h', 'host'], + topic: 't', + qos: 'q', + clean: 'c', + keepalive: 'k', + clientId: ['i', 'id'], + username: 'u', + password: 'P', + protocol: ['C', 'l'], + verbose: 'v', + help: '-H', + ca: 'cafile' + }, + default: { + host: 'localhost', + qos: 0, + retain: false, + clean: true, + keepAlive: 30 // 30 sec + } + }) + + if (args.help) { + return helpMe.toStdout('subscribe') + } + + args.topic = args.topic || args._.shift() + + if (!args.topic) { + console.error('missing topic\n') + return helpMe.toStdout('subscribe') + } + + if (args.key) { + args.key = fs.readFileSync(args.key) + } + + if (args.cert) { + args.cert = fs.readFileSync(args.cert) + } + + if (args.ca) { + args.ca = fs.readFileSync(args.ca) + } + + if (args.key && args.cert && !args.protocol) { + args.protocol = 'mqtts' + } + + if (args.insecure) { + args.rejectUnauthorized = false + } + + if (args.port) { + if (typeof args.port !== 'number') { + console.warn('# Port: number expected, \'%s\' was given.', typeof args.port) + return + } + } + + if (args['will-topic']) { + args.will = {} + args.will.topic = args['will-topic'] + args.will.payload = args['will-message'] + args.will.qos = args['will-qos'] + args.will.retain = args['will-retain'] + } + + args.keepAlive = args['keep-alive'] + + var client = mqtt.connect(args) + + client.on('connect', function () { + client.subscribe(args.topic, { qos: args.qos }, function (err, result) { + if (err) { + console.error(err) + process.exit(1) + } + + result.forEach(function (sub) { + if (sub.qos > 2) { + console.error('subscription negated to', sub.topic, 'with code', sub.qos) + process.exit(1) + } + }) + }) + }) + + client.on('message', function (topic, payload) { + if (args.verbose) { + console.log(topic, payload.toString()) + } else { + console.log(payload.toString()) + } + }) + + client.on('error', function (err) { + console.warn(err) + client.end() + }) +} + +module.exports = start + +if (require.main === module) { + start(process.argv.slice(2)) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/.bin/prebuild-install b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/prebuild-install similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/.bin/prebuild-install rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/prebuild-install diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/rc b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/rc new file mode 100755 index 00000000..ab05b607 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/semver b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/semver new file mode 100755 index 00000000..801e77f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/.bin/semver @@ -0,0 +1,160 @@ +#!/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) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 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 https://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/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/binding-abstract.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/binding-abstract.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/binding-abstract.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/binding-abstract.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/package.json similarity index 87% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/package.json index 61dc6d34..9bdee911 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-abstract/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-abstract/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/binding-abstract@2.0.5", "_inBundle": false, "_integrity": "sha512-oRg0QRsXJFKHQbQjmo0regKLZ9JhjLmTqc47ocJgYM5UtU9Q1VFrVPh0B2lr2pfm/tr3aNvTLX1eiVAvXyZ/bg==", - "_location": "/raspi-io/@serialport/binding-abstract", + "_location": "/node-red-contrib-johnny-five/@serialport/binding-abstract", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,13 +17,13 @@ "fetchSpec": "^2.0.5" }, "_requiredBy": [ - "/raspi-io/@serialport/binding-mock", - "/raspi-io/@serialport/bindings" + "/node-red-contrib-johnny-five/@serialport/binding-mock", + "/node-red-contrib-johnny-five/@serialport/bindings" ], "_resolved": "https://registry.npmjs.org/@serialport/binding-abstract/-/binding-abstract-2.0.5.tgz", "_shasum": "e13305467c12effcd32c19c8b686a3f629e55cb3", "_spec": "@serialport/binding-abstract@^2.0.5", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/binding-mock.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/binding-mock.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/binding-mock.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/binding-mock.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/package.json similarity index 88% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/package.json index 313f4937..793da5fd 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/binding-mock/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/binding-mock/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/binding-mock@2.0.5", "_inBundle": false, "_integrity": "sha512-1kD1qI686pIIolGZ6TPjAtvy8c3XIUlE4OXRZf7ZHaZgGaOUHAUMLKZt4tNTxsfedRTFyiYyHoe5QAbx82R9pQ==", - "_location": "/raspi-io/@serialport/binding-mock", + "_location": "/node-red-contrib-johnny-five/@serialport/binding-mock", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,13 +17,13 @@ "fetchSpec": "^2.0.5" }, "_requiredBy": [ - "/raspi-io/@serialport/stream", - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/@serialport/stream", + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-2.0.5.tgz", "_shasum": "328bc73189843623531743133d95aa29c2a25a1d", "_spec": "@serialport/binding-mock@^2.0.5", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/binding.gyp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/binding.gyp similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/binding.gyp rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/binding.gyp diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Makefile b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Makefile similarity index 93% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Makefile rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Makefile index 52f74444..086ab601 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Makefile +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Makefile @@ -308,8 +308,8 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ endif quiet_cmd_regen_makefile = ACTION Regenerating $@ -cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/root/.node-gyp/10.15.1/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/root/.node-gyp/10.15.1" "-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/root/.node-gyp/10.15.1/<(target_arch)/node.lib" "-Dmodule_root_dir=/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings" "-Dnode_engine=v8" binding.gyp -Makefile: $(srcdir)/../../../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../../../../.node-gyp/10.15.1/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp +cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/root/.node-gyp/10.15.1/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/root/.node-gyp/10.15.1" "-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/root/.node-gyp/10.15.1/<(target_arch)/node.lib" "-Dmodule_root_dir=/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings" "-Dnode_engine=v8" binding.gyp +Makefile: $(srcdir)/../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../.node-gyp/10.15.1/include/node/common.gypi $(call do_cmd,regen_makefile) # "all" is a concatenation of the "all" targets from all the included diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/bindings.node.d b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/bindings.node.d similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/bindings.node.d rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/bindings.node.d diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings.node.d b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings.node.d similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings.node.d rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings.node.d diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/poller.o.d b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/poller.o.d similarity index 60% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/poller.o.d rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/poller.o.d index 24796c23..86db26a3 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/poller.o.d +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/poller.o.d @@ -1,7 +1,6 @@ -cmd_Release/obj.target/bindings/src/poller.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/poller.o.d.raw -c -o Release/obj.target/bindings/src/poller.o ../src/poller.cpp +cmd_Release/obj.target/bindings/src/poller.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/poller.o.d.raw -c -o Release/obj.target/bindings/src/poller.o ../src/poller.cpp Release/obj.target/bindings/src/poller.o: ../src/poller.cpp \ - ../../../../../nan/nan.h \ - /root/.node-gyp/10.15.1/include/node/node_version.h \ + ../../../nan/nan.h /root/.node-gyp/10.15.1/include/node/node_version.h \ /root/.node-gyp/10.15.1/include/node/uv.h \ /root/.node-gyp/10.15.1/include/node/uv/errno.h \ /root/.node-gyp/10.15.1/include/node/uv/version.h \ @@ -17,18 +16,16 @@ Release/obj.target/bindings/src/poller.o: ../src/poller.cpp \ /root/.node-gyp/10.15.1/include/node/node_buffer.h \ /root/.node-gyp/10.15.1/include/node/node.h \ /root/.node-gyp/10.15.1/include/node/node_object_wrap.h \ - ../../../../../nan/nan_callbacks.h \ - ../../../../../nan/nan_callbacks_12_inl.h \ - ../../../../../nan/nan_maybe_43_inl.h \ - ../../../../../nan/nan_converters.h \ - ../../../../../nan/nan_converters_43_inl.h ../../../../../nan/nan_new.h \ - ../../../../../nan/nan_implementation_12_inl.h \ - ../../../../../nan/nan_persistent_12_inl.h ../../../../../nan/nan_weak.h \ - ../../../../../nan/nan_object_wrap.h ../../../../../nan/nan_private.h \ - ../../../../../nan/nan_typedarray_contents.h \ - ../../../../../nan/nan_json.h ../src/./poller.h + ../../../nan/nan_callbacks.h ../../../nan/nan_callbacks_12_inl.h \ + ../../../nan/nan_maybe_43_inl.h ../../../nan/nan_converters.h \ + ../../../nan/nan_converters_43_inl.h ../../../nan/nan_new.h \ + ../../../nan/nan_implementation_12_inl.h \ + ../../../nan/nan_persistent_12_inl.h ../../../nan/nan_weak.h \ + ../../../nan/nan_object_wrap.h ../../../nan/nan_private.h \ + ../../../nan/nan_typedarray_contents.h ../../../nan/nan_json.h \ + ../src/./poller.h ../src/poller.cpp: -../../../../../nan/nan.h: +../../../nan/nan.h: /root/.node-gyp/10.15.1/include/node/node_version.h: /root/.node-gyp/10.15.1/include/node/uv.h: /root/.node-gyp/10.15.1/include/node/uv/errno.h: @@ -45,17 +42,17 @@ Release/obj.target/bindings/src/poller.o: ../src/poller.cpp \ /root/.node-gyp/10.15.1/include/node/node_buffer.h: /root/.node-gyp/10.15.1/include/node/node.h: /root/.node-gyp/10.15.1/include/node/node_object_wrap.h: -../../../../../nan/nan_callbacks.h: -../../../../../nan/nan_callbacks_12_inl.h: -../../../../../nan/nan_maybe_43_inl.h: -../../../../../nan/nan_converters.h: -../../../../../nan/nan_converters_43_inl.h: -../../../../../nan/nan_new.h: -../../../../../nan/nan_implementation_12_inl.h: -../../../../../nan/nan_persistent_12_inl.h: -../../../../../nan/nan_weak.h: -../../../../../nan/nan_object_wrap.h: -../../../../../nan/nan_private.h: -../../../../../nan/nan_typedarray_contents.h: -../../../../../nan/nan_json.h: +../../../nan/nan_callbacks.h: +../../../nan/nan_callbacks_12_inl.h: +../../../nan/nan_maybe_43_inl.h: +../../../nan/nan_converters.h: +../../../nan/nan_converters_43_inl.h: +../../../nan/nan_new.h: +../../../nan/nan_implementation_12_inl.h: +../../../nan/nan_persistent_12_inl.h: +../../../nan/nan_weak.h: +../../../nan/nan_object_wrap.h: +../../../nan/nan_private.h: +../../../nan/nan_typedarray_contents.h: +../../../nan/nan_json.h: ../src/./poller.h: diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport.o.d b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport.o.d similarity index 61% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport.o.d rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport.o.d index 98eaf0c2..c9ec9c2c 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport.o.d +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport.o.d @@ -1,6 +1,6 @@ -cmd_Release/obj.target/bindings/src/serialport.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/serialport.o.d.raw -c -o Release/obj.target/bindings/src/serialport.o ../src/serialport.cpp +cmd_Release/obj.target/bindings/src/serialport.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/serialport.o.d.raw -c -o Release/obj.target/bindings/src/serialport.o ../src/serialport.cpp Release/obj.target/bindings/src/serialport.o: ../src/serialport.cpp \ - ../src/./serialport.h ../../../../../nan/nan.h \ + ../src/./serialport.h ../../../nan/nan.h \ /root/.node-gyp/10.15.1/include/node/node_version.h \ /root/.node-gyp/10.15.1/include/node/uv.h \ /root/.node-gyp/10.15.1/include/node/uv/errno.h \ @@ -17,19 +17,17 @@ Release/obj.target/bindings/src/serialport.o: ../src/serialport.cpp \ /root/.node-gyp/10.15.1/include/node/node_buffer.h \ /root/.node-gyp/10.15.1/include/node/node.h \ /root/.node-gyp/10.15.1/include/node/node_object_wrap.h \ - ../../../../../nan/nan_callbacks.h \ - ../../../../../nan/nan_callbacks_12_inl.h \ - ../../../../../nan/nan_maybe_43_inl.h \ - ../../../../../nan/nan_converters.h \ - ../../../../../nan/nan_converters_43_inl.h ../../../../../nan/nan_new.h \ - ../../../../../nan/nan_implementation_12_inl.h \ - ../../../../../nan/nan_persistent_12_inl.h ../../../../../nan/nan_weak.h \ - ../../../../../nan/nan_object_wrap.h ../../../../../nan/nan_private.h \ - ../../../../../nan/nan_typedarray_contents.h \ - ../../../../../nan/nan_json.h ../src/./poller.h + ../../../nan/nan_callbacks.h ../../../nan/nan_callbacks_12_inl.h \ + ../../../nan/nan_maybe_43_inl.h ../../../nan/nan_converters.h \ + ../../../nan/nan_converters_43_inl.h ../../../nan/nan_new.h \ + ../../../nan/nan_implementation_12_inl.h \ + ../../../nan/nan_persistent_12_inl.h ../../../nan/nan_weak.h \ + ../../../nan/nan_object_wrap.h ../../../nan/nan_private.h \ + ../../../nan/nan_typedarray_contents.h ../../../nan/nan_json.h \ + ../src/./poller.h ../src/serialport.cpp: ../src/./serialport.h: -../../../../../nan/nan.h: +../../../nan/nan.h: /root/.node-gyp/10.15.1/include/node/node_version.h: /root/.node-gyp/10.15.1/include/node/uv.h: /root/.node-gyp/10.15.1/include/node/uv/errno.h: @@ -46,17 +44,17 @@ Release/obj.target/bindings/src/serialport.o: ../src/serialport.cpp \ /root/.node-gyp/10.15.1/include/node/node_buffer.h: /root/.node-gyp/10.15.1/include/node/node.h: /root/.node-gyp/10.15.1/include/node/node_object_wrap.h: -../../../../../nan/nan_callbacks.h: -../../../../../nan/nan_callbacks_12_inl.h: -../../../../../nan/nan_maybe_43_inl.h: -../../../../../nan/nan_converters.h: -../../../../../nan/nan_converters_43_inl.h: -../../../../../nan/nan_new.h: -../../../../../nan/nan_implementation_12_inl.h: -../../../../../nan/nan_persistent_12_inl.h: -../../../../../nan/nan_weak.h: -../../../../../nan/nan_object_wrap.h: -../../../../../nan/nan_private.h: -../../../../../nan/nan_typedarray_contents.h: -../../../../../nan/nan_json.h: +../../../nan/nan_callbacks.h: +../../../nan/nan_callbacks_12_inl.h: +../../../nan/nan_maybe_43_inl.h: +../../../nan/nan_converters.h: +../../../nan/nan_converters_43_inl.h: +../../../nan/nan_new.h: +../../../nan/nan_implementation_12_inl.h: +../../../nan/nan_persistent_12_inl.h: +../../../nan/nan_weak.h: +../../../nan/nan_object_wrap.h: +../../../nan/nan_private.h: +../../../nan/nan_typedarray_contents.h: +../../../nan/nan_json.h: ../src/./poller.h: diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d similarity index 65% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d index cee4e960..9b653fac 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d @@ -1,4 +1,4 @@ -cmd_Release/obj.target/bindings/src/serialport_linux.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d.raw -c -o Release/obj.target/bindings/src/serialport_linux.o ../src/serialport_linux.cpp +cmd_Release/obj.target/bindings/src/serialport_linux.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/serialport_linux.o.d.raw -c -o Release/obj.target/bindings/src/serialport_linux.o ../src/serialport_linux.cpp Release/obj.target/bindings/src/serialport_linux.o: \ ../src/serialport_linux.cpp ../src/serialport_linux.cpp: diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d similarity index 60% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d index 5921d14a..740f7d3a 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d @@ -1,8 +1,7 @@ -cmd_Release/obj.target/bindings/src/serialport_unix.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d.raw -c -o Release/obj.target/bindings/src/serialport_unix.o ../src/serialport_unix.cpp +cmd_Release/obj.target/bindings/src/serialport_unix.o := g++ '-DNODE_GYP_MODULE_NAME=bindings' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/10.15.1/include/node -I/root/.node-gyp/10.15.1/src -I/root/.node-gyp/10.15.1/deps/openssl/config -I/root/.node-gyp/10.15.1/deps/openssl/openssl/include -I/root/.node-gyp/10.15.1/deps/uv/include -I/root/.node-gyp/10.15.1/deps/zlib -I/root/.node-gyp/10.15.1/deps/v8/include -I../../../nan -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/bindings/src/serialport_unix.o.d.raw -c -o Release/obj.target/bindings/src/serialport_unix.o ../src/serialport_unix.cpp Release/obj.target/bindings/src/serialport_unix.o: \ ../src/serialport_unix.cpp ../src/serialport_unix.h ../src/serialport.h \ - ../../../../../nan/nan.h \ - /root/.node-gyp/10.15.1/include/node/node_version.h \ + ../../../nan/nan.h /root/.node-gyp/10.15.1/include/node/node_version.h \ /root/.node-gyp/10.15.1/include/node/uv.h \ /root/.node-gyp/10.15.1/include/node/uv/errno.h \ /root/.node-gyp/10.15.1/include/node/uv/version.h \ @@ -18,20 +17,18 @@ Release/obj.target/bindings/src/serialport_unix.o: \ /root/.node-gyp/10.15.1/include/node/node_buffer.h \ /root/.node-gyp/10.15.1/include/node/node.h \ /root/.node-gyp/10.15.1/include/node/node_object_wrap.h \ - ../../../../../nan/nan_callbacks.h \ - ../../../../../nan/nan_callbacks_12_inl.h \ - ../../../../../nan/nan_maybe_43_inl.h \ - ../../../../../nan/nan_converters.h \ - ../../../../../nan/nan_converters_43_inl.h ../../../../../nan/nan_new.h \ - ../../../../../nan/nan_implementation_12_inl.h \ - ../../../../../nan/nan_persistent_12_inl.h ../../../../../nan/nan_weak.h \ - ../../../../../nan/nan_object_wrap.h ../../../../../nan/nan_private.h \ - ../../../../../nan/nan_typedarray_contents.h \ - ../../../../../nan/nan_json.h ../src/serialport_linux.h + ../../../nan/nan_callbacks.h ../../../nan/nan_callbacks_12_inl.h \ + ../../../nan/nan_maybe_43_inl.h ../../../nan/nan_converters.h \ + ../../../nan/nan_converters_43_inl.h ../../../nan/nan_new.h \ + ../../../nan/nan_implementation_12_inl.h \ + ../../../nan/nan_persistent_12_inl.h ../../../nan/nan_weak.h \ + ../../../nan/nan_object_wrap.h ../../../nan/nan_private.h \ + ../../../nan/nan_typedarray_contents.h ../../../nan/nan_json.h \ + ../src/serialport_linux.h ../src/serialport_unix.cpp: ../src/serialport_unix.h: ../src/serialport.h: -../../../../../nan/nan.h: +../../../nan/nan.h: /root/.node-gyp/10.15.1/include/node/node_version.h: /root/.node-gyp/10.15.1/include/node/uv.h: /root/.node-gyp/10.15.1/include/node/uv/errno.h: @@ -48,17 +45,17 @@ Release/obj.target/bindings/src/serialport_unix.o: \ /root/.node-gyp/10.15.1/include/node/node_buffer.h: /root/.node-gyp/10.15.1/include/node/node.h: /root/.node-gyp/10.15.1/include/node/node_object_wrap.h: -../../../../../nan/nan_callbacks.h: -../../../../../nan/nan_callbacks_12_inl.h: -../../../../../nan/nan_maybe_43_inl.h: -../../../../../nan/nan_converters.h: -../../../../../nan/nan_converters_43_inl.h: -../../../../../nan/nan_new.h: -../../../../../nan/nan_implementation_12_inl.h: -../../../../../nan/nan_persistent_12_inl.h: -../../../../../nan/nan_weak.h: -../../../../../nan/nan_object_wrap.h: -../../../../../nan/nan_private.h: -../../../../../nan/nan_typedarray_contents.h: -../../../../../nan/nan_json.h: +../../../nan/nan_callbacks.h: +../../../nan/nan_callbacks_12_inl.h: +../../../nan/nan_maybe_43_inl.h: +../../../nan/nan_converters.h: +../../../nan/nan_converters_43_inl.h: +../../../nan/nan_new.h: +../../../nan/nan_implementation_12_inl.h: +../../../nan/nan_persistent_12_inl.h: +../../../nan/nan_weak.h: +../../../nan/nan_object_wrap.h: +../../../nan/nan_private.h: +../../../nan/nan_typedarray_contents.h: +../../../nan/nan_json.h: ../src/serialport_linux.h: diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/bindings.node b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/bindings.node similarity index 92% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/bindings.node rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/bindings.node index 7b82c583..de65ca97 100755 Binary files a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/bindings.node and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/bindings.node differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings.node b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings.node similarity index 92% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings.node rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings.node index 7b82c583..de65ca97 100755 Binary files a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings.node and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings.node differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/poller.o b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/poller.o similarity index 92% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/poller.o rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/poller.o index e627829c..d6f12a4e 100644 Binary files a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/poller.o and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/poller.o differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport.o b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport.o similarity index 93% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport.o rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport.o index 8af977e9..2e6ef023 100644 Binary files a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport.o and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport.o differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_linux.o b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_linux.o similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_linux.o rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_linux.o diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_unix.o b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_unix.o similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_unix.o rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/Release/obj.target/bindings/src/serialport_unix.o diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/binding.Makefile b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/binding.Makefile similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/binding.Makefile rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/binding.Makefile diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/bindings.target.mk b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/bindings.target.mk similarity index 98% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/bindings.target.mk rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/bindings.target.mk index 7dceca7f..3faf0731 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/bindings.target.mk +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/bindings.target.mk @@ -41,7 +41,7 @@ INCS_Debug := \ -I/root/.node-gyp/10.15.1/deps/uv/include \ -I/root/.node-gyp/10.15.1/deps/zlib \ -I/root/.node-gyp/10.15.1/deps/v8/include \ - -I$(srcdir)/../../../../nan + -I$(srcdir)/../../nan DEFS_Release := \ '-DNODE_GYP_MODULE_NAME=bindings' \ @@ -79,7 +79,7 @@ INCS_Release := \ -I/root/.node-gyp/10.15.1/deps/uv/include \ -I/root/.node-gyp/10.15.1/deps/zlib \ -I/root/.node-gyp/10.15.1/deps/v8/include \ - -I$(srcdir)/../../../../nan + -I$(srcdir)/../../nan OBJS := \ $(obj).target/$(TARGET)/src/serialport.o \ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/config.gypi b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/config.gypi similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/config.gypi rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/config.gypi index 8fddeff5..7182bb37 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/build/config.gypi +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/build/config.gypi @@ -159,9 +159,9 @@ "cert": "", "global": "", "link": "", - "save": "true", "access": "", "also": "", + "save": "true", "unicode": "true", "unsafe_perm": "true", "long": "", diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/bindings-test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/bindings-test.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/bindings-test.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/bindings-test.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/bindings-win32-sn-parser-test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/bindings-win32-sn-parser-test.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/bindings-win32-sn-parser-test.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/bindings-win32-sn-parser-test.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/darwin.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/darwin.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/darwin.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/darwin.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/index.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/index.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/index.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/linux-list-test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/linux-list-test.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/linux-list-test.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/linux-list-test.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/linux-list.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/linux-list.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/linux-list.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/linux-list.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/linux.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/linux.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/linux.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/linux.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/poller.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/poller.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/poller.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/poller.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/unix-read.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/unix-read.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/unix-read.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/unix-read.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/unix-write.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/unix-write.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/unix-write.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/unix-write.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/util.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/util.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/util.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/util.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/win32-sn-parser.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/win32-sn-parser.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/win32-sn-parser.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/win32-sn-parser.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/win32.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/win32.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/lib/win32.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/lib/win32.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/package.json similarity index 94% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/package.json index 0ab4899b..fc630e2f 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/bindings@2.0.8", "_inBundle": false, "_integrity": "sha512-paKLa9JkoH5FAy2sATTdXLCiKpuKn0pN15/etcCqzX8vi25fnQgJ8Yx9Z6zdbcKe1No7s/9PuH9yfjDR61fbOQ==", - "_location": "/raspi-io/@serialport/bindings", + "_location": "/node-red-contrib-johnny-five/@serialport/bindings", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,12 +17,12 @@ "fetchSpec": "^2.0.8" }, "_requiredBy": [ - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/bindings/-/bindings-2.0.8.tgz", "_shasum": "30344814cc284c5ed4f76af644c9cdbd1b240e59", "_spec": "@serialport/bindings@^2.0.8", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/darwin_list.cpp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/darwin_list.cpp similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/darwin_list.cpp rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/darwin_list.cpp diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/darwin_list.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/darwin_list.h similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/darwin_list.h rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/darwin_list.h diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/poller.cpp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/poller.cpp similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/poller.cpp rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/poller.cpp diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/poller.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/poller.h similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/poller.h rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/poller.h diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport.cpp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport.cpp similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport.cpp rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport.cpp diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport.h similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport.h rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport.h diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_linux.cpp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_linux.cpp similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_linux.cpp rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_linux.cpp diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_linux.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_linux.h similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_linux.h rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_linux.h diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_unix.cpp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_unix.cpp similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_unix.cpp rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_unix.cpp diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_unix.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_unix.h similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_unix.h rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_unix.h diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_win.cpp b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_win.cpp similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_win.cpp rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_win.cpp diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_win.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_win.h similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/bindings/src/serialport_win.h rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings/src/serialport_win.h diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/byte-length.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/byte-length.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/byte-length.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/byte-length.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/package.json similarity index 90% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/package.json index 4f31e911..986ef727 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-byte-length/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-byte-length/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/parser-byte-length@2.0.2", "_inBundle": false, "_integrity": "sha512-cUOprk1uRLucCJy6m+wAM4pwdBaB5D4ySi6juwRScP9DTjKUvGWYj5jzuqvftFBvYFmFza89aLj5K23xiiqj7Q==", - "_location": "/raspi-io/@serialport/parser-byte-length", + "_location": "/node-red-contrib-johnny-five/@serialport/parser-byte-length", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,12 +17,12 @@ "fetchSpec": "^2.0.2" }, "_requiredBy": [ - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-2.0.2.tgz", "_shasum": "88619132b5aaa6a39828abe6ac4f921cdd5f6b01", "_spec": "@serialport/parser-byte-length@^2.0.2", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/cctalk.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/cctalk.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/cctalk.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/cctalk.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/package.json similarity index 90% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/package.json index 693949bf..5e8eba50 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-cctalk/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-cctalk/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/parser-cctalk@2.0.2", "_inBundle": false, "_integrity": "sha512-5LMysRv7De+TeeoKzi4+sgouD4tqZEAn1agAVevw+7ILM0m30i1zgZLtchgxtCH7OoQRAkENEVEPc0OwhghKgw==", - "_location": "/raspi-io/@serialport/parser-cctalk", + "_location": "/node-red-contrib-johnny-five/@serialport/parser-cctalk", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,12 +17,12 @@ "fetchSpec": "^2.0.2" }, "_requiredBy": [ - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-2.0.2.tgz", "_shasum": "7a2713f415c6286c3d78cddab4757cd0b39ef026", "_spec": "@serialport/parser-cctalk@^2.0.2", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/delimiter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/delimiter.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/delimiter.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/delimiter.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/package.json similarity index 87% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/package.json index 35349f2e..4cca62eb 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-delimiter/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-delimiter/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/parser-delimiter@2.0.2", "_inBundle": false, "_integrity": "sha512-zB02LahFfyZmJqak9l37vP/F1K+KCUxd1KQj35OhD1+0q/unMjVTZmsfkxFSM4gkaxP9j7+8USk+LQJ3V8U26Q==", - "_location": "/raspi-io/@serialport/parser-delimiter", + "_location": "/node-red-contrib-johnny-five/@serialport/parser-delimiter", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,13 +17,13 @@ "fetchSpec": "^2.0.2" }, "_requiredBy": [ - "/raspi-io/@serialport/parser-readline", - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/@serialport/parser-readline", + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-2.0.2.tgz", "_shasum": "2765b37c8227c22e1e48f51f8c84cdeb2c650988", "_spec": "@serialport/parser-delimiter@^2.0.2", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/package.json similarity index 87% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/package.json index 56b1760c..7640ab2f 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/parser-readline@2.0.2", "_inBundle": false, "_integrity": "sha512-thL26dGEHB+eINNydJmzcLLhiqcBQkF+wNTbRaYblTP/6dm7JsfjYSud7bTkN63AgE0xpe9tKXBFqc8zgJ1VKg==", - "_location": "/raspi-io/@serialport/parser-readline", + "_location": "/node-red-contrib-johnny-five/@serialport/parser-readline", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,13 +17,13 @@ "fetchSpec": "^2.0.2" }, "_requiredBy": [ - "/raspi-io/@serialport/bindings", - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/@serialport/bindings", + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-2.0.2.tgz", "_shasum": "850882a8abd6df50ac538301ae53e374fd510277", "_spec": "@serialport/parser-readline@^2.0.2", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/readline.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/readline.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-readline/readline.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-readline/readline.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/package.json similarity index 90% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/package.json index 6f4ad9e6..9c5c0530 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/parser-ready@2.0.2", "_inBundle": false, "_integrity": "sha512-6ynQ+HIIkFQcEO2Hrq4Qmdz+hlJ7kjTHGQ1E7SRN7f70nnys1v3HSke8mjK3RzVw+SwL0rBYjftUdCTrU+7c+Q==", - "_location": "/raspi-io/@serialport/parser-ready", + "_location": "/node-red-contrib-johnny-five/@serialport/parser-ready", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,12 +17,12 @@ "fetchSpec": "^2.0.2" }, "_requiredBy": [ - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-2.0.2.tgz", "_shasum": "de5e4a613afc7ba6d11533c111f756e51f6e8080", "_spec": "@serialport/parser-ready@^2.0.2", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/ready.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/ready.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-ready/ready.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-ready/ready.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/package.json similarity index 90% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/package.json index 7f0eaee9..8ccc236f 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/parser-regex@2.0.2", "_inBundle": false, "_integrity": "sha512-7qjYd7AdHUK8fJOmHpXlMRipqRCVMMyDFyf/5TQQiOt6q+BiFjLOtSpVXhakHwgnXanzDYKeRSB8zM0pZZg+LA==", - "_location": "/raspi-io/@serialport/parser-regex", + "_location": "/node-red-contrib-johnny-five/@serialport/parser-regex", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,12 +17,12 @@ "fetchSpec": "^2.0.2" }, "_requiredBy": [ - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-2.0.2.tgz", "_shasum": "fde13ca38770ea53a77e8f0c53b2c46b2cef805a", "_spec": "@serialport/parser-regex@^2.0.2", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/regex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/regex.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/parser-regex/regex.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/parser-regex/regex.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/package.json similarity index 90% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/package.json index c0bc3f99..31afd1e0 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/package.json @@ -3,7 +3,7 @@ "_id": "@serialport/stream@2.0.5", "_inBundle": false, "_integrity": "sha512-9gc3zPoAqs/04mvq8TdZ7GxtnacCDuw3/u0u18UXXHgC/5tNDYkY+hXFIJB1fQFnP5yyNB1L2XLfX974ySJg9Q==", - "_location": "/raspi-io/@serialport/stream", + "_location": "/node-red-contrib-johnny-five/@serialport/stream", "_phantomChildren": {}, "_requested": { "type": "range", @@ -17,12 +17,12 @@ "fetchSpec": "^2.0.5" }, "_requiredBy": [ - "/raspi-io/serialport" + "/node-red-contrib-johnny-five/serialport" ], "_resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-2.0.5.tgz", "_shasum": "1a39be184e23de1abe229df00469944ac45118c3", "_spec": "@serialport/stream@^2.0.5", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/serialport", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/serialport", "bugs": { "url": "https://github.com/node-serialport/node-serialport/issues" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/stream.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/stream.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/@serialport/stream/stream.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/stream/stream.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/index.js new file mode 100644 index 00000000..b9574ed7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/license b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/package.json new file mode 100644 index 00000000..a452f496 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/package.json @@ -0,0 +1,108 @@ +{ + "_from": "ansi-regex@^2.0.0", + "_id": "ansi-regex@2.1.1", + "_inBundle": false, + "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "_location": "/node-red-contrib-johnny-five/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": [ + "/node-red-contrib-johnny-five/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "_spec": "ansi-regex@^2.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/strip-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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000..6a928edf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/index.js new file mode 100644 index 00000000..90a871c4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/index.js @@ -0,0 +1,165 @@ +'use strict'; +const colorConvert = require('color-convert'); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + 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], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/license b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/LICENSE new file mode 100644 index 00000000..5b4c386f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011-2016 Heather Arthur + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/README.md new file mode 100644 index 00000000..d4b08fc3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/README.md @@ -0,0 +1,68 @@ +# color-convert + +[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) + +Color-convert is a color conversion library for JavaScript and node. +It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): + +```js +var convert = require('color-convert'); + +convert.rgb.hsl(140, 200, 100); // [96, 48, 59] +convert.keyword.rgb('blue'); // [0, 0, 255] + +var rgbChannels = convert.rgb.channels; // 3 +var cmykChannels = convert.cmyk.channels; // 4 +var ansiChannels = convert.ansi16.channels; // 1 +``` + +# Install + +```console +$ npm install color-convert +``` + +# API + +Simply get the property of the _from_ and _to_ conversion that you're looking for. + +All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. + +All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). + +```js +var convert = require('color-convert'); + +// Hex to LAB +convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] +convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] + +// RGB to CMYK +convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] +convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] +``` + +### Arrays +All functions that accept multiple arguments also support passing an array. + +Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) + +```js +var convert = require('color-convert'); + +convert.rgb.hex(123, 45, 67); // '7B2D43' +convert.rgb.hex([123, 45, 67]); // '7B2D43' +``` + +## Routing + +Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). + +Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). + +# Contribute + +If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. + +# License +Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/conversions.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/conversions.js new file mode 100644 index 00000000..32172007 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/conversions.js @@ -0,0 +1,868 @@ +/* MIT license */ +var cssKeywords = require('color-name'); + +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) + +var reverseKeywords = {}; +for (var key in cssKeywords) { + if (cssKeywords.hasOwnProperty(key)) { + reverseKeywords[cssKeywords[key]] = key; + } +} + +var convert = module.exports = { + rgb: {channels: 3, labels: 'rgb'}, + hsl: {channels: 3, labels: 'hsl'}, + hsv: {channels: 3, labels: 'hsv'}, + hwb: {channels: 3, labels: 'hwb'}, + cmyk: {channels: 4, labels: 'cmyk'}, + xyz: {channels: 3, labels: 'xyz'}, + lab: {channels: 3, labels: 'lab'}, + lch: {channels: 3, labels: 'lch'}, + hex: {channels: 1, labels: ['hex']}, + keyword: {channels: 1, labels: ['keyword']}, + ansi16: {channels: 1, labels: ['ansi16']}, + ansi256: {channels: 1, labels: ['ansi256']}, + hcg: {channels: 3, labels: ['h', 'c', 'g']}, + apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, + gray: {channels: 1, labels: ['gray']} +}; + +// hide .channels and .labels properties +for (var model in convert) { + if (convert.hasOwnProperty(model)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } + + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } + + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } + + var channels = convert[model].channels; + var labels = convert[model].labels; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); + } +} + +convert.rgb.hsl = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h; + var s; + var l; + + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } + + h = Math.min(h * 60, 360); + + if (h < 0) { + h += 360; + } + + l = (min + max) / 2; + + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + + return [h, s * 100, l * 100]; +}; + +convert.rgb.hsv = function (rgb) { + var rdif; + var gdif; + var bdif; + var h; + var s; + + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var v = Math.max(r, g, b); + var diff = v - Math.min(r, g, b); + var diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; + + if (diff === 0) { + h = s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + + return [ + h * 360, + s * 100, + v * 100 + ]; +}; + +convert.rgb.hwb = function (rgb) { + var r = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r, Math.min(g, b)); + + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); + + return [h, w * 100, b * 100]; +}; + +convert.rgb.cmyk = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var c; + var m; + var y; + var k; + + k = Math.min(1 - r, 1 - g, 1 - b); + c = (1 - r - k) / (1 - k) || 0; + m = (1 - g - k) / (1 - k) || 0; + y = (1 - b - k) / (1 - k) || 0; + + return [c * 100, m * 100, y * 100, k * 100]; +}; + +/** + * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + * */ +function comparativeDistance(x, y) { + return ( + Math.pow(x[0] - y[0], 2) + + Math.pow(x[1] - y[1], 2) + + Math.pow(x[2] - y[2], 2) + ); +} + +convert.rgb.keyword = function (rgb) { + var reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + + var currentClosestDistance = Infinity; + var currentClosestKeyword; + + for (var keyword in cssKeywords) { + if (cssKeywords.hasOwnProperty(keyword)) { + var value = cssKeywords[keyword]; + + // Compute comparative distance + var distance = comparativeDistance(rgb, value); + + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + } + + return currentClosestKeyword; +}; + +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; +}; + +convert.rgb.xyz = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + + // assume sRGB + r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); + g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); + b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); + + var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); + + return [x * 100, y * 100, z * 100]; +}; + +convert.rgb.lab = function (rgb) { + var xyz = convert.rgb.xyz(rgb); + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); + + return [l, a, b]; +}; + +convert.hsl.rgb = function (hsl) { + var h = hsl[0] / 360; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var t1; + var t2; + var t3; + var rgb; + var val; + + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + + t1 = 2 * l - t2; + + rgb = [0, 0, 0]; + for (var i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } + if (t3 > 1) { + t3--; + } + + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } + + rgb[i] = val * 255; + } + + return rgb; +}; + +convert.hsl.hsv = function (hsl) { + var h = hsl[0]; + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var smin = s; + var lmin = Math.max(l, 0.01); + var sv; + var v; + + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + v = (l + s) / 2; + sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + + return [h, sv * 100, v * 100]; +}; + +convert.hsv.rgb = function (hsv) { + var h = hsv[0] / 60; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; + + var f = h - Math.floor(h); + var p = 255 * v * (1 - s); + var q = 255 * v * (1 - (s * f)); + var t = 255 * v * (1 - (s * (1 - f))); + v *= 255; + + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } +}; + +convert.hsv.hsl = function (hsv) { + var h = hsv[0]; + var s = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var lmin; + var sl; + var l; + + l = (2 - s) * v; + lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + + return [h, sl * 100, l * 100]; +}; + +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var i; + var v; + var f; + var n; + + // wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + + i = Math.floor(6 * h); + v = 1 - bl; + f = 6 * h - i; + + if ((i & 0x01) !== 0) { + f = 1 - f; + } + + n = wh + f * (v - wh); // linear interpolation + + var r; + var g; + var b; + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; + } + + return [r * 255, g * 255, b * 255]; +}; + +convert.cmyk.rgb = function (cmyk) { + var c = cmyk[0] / 100; + var m = cmyk[1] / 100; + var y = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r; + var g; + var b; + + r = 1 - Math.min(1, c * (1 - k) + k); + g = 1 - Math.min(1, m * (1 - k) + k); + b = 1 - Math.min(1, y * (1 - k) + k); + + return [r * 255, g * 255, b * 255]; +}; + +convert.xyz.rgb = function (xyz) { + var x = xyz[0] / 100; + var y = xyz[1] / 100; + var z = xyz[2] / 100; + var r; + var g; + var b; + + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); + + // assume sRGB + r = r > 0.0031308 + ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) + : r * 12.92; + + g = g > 0.0031308 + ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) + : g * 12.92; + + b = b > 0.0031308 + ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) + : b * 12.92; + + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + + return [r * 255, g * 255, b * 255]; +}; + +convert.xyz.lab = function (xyz) { + var x = xyz[0]; + var y = xyz[1]; + var z = xyz[2]; + var l; + var a; + var b; + + x /= 95.047; + y /= 100; + z /= 108.883; + + x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); + + l = (116 * y) - 16; + a = 500 * (x - y); + b = 200 * (y - z); + + return [l, a, b]; +}; + +convert.lab.xyz = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var x; + var y; + var z; + + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + + var y2 = Math.pow(y, 3); + var x2 = Math.pow(x, 3); + var z2 = Math.pow(z, 3); + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; + + x *= 95.047; + y *= 100; + z *= 108.883; + + return [x, y, z]; +}; + +convert.lab.lch = function (lab) { + var l = lab[0]; + var a = lab[1]; + var b = lab[2]; + var hr; + var h; + var c; + + hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; + + if (h < 0) { + h += 360; + } + + c = Math.sqrt(a * a + b * b); + + return [l, c, h]; +}; + +convert.lch.lab = function (lch) { + var l = lch[0]; + var c = lch[1]; + var h = lch[2]; + var a; + var b; + var hr; + + hr = h / 360 * 2 * Math.PI; + a = c * Math.cos(hr); + b = c * Math.sin(hr); + + return [l, a, b]; +}; + +convert.rgb.ansi16 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization + + value = Math.round(value / 50); + + if (value === 0) { + return 30; + } + + var ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); + + if (value === 2) { + ansi += 60; + } + + return ansi; +}; + +convert.hsv.ansi16 = function (args) { + // optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); +}; + +convert.rgb.ansi256 = function (args) { + var r = args[0]; + var g = args[1]; + var b = args[2]; + + // we use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; + } + + if (r > 248) { + return 231; + } + + return Math.round(((r - 8) / 247) * 24) + 232; + } + + var ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); + + return ansi; +}; + +convert.ansi16.rgb = function (args) { + var color = args % 10; + + // handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } + + color = color / 10.5 * 255; + + return [color, color, color]; + } + + var mult = (~~(args > 50) + 1) * 0.5; + var r = ((color & 1) * mult) * 255; + var g = (((color >> 1) & 1) * mult) * 255; + var b = (((color >> 2) & 1) * mult) * 255; + + return [r, g, b]; +}; + +convert.ansi256.rgb = function (args) { + // handle greyscale + if (args >= 232) { + var c = (args - 232) * 10 + 8; + return [c, c, c]; + } + + args -= 16; + + var rem; + var r = Math.floor(args / 36) / 5 * 255; + var g = Math.floor((rem = args % 36) / 6) / 5 * 255; + var b = (rem % 6) / 5 * 255; + + return [r, g, b]; +}; + +convert.rgb.hex = function (args) { + var integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); + + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; + +convert.hex.rgb = function (args) { + var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + + var colorString = match[0]; + + if (match[0].length === 3) { + colorString = colorString.split('').map(function (char) { + return char + char; + }).join(''); + } + + var integer = parseInt(colorString, 16); + var r = (integer >> 16) & 0xFF; + var g = (integer >> 8) & 0xFF; + var b = integer & 0xFF; + + return [r, g, b]; +}; + +convert.rgb.hcg = function (rgb) { + var r = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r, g), b); + var min = Math.min(Math.min(r, g), b); + var chroma = (max - min); + var grayscale; + var hue; + + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma + 4; + } + + hue /= 6; + hue %= 1; + + return [hue * 360, chroma * 100, grayscale * 100]; +}; + +convert.hsl.hcg = function (hsl) { + var s = hsl[1] / 100; + var l = hsl[2] / 100; + var c = 1; + var f = 0; + + if (l < 0.5) { + c = 2.0 * s * l; + } else { + c = 2.0 * s * (1.0 - l); + } + + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } + + return [hsl[0], c * 100, f * 100]; +}; + +convert.hsv.hcg = function (hsv) { + var s = hsv[1] / 100; + var v = hsv[2] / 100; + + var c = s * v; + var f = 0; + + if (c < 1.0) { + f = (v - c) / (1 - c); + } + + return [hsv[0], c * 100, f * 100]; +}; + +convert.hcg.rgb = function (hcg) { + var h = hcg[0] / 360; + var c = hcg[1] / 100; + var g = hcg[2] / 100; + + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } + + var pure = [0, 0, 0]; + var hi = (h % 1) * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; + + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; + } + + mg = (1.0 - c) * g; + + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; + +convert.hcg.hsv = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + + var v = c + g * (1.0 - c); + var f = 0; + + if (v > 0.0) { + f = c / v; + } + + return [hcg[0], f * 100, v * 100]; +}; + +convert.hcg.hsl = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + + var l = g * (1.0 - c) + 0.5 * c; + var s = 0; + + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } + + return [hcg[0], s * 100, l * 100]; +}; + +convert.hcg.hwb = function (hcg) { + var c = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; +}; + +convert.hwb.hcg = function (hwb) { + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c = v - w; + var g = 0; + + if (c < 1) { + g = (v - c) / (1 - c); + } + + return [hwb[0], c * 100, g * 100]; +}; + +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; + +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; + +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; + +convert.gray.hsl = convert.gray.hsv = function (args) { + return [0, 0, args[0]]; +}; + +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; +}; + +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; + +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; +}; + +convert.gray.hex = function (gray) { + var val = Math.round(gray[0] / 100 * 255) & 0xFF; + var integer = (val << 16) + (val << 8) + val; + + var string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; + +convert.rgb.gray = function (rgb) { + var val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/index.js new file mode 100644 index 00000000..e65b5d77 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/index.js @@ -0,0 +1,78 @@ +var conversions = require('./conversions'); +var route = require('./route'); + +var convert = {}; + +var models = Object.keys(conversions); + +function wrapRaw(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } + + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + + return fn(args); + }; + + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +function wrapRounded(fn) { + var wrappedFn = function (args) { + if (args === undefined || args === null) { + return args; + } + + if (arguments.length > 1) { + args = Array.prototype.slice.call(arguments); + } + + var result = fn(args); + + // we're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (var len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + + return result; + }; + + // preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } + + return wrappedFn; +} + +models.forEach(function (fromModel) { + convert[fromModel] = {}; + + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); + + var routes = route(fromModel); + var routeModels = Object.keys(routes); + + routeModels.forEach(function (toModel) { + var fn = routes[toModel]; + + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); + +module.exports = convert; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/package.json new file mode 100644 index 00000000..5891a3fe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/package.json @@ -0,0 +1,81 @@ +{ + "_from": "color-convert@^1.9.0", + "_id": "color-convert@1.9.3", + "_inBundle": false, + "_integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "_location": "/node-red-contrib-johnny-five/ansi-styles/color-convert", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "color-convert@^1.9.0", + "name": "color-convert", + "escapedName": "color-convert", + "rawSpec": "^1.9.0", + "saveSpec": null, + "fetchSpec": "^1.9.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/ansi-styles" + ], + "_resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "_shasum": "bb71850690e1f136567de629d2d5471deda4c1e8", + "_spec": "color-convert@^1.9.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles", + "author": { + "name": "Heather Arthur", + "email": "fayearthur@gmail.com" + }, + "bugs": { + "url": "https://github.com/Qix-/color-convert/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-name": "1.1.3" + }, + "deprecated": false, + "description": "Plain color conversion functions", + "devDependencies": { + "chalk": "1.1.1", + "xo": "0.11.2" + }, + "files": [ + "index.js", + "conversions.js", + "css-keywords.js", + "route.js" + ], + "homepage": "https://github.com/Qix-/color-convert#readme", + "keywords": [ + "color", + "colour", + "convert", + "converter", + "conversion", + "rgb", + "hsl", + "hsv", + "hwb", + "cmyk", + "ansi", + "ansi16" + ], + "license": "MIT", + "name": "color-convert", + "repository": { + "type": "git", + "url": "git+https://github.com/Qix-/color-convert.git" + }, + "scripts": { + "pretest": "xo", + "test": "node test/basic.js" + }, + "version": "1.9.3", + "xo": { + "rules": { + "default-case": 0, + "no-inline-comments": 0, + "operator-linebreak": 0 + } + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/route.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/route.js new file mode 100644 index 00000000..0a1fdea6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/node_modules/color-convert/route.js @@ -0,0 +1,97 @@ +var conversions = require('./conversions'); + +/* + this function routes a model to all other models. + + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). + + conversions that are not possible simply are not included. +*/ + +function buildGraph() { + var graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + var models = Object.keys(conversions); + + for (var len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + + return graph; +} + +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + var graph = buildGraph(); + var queue = [fromModel]; // unshift -> queue -> pop + + graph[fromModel].distance = 0; + + while (queue.length) { + var current = queue.pop(); + var adjacents = Object.keys(conversions[current]); + + for (var len = adjacents.length, i = 0; i < len; i++) { + var adjacent = adjacents[i]; + var node = graph[adjacent]; + + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + + return graph; +} + +function link(from, to) { + return function (args) { + return to(from(args)); + }; +} + +function wrapConversion(toModel, graph) { + var path = [graph[toModel].parent, toModel]; + var fn = conversions[graph[toModel].parent][toModel]; + + var cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + + fn.conversion = path; + return fn; +} + +module.exports = function (fromModel) { + var graph = deriveBFS(fromModel); + var conversion = {}; + + var models = Object.keys(graph); + for (var len = models.length, i = 0; i < len; i++) { + var toModel = models[i]; + var node = graph[toModel]; + + if (node.parent === null) { + // no possible conversion, or this node is the source model. + continue; + } + + conversion[toModel] = wrapConversion(toModel, graph); + } + + return conversion; +}; + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/package.json new file mode 100644 index 00000000..de8ba5e1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/package.json @@ -0,0 +1,90 @@ +{ + "_from": "ansi-styles@^3.1.0", + "_id": "ansi-styles@3.2.1", + "_inBundle": false, + "_integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "_location": "/node-red-contrib-johnny-five/ansi-styles", + "_phantomChildren": { + "color-name": "1.1.3" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-styles@^3.1.0", + "name": "ansi-styles", + "escapedName": "ansi-styles", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "_shasum": "41fbb20243e50b12be0f04b8dedbf07520ce841d", + "_spec": "ansi-styles@^3.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "ava": { + "require": "babel-polyfill" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-convert": "^1.9.0" + }, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "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", + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava" + }, + "version": "3.2.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/readme.md new file mode 100644 index 00000000..3158e2df --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ansi-styles/readme.md @@ -0,0 +1,147 @@ +# 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. + + + + +## Install + +``` +$ npm install ansi-styles +``` + + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.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` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + + +## 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. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/LICENSE new file mode 100644 index 00000000..f4be44d8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/README.md new file mode 100644 index 00000000..0bfc594c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/README.md @@ -0,0 +1,94 @@ +aproba +====== + +A ridiculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +| type | description +| :--: | :---------- +| * | matches any type +| A | `Array.isArray` OR an `arguments` object +| S | typeof == string +| N | typeof == number +| F | typeof == function +| O | typeof == object and not type A and not type E +| B | typeof == boolean +| E | `instanceof Error` OR `null` **(special: see below)** +| Z | == `null` + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If you pass in an invalid type then it will throw with a code of +`EUNKNOWNTYPE`. + +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + + +### Browser support + +This has no dependencies and should work in browsers, though you'll have +noisier stack traces. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/index.js new file mode 100644 index 00000000..6f3f797c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/index.js @@ -0,0 +1,105 @@ +'use strict' + +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') +} + +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching + } +} + +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) +} + +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) +} + +function invalidType (num, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) +} + +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') +} + +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/package.json new file mode 100644 index 00000000..24d56bf1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/aproba/package.json @@ -0,0 +1,62 @@ +{ + "_from": "aproba@^1.0.3", + "_id": "aproba@1.2.0", + "_inBundle": false, + "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "_location": "/node-red-contrib-johnny-five/aproba", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aproba@^1.0.3", + "name": "aproba", + "escapedName": "aproba", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/gauge" + ], + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", + "_spec": "aproba@^1.0.3", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.0.2" + }, + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/aproba", + "keywords": [ + "argument", + "validate" + ], + "license": "ISC", + "main": "index.js", + "name": "aproba", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/aproba.git" + }, + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "version": "1.2.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/CHANGES.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/CHANGES.md new file mode 100644 index 00000000..21f3b1c1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,37 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.5 2018-05-24 + +* [#92](https://github.com/iarna/are-we-there-yet/pull/92) Fix bug where + `finish` would throw errors when including `TrackerStream` objects in + `TrackerGroup` collections. (@brianloveswords) + +## 1.1.4 2017-04-21 + +* Fix typo in package.json + +## 1.1.3 2017-04-21 + +* Improve documentation and limit files included in the distribution. + +## 1.1.2 2016-03-15 + +* Add tracker group cycle detection and tests for it + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/LICENSE new file mode 100644 index 00000000..af458806 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/README.md new file mode 100644 index 00000000..7e2b42d8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/README.md @@ -0,0 +1,195 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +* var completed = tracker.completed() + +Implemented in: `Tracker`, `TrackerGroup`, `TrackerStream` + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Implemented in: `Tracker`, `TrackerGroup` + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/index.js new file mode 100644 index 00000000..57d8743f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/package.json new file mode 100644 index 00000000..86ad2943 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/package.json @@ -0,0 +1,63 @@ +{ + "_from": "are-we-there-yet@~1.1.2", + "_id": "are-we-there-yet@1.1.5", + "_inBundle": false, + "_integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "_location": "/node-red-contrib-johnny-five/are-we-there-yet", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "are-we-there-yet@~1.1.2", + "name": "are-we-there-yet", + "escapedName": "are-we-there-yet", + "rawSpec": "~1.1.2", + "saveSpec": null, + "fetchSpec": "~1.1.2" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/npmlog" + ], + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "_shasum": "4b35c2944f062a8bfcda66410760350fe9ddfc21", + "_spec": "are-we-there-yet@~1.1.2", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "bundleDependencies": false, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, + "deprecated": false, + "description": "Keep track of the overall completion of many disparate processes", + "devDependencies": { + "standard": "^11.0.1", + "tap": "^12.0.1" + }, + "files": [ + "index.js", + "tracker-base.js", + "tracker-group.js", + "tracker-stream.js", + "tracker.js", + "CHANGES.md" + ], + "homepage": "https://github.com/iarna/are-we-there-yet", + "license": "ISC", + "main": "index.js", + "name": "are-we-there-yet", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.5" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-base.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-base.js new file mode 100644 index 00000000..6f436875 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-group.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-group.js new file mode 100644 index 00000000..9759e122 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-stream.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-stream.js new file mode 100644 index 00000000..e1cf8505 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,36 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') + .method('finish') diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker.js new file mode 100644 index 00000000..68c2339b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/.travis.yml new file mode 100644 index 00000000..6cf4a7ad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "6" + - "node" +script: npm run travis +cache: + yarn: true diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/LICENSE new file mode 100644 index 00000000..9c91fb26 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/LICENSE @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2017 Samuel Reed + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/coverage.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/coverage.json new file mode 100644 index 00000000..5b4a3584 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/coverage.json @@ -0,0 +1 @@ +{"/Users/samuelreed/git/forks/async-throttle/index.js":{"path":"/Users/samuelreed/git/forks/async-throttle/index.js","s":{"1":1,"2":7,"3":1,"4":6,"5":6,"6":6,"7":6,"8":6,"9":6,"10":1,"11":1,"12":3,"13":13,"14":13,"15":13,"16":1,"17":19,"18":1,"19":45,"20":6,"21":39,"22":13,"23":13,"24":13,"25":13,"26":39,"27":18,"28":6,"29":6,"30":1,"31":6,"32":6,"33":6,"34":1,"35":13,"36":13,"37":1},"b":{"1":[1,6],"2":[6,5],"3":[6,5],"4":[6,39],"5":[13,26],"6":[18,21],"7":[6,0]},"f":{"1":7,"2":3,"3":13,"4":19,"5":45,"6":6,"7":13},"fnMap":{"1":{"name":"Queue","line":3,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":24}}},"2":{"name":"(anonymous_2)","line":22,"loc":{"start":{"line":22,"column":24},"end":{"line":22,"column":41}}},"3":{"name":"(anonymous_3)","line":23,"loc":{"start":{"line":23,"column":28},"end":{"line":23,"column":39}}},"4":{"name":"(anonymous_4)","line":31,"loc":{"start":{"line":31,"column":7},"end":{"line":31,"column":18}}},"5":{"name":"(anonymous_5)","line":36,"loc":{"start":{"line":36,"column":23},"end":{"line":36,"column":34}}},"6":{"name":"(anonymous_6)","line":55,"loc":{"start":{"line":55,"column":25},"end":{"line":55,"column":38}}},"7":{"name":"done","line":62,"loc":{"start":{"line":62,"column":0},"end":{"line":62,"column":16}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":14,"column":1}},"2":{"start":{"line":4,"column":2},"end":{"line":6,"column":3}},"3":{"start":{"line":5,"column":4},"end":{"line":5,"column":30}},"4":{"start":{"line":8,"column":2},"end":{"line":8,"column":26}},"5":{"start":{"line":9,"column":2},"end":{"line":9,"column":53}},"6":{"start":{"line":10,"column":2},"end":{"line":10,"column":19}},"7":{"start":{"line":11,"column":2},"end":{"line":11,"column":17}},"8":{"start":{"line":12,"column":2},"end":{"line":12,"column":16}},"9":{"start":{"line":13,"column":2},"end":{"line":13,"column":31}},"10":{"start":{"line":16,"column":0},"end":{"line":20,"column":2}},"11":{"start":{"line":22,"column":0},"end":{"line":28,"column":3}},"12":{"start":{"line":23,"column":2},"end":{"line":27,"column":4}},"13":{"start":{"line":24,"column":4},"end":{"line":24,"column":75}},"14":{"start":{"line":25,"column":4},"end":{"line":25,"column":16}},"15":{"start":{"line":26,"column":4},"end":{"line":26,"column":24}},"16":{"start":{"line":30,"column":0},"end":{"line":34,"column":3}},"17":{"start":{"line":32,"column":4},"end":{"line":32,"column":43}},"18":{"start":{"line":36,"column":0},"end":{"line":53,"column":2}},"19":{"start":{"line":37,"column":2},"end":{"line":39,"column":3}},"20":{"start":{"line":38,"column":4},"end":{"line":38,"column":11}},"21":{"start":{"line":40,"column":2},"end":{"line":45,"column":3}},"22":{"start":{"line":41,"column":4},"end":{"line":41,"column":32}},"23":{"start":{"line":42,"column":4},"end":{"line":42,"column":19}},"24":{"start":{"line":43,"column":4},"end":{"line":43,"column":20}},"25":{"start":{"line":44,"column":4},"end":{"line":44,"column":16}},"26":{"start":{"line":47,"column":2},"end":{"line":52,"column":3}},"27":{"start":{"line":48,"column":4},"end":{"line":51,"column":5}},"28":{"start":{"line":49,"column":6},"end":{"line":49,"column":30}},"29":{"start":{"line":50,"column":6},"end":{"line":50,"column":27}},"30":{"start":{"line":55,"column":0},"end":{"line":60,"column":2}},"31":{"start":{"line":56,"column":2},"end":{"line":59,"column":3}},"32":{"start":{"line":57,"column":4},"end":{"line":57,"column":22}},"33":{"start":{"line":58,"column":4},"end":{"line":58,"column":16}},"34":{"start":{"line":62,"column":0},"end":{"line":65,"column":1}},"35":{"start":{"line":63,"column":2},"end":{"line":63,"column":17}},"36":{"start":{"line":64,"column":2},"end":{"line":64,"column":14}},"37":{"start":{"line":67,"column":0},"end":{"line":67,"column":23}}},"branchMap":{"1":{"line":4,"type":"if","locations":[{"start":{"line":4,"column":2},"end":{"line":4,"column":2}},{"start":{"line":4,"column":2},"end":{"line":4,"column":2}}]},"2":{"line":8,"type":"binary-expr","locations":[{"start":{"line":8,"column":12},"end":{"line":8,"column":19}},{"start":{"line":8,"column":23},"end":{"line":8,"column":25}}]},"3":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":21},"end":{"line":9,"column":40}},{"start":{"line":9,"column":44},"end":{"line":9,"column":52}}]},"4":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":2},"end":{"line":37,"column":2}},{"start":{"line":37,"column":2},"end":{"line":37,"column":2}}]},"5":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":2},"end":{"line":40,"column":2}},{"start":{"line":40,"column":2},"end":{"line":40,"column":2}}]},"6":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":2},"end":{"line":47,"column":2}},{"start":{"line":47,"column":2},"end":{"line":47,"column":2}}]},"7":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":2},"end":{"line":56,"column":2}},{"start":{"line":56,"column":2},"end":{"line":56,"column":2}}]}}}} \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.html b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.html new file mode 100644 index 00000000..198882b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.html @@ -0,0 +1,73 @@ + + + + Code coverage report for async-throttle/ + + + + + + +
+

Code coverage report for async-throttle/

+

+ Statements: 100% (37 / 37)      + Branches: 92.86% (13 / 14)      + Functions: 100% (7 / 7)      + Lines: 100% (37 / 37)      + Ignored: none      +

+
All files » async-throttle/
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.js100%(37 / 37)92.86%(13 / 14)100%(7 / 7)100%(37 / 37)
+
+
+ + + + + + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.js.html b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.js.html new file mode 100644 index 00000000..adc030fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.js.html @@ -0,0 +1,246 @@ + + + + Code coverage report for async-throttle/index.js + + + + + + +
+

Code coverage report for async-throttle/index.js

+

+ Statements: 100% (37 / 37)      + Branches: 92.86% (13 / 14)      + Functions: 100% (7 / 7)      + Lines: 100% (37 / 37)      + Ignored: none      +

+
All files » async-throttle/ » index.js
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68  +  +1 +7 +1 +  +  +6 +6 +6 +6 +6 +6 +  +  +1 +  +  +  +  +  +1 +3 +13 +13 +13 +  +  +  +1 +  +19 +  +  +  +1 +45 +6 +  +39 +13 +13 +13 +13 +  +  +39 +18 +6 +6 +  +  +  +  +1 +6 +6 +6 +  +  +  +1 +13 +13 +  +  +1 + 
'use strict';
+ 
+function Queue(options) {
+  if (!(this instanceof Queue)) {
+    return new Queue(options);
+  }
+ 
+  options = options || {};
+  this.concurrency = options.concurrency || Infinity;
+  this.pending = 0;
+  this.jobs = [];
+  this.cbs = [];
+  this._done = done.bind(this);
+}
+ 
+var arrayAddMethods = [
+  'push',
+  'unshift',
+  'splice'
+];
+ 
+arrayAddMethods.forEach(function(method) {
+  Queue.prototype[method] = function() {
+    var methodResult = Array.prototype[method].apply(this.jobs, arguments);
+    this._run();
+    return methodResult;
+  };
+});
+ 
+Object.defineProperty(Queue.prototype, 'length', {
+  get: function() {
+    return this.pending + this.jobs.length;
+  }
+});
+ 
+Queue.prototype._run = function() {
+  if (this.pending === this.concurrency) {
+    return;
+  }
+  if (this.jobs.length) {
+    var job = this.jobs.shift();
+    this.pending++;
+    job(this._done);
+    this._run();
+  }
+ 
+  if (this.pending === 0) {
+    while (this.cbs.length !== 0) {
+      var cb = this.cbs.pop();
+      process.nextTick(cb);
+    }
+  }
+};
+ 
+Queue.prototype.onDone = function(cb) {
+  Eif (typeof cb === 'function') {
+    this.cbs.push(cb);
+    this._run();
+  }
+};
+ 
+function done() {
+  this.pending--;
+  this._run();
+}
+ 
+module.exports = Queue;
+ 
+ +
+ + + + + + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/base.css b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/base.css new file mode 100644 index 00000000..a6a2f328 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/base.css @@ -0,0 +1,182 @@ +body, html { + margin:0; padding: 0; +} +body { + font-family: Helvetica Neue, Helvetica,Arial; + font-size: 10pt; +} +div.header, div.footer { + background: #eee; + padding: 1em; +} +div.header { + z-index: 100; + position: fixed; + top: 0; + border-bottom: 1px solid #666; + width: 100%; +} +div.footer { + border-top: 1px solid #666; +} +div.body { + margin-top: 10em; +} +div.meta { + font-size: 90%; + text-align: center; +} +h1, h2, h3 { + font-weight: normal; +} +h1 { + font-size: 12pt; +} +h2 { + font-size: 10pt; +} +pre { + font-family: Consolas, Menlo, Monaco, monospace; + margin: 0; + padding: 0; + line-height: 1.3; + font-size: 14px; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} + +div.path { font-size: 110%; } +div.path a:link, div.path a:visited { color: #000; } +table.coverage { border-collapse: collapse; margin:0; padding: 0 } + +table.coverage td { + margin: 0; + padding: 0; + color: #111; + vertical-align: top; +} +table.coverage td.line-count { + width: 50px; + text-align: right; + padding-right: 5px; +} +table.coverage td.line-coverage { + color: #777 !important; + text-align: right; + border-left: 1px solid #666; + border-right: 1px solid #666; +} + +table.coverage td.text { +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 40px; +} +table.coverage td span.cline-neutral { + background: #eee; +} +table.coverage td span.cline-yes { + background: #b5d592; + color: #999; +} +table.coverage td span.cline-no { + background: #fc8c84; +} + +.cstat-yes { color: #111; } +.cstat-no { background: #fc8c84; color: #111; } +.fstat-no { background: #ffc520; color: #111 !important; } +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +.missing-if-branch { + display: inline-block; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: black; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} + +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} + +.entity, .metric { font-weight: bold; } +.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } +.metric small { font-size: 80%; font-weight: normal; color: #666; } + +div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } +div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } +div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } +div.coverage-summary th.file { border-right: none !important; } +div.coverage-summary th.pic { border-left: none !important; text-align: right; } +div.coverage-summary th.pct { border-right: none !important; } +div.coverage-summary th.abs { border-left: none !important; text-align: right; } +div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } +div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } +div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; } +div.coverage-summary td.pic { min-width: 120px !important; } +div.coverage-summary a:link { text-decoration: none; color: #000; } +div.coverage-summary a:visited { text-decoration: none; color: #777; } +div.coverage-summary a:hover { text-decoration: underline; } +div.coverage-summary tfoot td { border-top: 1px solid #666; } + +div.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +div.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +div.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} + +.high { background: #b5d592 !important; } +.medium { background: #ffe87c !important; } +.low { background: #fc8c84 !important; } + +span.cover-fill, span.cover-empty { + display:inline-block; + border:1px solid #444; + background: white; + height: 12px; +} +span.cover-fill { + background: #ccc; + border-right: 1px solid #444; +} +span.cover-empty { + background: white; + border-left: none; +} +span.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/index.html b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/index.html new file mode 100644 index 00000000..782a1cff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/index.html @@ -0,0 +1,73 @@ + + + + Code coverage report for All files + + + + + + +
+

Code coverage report for All files

+

+ Statements: 100% (37 / 37)      + Branches: 92.86% (13 / 14)      + Functions: 100% (7 / 7)      + Lines: 100% (37 / 37)      + Ignored: none      +

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
async-throttle/100%(37 / 37)92.86%(13 / 14)100%(7 / 7)100%(37 / 37)
+
+
+ + + + + + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/prettify.css b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/prettify.css new file mode 100644 index 00000000..b317a7cd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/prettify.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/prettify.js new file mode 100644 index 00000000..ef51e038 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 00000000..03f704a6 Binary files /dev/null and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/sorter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/sorter.js new file mode 100644 index 00000000..6afb736c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov-report/sorter.js @@ -0,0 +1,156 @@ +var addSorting = (function () { + "use strict"; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { return document.querySelector('.coverage-summary table'); } + // returns the thead element of the summary table + function getTableHeader() { return getTable().querySelector('thead tr'); } + // returns the tbody element of the summary table + function getTableBody() { return getTable().querySelector('tbody'); } + // returns the th element for nth column + function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + el = getNthColumn(i).querySelector('.sorter'); + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov.info b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov.info new file mode 100644 index 00000000..fbf36aab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/coverage/lcov.info @@ -0,0 +1,74 @@ +TN: +SF:/Users/samuelreed/git/forks/async-throttle/index.js +FN:3,Queue +FN:22,(anonymous_2) +FN:23,(anonymous_3) +FN:31,(anonymous_4) +FN:36,(anonymous_5) +FN:55,(anonymous_6) +FN:62,done +FNF:7 +FNH:7 +FNDA:7,Queue +FNDA:3,(anonymous_2) +FNDA:13,(anonymous_3) +FNDA:19,(anonymous_4) +FNDA:45,(anonymous_5) +FNDA:6,(anonymous_6) +FNDA:13,done +DA:3,1 +DA:4,7 +DA:5,1 +DA:8,6 +DA:9,6 +DA:10,6 +DA:11,6 +DA:12,6 +DA:13,6 +DA:16,1 +DA:22,1 +DA:23,3 +DA:24,13 +DA:25,13 +DA:26,13 +DA:30,1 +DA:32,19 +DA:36,1 +DA:37,45 +DA:38,6 +DA:40,39 +DA:41,13 +DA:42,13 +DA:43,13 +DA:44,13 +DA:47,39 +DA:48,18 +DA:49,6 +DA:50,6 +DA:55,1 +DA:56,6 +DA:57,6 +DA:58,6 +DA:62,1 +DA:63,13 +DA:64,13 +DA:67,1 +LF:37 +LH:37 +BRDA:4,1,0,1 +BRDA:4,1,1,6 +BRDA:8,2,0,6 +BRDA:8,2,1,5 +BRDA:9,3,0,6 +BRDA:9,3,1,5 +BRDA:37,4,0,6 +BRDA:37,4,1,39 +BRDA:40,5,0,13 +BRDA:40,5,1,26 +BRDA:47,6,0,18 +BRDA:47,6,1,21 +BRDA:56,7,0,6 +BRDA:56,7,1,0 +BRF:14 +BRH:13 +end_of_record diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/index.js new file mode 100644 index 00000000..c9bd2f97 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/index.js @@ -0,0 +1,67 @@ +'use strict'; + +function Queue(options) { + if (!(this instanceof Queue)) { + return new Queue(options); + } + + options = options || {}; + this.concurrency = options.concurrency || Infinity; + this.pending = 0; + this.jobs = []; + this.cbs = []; + this._done = done.bind(this); +} + +var arrayAddMethods = [ + 'push', + 'unshift', + 'splice' +]; + +arrayAddMethods.forEach(function(method) { + Queue.prototype[method] = function() { + var methodResult = Array.prototype[method].apply(this.jobs, arguments); + this._run(); + return methodResult; + }; +}); + +Object.defineProperty(Queue.prototype, 'length', { + get: function() { + return this.pending + this.jobs.length; + } +}); + +Queue.prototype._run = function() { + if (this.pending === this.concurrency) { + return; + } + if (this.jobs.length) { + var job = this.jobs.shift(); + this.pending++; + job(this._done); + this._run(); + } + + if (this.pending === 0) { + while (this.cbs.length !== 0) { + var cb = this.cbs.pop(); + process.nextTick(cb); + } + } +}; + +Queue.prototype.onDone = function(cb) { + if (typeof cb === 'function') { + this.cbs.push(cb); + this._run(); + } +}; + +function done() { + this.pending--; + this._run(); +} + +module.exports = Queue; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/package.json new file mode 100644 index 00000000..26db136f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/package.json @@ -0,0 +1,69 @@ +{ + "_from": "async-limiter@~1.0.0", + "_id": "async-limiter@1.0.0", + "_inBundle": false, + "_integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "_location": "/node-red-contrib-johnny-five/async-limiter", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "async-limiter@~1.0.0", + "name": "async-limiter", + "escapedName": "async-limiter", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/ws" + ], + "_resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "_shasum": "78faed8c3d074ab81f22b4e985d79e8738f720f8", + "_spec": "async-limiter@~1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/ws", + "author": { + "name": "Samuel Reed" + }, + "bugs": { + "url": "https://github.com/strml/async-limiter/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "asynchronous function queue with adjustable concurrency", + "devDependencies": { + "coveralls": "^2.11.2", + "eslint": "^4.6.1", + "eslint-plugin-mocha": "^4.11.0", + "intelli-espower-loader": "^1.0.1", + "istanbul": "^0.3.2", + "mocha": "^3.5.2", + "power-assert": "^1.4.4" + }, + "homepage": "https://github.com/strml/async-limiter#readme", + "keywords": [ + "throttle", + "async", + "limiter", + "asynchronous", + "job", + "task", + "concurrency", + "concurrent" + ], + "license": "MIT", + "name": "async-limiter", + "repository": { + "type": "git", + "url": "git+https://github.com/strml/async-limiter.git" + }, + "scripts": { + "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls", + "example": "node example", + "lint": "eslint .", + "test": "mocha --R intelli-espower-loader test/", + "travis": "npm run lint && npm run coverage" + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/readme.md new file mode 100644 index 00000000..dcf4932f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/async-limiter/readme.md @@ -0,0 +1,132 @@ +# Async-Limiter + +A module for limiting concurrent asynchronous actions in flight. Forked from [queue](https://github.com/jessetane/queue). + +[![npm](http://img.shields.io/npm/v/async-limiter.svg?style=flat-square)](http://www.npmjs.org/async-limiter) +[![tests](https://img.shields.io/travis/STRML/async-limiter.svg?style=flat-square&branch=master)](https://travis-ci.org/STRML/async-limiter) +[![coverage](https://img.shields.io/coveralls/STRML/async-limiter.svg?style=flat-square&branch=master)](https://coveralls.io/r/STRML/async-limiter) + +This module exports a class `Limiter` that implements some of the `Array` API. +Pass async functions (ones that accept a callback or return a promise) to an instance's additive array methods. + +## Motivation + +Certain functions, like `zlib`, have [undesirable behavior](https://github.com/nodejs/node/issues/8871#issuecomment-250915913) when +run at infinite concurrency. + +In this case, it is actually faster, and takes far less memory, to limit concurrency. + +This module should do the absolute minimum work necessary to queue up functions. PRs are welcome that would +make this module faster or lighter, but new functionality is not desired. + +Style should confirm to nodejs/node style. + +## Example + +``` javascript +var Limiter = require('async-limiter') + +var t = new Limiter({concurrency: 2}); +var results = [] + +// add jobs using the familiar Array API +t.push(function (cb) { + results.push('two') + cb() +}) + +t.push( + function (cb) { + results.push('four') + cb() + }, + function (cb) { + results.push('five') + cb() + } +) + +t.unshift(function (cb) { + results.push('one') + cb() +}) + +t.splice(2, 0, function (cb) { + results.push('three') + cb() +}) + +// Jobs run automatically. If you want a callback when all are done, +// call 'onDone()'. +t.onDone(function () { + console.log('all done:', results) +}) +``` + +## Zlib Example + +```js +const zlib = require('zlib'); +const Limiter = require('async-limiter'); + +const message = {some: "data"}; +const payload = new Buffer(JSON.stringify(message)); + +// Try with different concurrency values to see how this actually +// slows significantly with higher concurrency! +// +// 5: 1398.607ms +// 10: 1375.668ms +// Infinity: 4423.300ms +// +const t = new Limiter({concurrency: 5}); +function deflate(payload, cb) { + t.push(function(done) { + zlib.deflate(payload, function(err, buffer) { + done(); + cb(err, buffer); + }); + }); +} + +console.time('deflate'); +for(let i = 0; i < 30000; ++i) { + deflate(payload, function (err, buffer) {}); +} +q.onDone(function() { + console.timeEnd('deflate'); +}); +``` + +## Install + +`npm install async-limiter` + +## Test + +`npm test` + +## API + +### `var t = new Limiter([opts])` +Constructor. `opts` may contain inital values for: +* `q.concurrency` + +## Instance methods + +### `q.onDone(fn)` +`fn` will be called once and only once, when the queue is empty. + +## Instance methods mixed in from `Array` +Mozilla has docs on how these methods work [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array). +### `q.push(element1, ..., elementN)` +### `q.unshift(element1, ..., elementN)` +### `q.splice(index , howMany[, element1[, ...[, elementN]]])` + +## Properties +### `q.concurrency` +Max number of jobs the queue should process concurrently, defaults to `Infinity`. + +### `q.length` +Jobs pending + jobs to process (readonly). + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000..ae5d8c36 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/LICENSE.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000..2cdc8e41 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/README.md new file mode 100644 index 00000000..08e918c0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/index.js new file mode 100644 index 00000000..1685a762 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/balanced-match/package.json new file mode 100644 index 00000000..88044918 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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": "/node-red-contrib-johnny-five/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": [ + "/node-red-contrib-johnny-five/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", + "_spec": "balanced-match@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/LICENSE.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/LICENSE.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/LICENSE.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/LICENSE.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/bindings.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/bindings.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/bindings.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/bindings.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/package.json similarity index 80% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/package.json index 6054eaed..0a68c2e9 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bindings/package.json @@ -1,29 +1,27 @@ { - "_from": "bindings@^1.5.0", + "_from": "bindings@^1.3.0", "_id": "bindings@1.5.0", "_inBundle": false, "_integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "_location": "/raspi-io/bindings", + "_location": "/node-red-contrib-johnny-five/bindings", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "bindings@^1.5.0", + "raw": "bindings@^1.3.0", "name": "bindings", "escapedName": "bindings", - "rawSpec": "^1.5.0", + "rawSpec": "^1.3.0", "saveSpec": null, - "fetchSpec": "^1.5.0" + "fetchSpec": "^1.3.0" }, "_requiredBy": [ - "/raspi-io/@serialport/bindings", - "/raspi-io/i2c-bus", - "/raspi-io/pigpio" + "/node-red-contrib-johnny-five/@serialport/bindings" ], "_resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "_shasum": "10353c9e945334bc0511a6d90b38fbc7c9c504df", - "_spec": "bindings@^1.5.0", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/pigpio", + "_spec": "bindings@^1.3.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/.jshintrc b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/.jshintrc new file mode 100644 index 00000000..c8ef3ca4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/.jshintrc @@ -0,0 +1,59 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": false + , "passfail": false +} \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/.travis.yml new file mode 100644 index 00000000..373bb4a7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/.travis.yml @@ -0,0 +1,16 @@ +sudo: false +language: node_js +node_js: + - '0.10' + - '0.12' + - '4' + - '6' + - '8' + - '9' +branches: + only: + - master +notifications: + email: + - rod@vagg.org + - matteo.collina@gmail.com diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/LICENSE.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/LICENSE.md new file mode 100644 index 00000000..ff35a347 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/LICENSE.md @@ -0,0 +1,13 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2013-2016 bl contributors +---------------------------------- + +*bl contributors listed at * + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/README.md new file mode 100644 index 00000000..9eebd88b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/README.md @@ -0,0 +1,208 @@ +# bl *(BufferList)* + +[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl) + +**A Node.js Buffer list collector, reader and streamer thingy.** + +[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/) +[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/) + +**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them! + +The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently. + +```js +const BufferList = require('bl') + +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) +bl.append('hi') // bl will also accept & convert Strings +bl.append(new Buffer('j')) +bl.append(new Buffer([ 0x3, 0x4 ])) + +console.log(bl.length) // 12 + +console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij' +console.log(bl.slice(3, 10).toString('ascii')) // 'defghij' +console.log(bl.slice(3, 6).toString('ascii')) // 'def' +console.log(bl.slice(3, 8).toString('ascii')) // 'defgh' +console.log(bl.slice(5, 10).toString('ascii')) // 'fghij' + +// or just use toString! +console.log(bl.toString()) // 'abcdefghij\u0003\u0004' +console.log(bl.toString('ascii', 3, 8)) // 'defgh' +console.log(bl.toString('ascii', 5, 10)) // 'fghij' + +// other standard Buffer readables +console.log(bl.readUInt16BE(10)) // 0x0304 +console.log(bl.readUInt16LE(10)) // 0x0403 +``` + +Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**: + +```js +const bl = require('bl') + , fs = require('fs') + +fs.createReadStream('README.md') + .pipe(bl(function (err, data) { // note 'new' isn't strictly required + // `data` is a complete Buffer object containing the full data + console.log(data.toString()) + })) +``` + +Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream. + +Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!): +```js +const hyperquest = require('hyperquest') + , bl = require('bl') + , url = 'https://raw.github.com/rvagg/bl/master/README.md' + +hyperquest(url).pipe(bl(function (err, data) { + console.log(data.toString()) +})) +``` + +Or, use it as a readable stream to recompose a list of Buffers to an output source: + +```js +const BufferList = require('bl') + , fs = require('fs') + +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) +bl.append(new Buffer('hi')) +bl.append(new Buffer('j')) + +bl.pipe(fs.createWriteStream('gibberish.txt')) +``` + +## API + + * new BufferList([ callback ]) + * bl.length + * bl.append(buffer) + * bl.get(index) + * bl.slice([ start[, end ] ]) + * bl.shallowSlice([ start[, end ] ]) + * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) + * bl.duplicate() + * bl.consume(bytes) + * bl.toString([encoding, [ start, [ end ]]]) + * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + * Streams + +-------------------------------------------------------- + +### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ]) +The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. + +Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. + +`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: + +```js +var bl = require('bl') +var myinstance = bl() + +// equivalent to: + +var BufferList = require('bl') +var myinstance = new BufferList() +``` + +-------------------------------------------------------- + +### bl.length +Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list. + +-------------------------------------------------------- + +### bl.append(Buffer | Buffer array | BufferList | BufferList array | String) +`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained. + +-------------------------------------------------------- + +### bl.get(index) +`get()` will return the byte at the specified index. + +-------------------------------------------------------- + +### bl.slice([ start, [ end ] ]) +`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. + +If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer. + +-------------------------------------------------------- + +### bl.shallowSlice([ start, [ end ] ]) +`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. + +No copies will be performed. All buffers in the result share memory with the original list. + +-------------------------------------------------------- + +### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) +`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively. + +-------------------------------------------------------- + +### bl.duplicate() +`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: + +```js +var bl = new BufferList() + +bl.append('hello') +bl.append(' world') +bl.append('\n') + +bl.duplicate().pipe(process.stdout, { end: false }) + +console.log(bl.toString()) +``` + +-------------------------------------------------------- + +### bl.consume(bytes) +`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data. + +-------------------------------------------------------- + +### bl.toString([encoding, [ start, [ end ]]]) +`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information. + +-------------------------------------------------------- + +### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + +All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently. + +See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. + +-------------------------------------------------------- + +### Streams +**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance. + +-------------------------------------------------------- + +## Contributors + +**bl** is brought to you by the following hackers: + + * [Rod Vagg](https://github.com/rvagg) + * [Matteo Collina](https://github.com/mcollina) + * [Jarett Cruger](https://github.com/jcrugzz) + +======= + + +## License & copyright + +Copyright (c) 2013-2016 bl contributors (listed above). + +bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/bl.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/bl.js new file mode 100644 index 00000000..db536f34 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/bl.js @@ -0,0 +1,281 @@ +var DuplexStream = require('readable-stream/duplex') + , util = require('util') + , Buffer = require('safe-buffer').Buffer + + +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) + + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { + this._callback = callback + + var piper = function piper (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function onPipe (src) { + src.on('error', piper) + }) + this.on('unpipe', function onUnpipe (src) { + src.removeListener('error', piper) + }) + } else { + this.append(callback) + } + + DuplexStream.call(this) +} + + +util.inherits(BufferList, DuplexStream) + + +BufferList.prototype._offset = function _offset (offset) { + var tot = 0, i = 0, _t + if (offset === 0) return [ 0, 0 ] + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t || i == this._bufs.length - 1) + return [ i, offset - tot ] + tot = _t + } +} + + +BufferList.prototype.append = function append (buf) { + var i = 0 + + if (Buffer.isBuffer(buf)) { + this._appendBuffer(buf); + } else if (Array.isArray(buf)) { + for (; i < buf.length; i++) + this.append(buf[i]) + } else if (buf instanceof BufferList) { + // unwrap argument into individual BufferLists + for (; i < buf._bufs.length; i++) + this.append(buf._bufs[i]) + } else if (buf != null) { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() + + this._appendBuffer(Buffer.from(buf)); + } + + return this +} + + +BufferList.prototype._appendBuffer = function appendBuffer (buf) { + this._bufs.push(buf) + this.length += buf.length +} + + +BufferList.prototype._write = function _write (buf, encoding, callback) { + this._appendBuffer(buf) + + if (typeof callback == 'function') + callback() +} + + +BufferList.prototype._read = function _read (size) { + if (!this.length) + return this.push(null) + + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} + + +BufferList.prototype.end = function end (chunk) { + DuplexStream.prototype.end.call(this, chunk) + + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } +} + + +BufferList.prototype.get = function get (index) { + return this.slice(index, index + 1)[0] +} + + +BufferList.prototype.slice = function slice (start, end) { + if (typeof start == 'number' && start < 0) + start += this.length + if (typeof end == 'number' && end < 0) + end += this.length + return this.copy(null, 0, start, end) +} + + +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || Buffer.alloc(0) + if (srcEnd <= 0) + return dst || Buffer.alloc(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) { // slice, but full concat if multiple buffers + return this._bufs.length === 1 + ? this._bufs[0] + : Buffer.concat(this._bufs, this.length) + } + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = Buffer.allocUnsafe(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + break + } + + bufoff += l + bytes -= l + + if (start) + start = 0 + } + + return dst +} + +BufferList.prototype.shallowSlice = function shallowSlice (start, end) { + start = start || 0 + end = end || this.length + + if (start < 0) + start += this.length + if (end < 0) + end += this.length + + var startOffset = this._offset(start) + , endOffset = this._offset(end) + , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) + + if (endOffset[1] == 0) + buffers.pop() + else + buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) + + if (startOffset[1] != 0) + buffers[0] = buffers[0].slice(startOffset[1]) + + return new BufferList(buffers) +} + +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function consume (bytes) { + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + + +BufferList.prototype.duplicate = function duplicate () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + + +BufferList.prototype.destroy = function destroy () { + this._bufs.length = 0 + this.length = 0 + this.push(null) +} + + +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } + + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + + +module.exports = BufferList diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/package.json new file mode 100644 index 00000000..78addd7a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/package.json @@ -0,0 +1,64 @@ +{ + "_from": "bl@^1.0.0", + "_id": "bl@1.2.2", + "_inBundle": false, + "_integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "_location": "/node-red-contrib-johnny-five/bl", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bl@^1.0.0", + "name": "bl", + "escapedName": "bl", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/mqtt-packet", + "/node-red-contrib-johnny-five/tar-stream" + ], + "_resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "_shasum": "a160911717103c07410cef63ef51b397c025af9c", + "_spec": "bl@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/tar-stream", + "authors": [ + "Rod Vagg (https://github.com/rvagg)", + "Matteo Collina (https://github.com/mcollina)", + "Jarett Cruger (https://github.com/jcrugzz)" + ], + "bugs": { + "url": "https://github.com/rvagg/bl/issues" + }, + "bundleDependencies": false, + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + }, + "deprecated": false, + "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", + "devDependencies": { + "faucet": "0.0.1", + "hash_file": "~0.1.1", + "tape": "~4.9.0" + }, + "homepage": "https://github.com/rvagg/bl", + "keywords": [ + "buffer", + "buffers", + "stream", + "awesomesauce" + ], + "license": "MIT", + "main": "bl.js", + "name": "bl", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/bl.git" + }, + "scripts": { + "test": "node test/test.js | faucet" + }, + "version": "1.2.2" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/test/test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/test/test.js new file mode 100644 index 00000000..e1214877 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/bl/test/test.js @@ -0,0 +1,702 @@ +var tape = require('tape') + , crypto = require('crypto') + , fs = require('fs') + , hash = require('hash_file') + , BufferList = require('../') + , Buffer = require('safe-buffer').Buffer + + , encodings = + ('hex utf8 utf-8 ascii binary base64' + + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') + +tape('single bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(Buffer.from('abcd')) + + t.equal(bl.length, 4) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + + t.end() +}) + +tape('single bytes from multiple buffers', function (t) { + var bl = new BufferList() + bl.append(Buffer.from('abcd')) + bl.append(Buffer.from('efg')) + bl.append(Buffer.from('hi')) + bl.append(Buffer.from('j')) + + t.equal(bl.length, 10) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + t.equal(bl.get(4), 101) + t.equal(bl.get(5), 102) + t.equal(bl.get(6), 103) + t.equal(bl.get(7), 104) + t.equal(bl.get(8), 105) + t.equal(bl.get(9), 106) + t.end() +}) + +tape('multi bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(Buffer.from('abcd')) + + t.equal(bl.length, 4) + + t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') + t.equal(bl.slice(0, 3).toString('ascii'), 'abc') + t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') + t.equal(bl.slice(-4, -1).toString('ascii'), 'abc') + + t.end() +}) + +tape('multi bytes from single buffer (negative indexes)', function (t) { + var bl = new BufferList() + bl.append(Buffer.from('buffer')) + + t.equal(bl.length, 6) + + t.equal(bl.slice(-6, -1).toString('ascii'), 'buffe') + t.equal(bl.slice(-6, -2).toString('ascii'), 'buff') + t.equal(bl.slice(-5, -2).toString('ascii'), 'uff') + + t.end() +}) + +tape('multiple bytes from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(Buffer.from('abcd')) + bl.append(Buffer.from('efg')) + bl.append(Buffer.from('hi')) + bl.append(Buffer.from('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + t.equal(bl.slice(-7, -4).toString('ascii'), 'def') + + t.end() +}) + +tape('multiple bytes from multiple buffer lists', function (t) { + var bl = new BufferList() + + bl.append(new BufferList([ Buffer.from('abcd'), Buffer.from('efg') ])) + bl.append(new BufferList([ Buffer.from('hi'), Buffer.from('j') ])) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +// same data as previous test, just using nested constructors +tape('multiple bytes from crazy nested buffer lists', function (t) { + var bl = new BufferList() + + bl.append(new BufferList([ + new BufferList([ + new BufferList(Buffer.from('abc')) + , Buffer.from('d') + , new BufferList(Buffer.from('efg')) + ]) + , new BufferList([ Buffer.from('hi') ]) + , new BufferList(Buffer.from('j')) + ])) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +tape('append accepts arrays of Buffers', function (t) { + var bl = new BufferList() + bl.append(Buffer.from('abc')) + bl.append([ Buffer.from('def') ]) + bl.append([ Buffer.from('ghi'), Buffer.from('jkl') ]) + bl.append([ Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz') ]) + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('append accepts arrays of BufferLists', function (t) { + var bl = new BufferList() + bl.append(Buffer.from('abc')) + bl.append([ new BufferList('def') ]) + bl.append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ])) + bl.append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ]) + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('append chainable', function (t) { + var bl = new BufferList() + t.ok(bl.append(Buffer.from('abcd')) === bl) + t.ok(bl.append([ Buffer.from('abcd') ]) === bl) + t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl) + t.ok(bl.append([ new BufferList(Buffer.from('abcd')) ]) === bl) + t.end() +}) + +tape('append chainable (test results)', function (t) { + var bl = new BufferList('abc') + .append([ new BufferList('def') ]) + .append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ])) + .append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ]) + + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('consuming from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(Buffer.from('abcd')) + bl.append(Buffer.from('efg')) + bl.append(Buffer.from('hi')) + bl.append(Buffer.from('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + bl.consume(3) + t.equal(bl.length, 7) + t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') + + bl.consume(2) + t.equal(bl.length, 5) + t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') + + bl.consume(1) + t.equal(bl.length, 4) + t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') + + bl.consume(1) + t.equal(bl.length, 3) + t.equal(bl.slice(0, 3).toString('ascii'), 'hij') + + bl.consume(2) + t.equal(bl.length, 1) + t.equal(bl.slice(0, 1).toString('ascii'), 'j') + + t.end() +}) + +tape('complete consumption', function (t) { + var bl = new BufferList() + + bl.append(Buffer.from('a')) + bl.append(Buffer.from('b')) + + bl.consume(2) + + t.equal(bl.length, 0) + t.equal(bl._bufs.length, 0) + + t.end() +}) + +tape('test readUInt8 / readInt8', function (t) { + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt8(2), 0x3) + t.equal(bl.readInt8(2), 0x3) + t.equal(bl.readUInt8(3), 0x4) + t.equal(bl.readInt8(3), 0x4) + t.equal(bl.readUInt8(4), 0x23) + t.equal(bl.readInt8(4), 0x23) + t.equal(bl.readUInt8(5), 0x42) + t.equal(bl.readInt8(5), 0x42) + t.end() +}) + +tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt16BE(2), 0x0304) + t.equal(bl.readUInt16LE(2), 0x0403) + t.equal(bl.readInt16BE(2), 0x0304) + t.equal(bl.readInt16LE(2), 0x0403) + t.equal(bl.readUInt16BE(3), 0x0423) + t.equal(bl.readUInt16LE(3), 0x2304) + t.equal(bl.readInt16BE(3), 0x0423) + t.equal(bl.readInt16LE(3), 0x2304) + t.equal(bl.readUInt16BE(4), 0x2342) + t.equal(bl.readUInt16LE(4), 0x4223) + t.equal(bl.readInt16BE(4), 0x2342) + t.equal(bl.readInt16LE(4), 0x4223) + t.end() +}) + +tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt32BE(2), 0x03042342) + t.equal(bl.readUInt32LE(2), 0x42230403) + t.equal(bl.readInt32BE(2), 0x03042342) + t.equal(bl.readInt32LE(2), 0x42230403) + t.end() +}) + +tape('test readFloatLE / readFloatBE', function (t) { + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(3) + , bl = new BufferList() + + buf2[1] = 0x00 + buf2[2] = 0x00 + buf3[0] = 0x80 + buf3[1] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readFloatLE(2), 0x01) + t.end() +}) + +tape('test readDoubleLE / readDoubleBE', function (t) { + var buf1 = Buffer.alloc(1) + , buf2 = Buffer.alloc(3) + , buf3 = Buffer.alloc(10) + , bl = new BufferList() + + buf2[1] = 0x55 + buf2[2] = 0x55 + buf3[0] = 0x55 + buf3[1] = 0x55 + buf3[2] = 0x55 + buf3[3] = 0x55 + buf3[4] = 0xd5 + buf3[5] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readDoubleLE(2), 0.3333333333333333) + t.end() +}) + +tape('test toString', function (t) { + var bl = new BufferList() + + bl.append(Buffer.from('abcd')) + bl.append(Buffer.from('efg')) + bl.append(Buffer.from('hi')) + bl.append(Buffer.from('j')) + + t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') + t.equal(bl.toString('ascii', 3, 10), 'defghij') + t.equal(bl.toString('ascii', 3, 6), 'def') + t.equal(bl.toString('ascii', 3, 8), 'defgh') + t.equal(bl.toString('ascii', 5, 10), 'fghij') + + t.end() +}) + +tape('test toString encoding', function (t) { + var bl = new BufferList() + , b = Buffer.from('abcdefghij\xff\x00') + + bl.append(Buffer.from('abcd')) + bl.append(Buffer.from('efg')) + bl.append(Buffer.from('hi')) + bl.append(Buffer.from('j')) + bl.append(Buffer.from('\xff\x00')) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc), enc) + }) + + t.end() +}) + +!process.browser && tape('test stream', function (t) { + var random = crypto.randomBytes(65534) + , rndhash = hash(random, 'md5') + , md5sum = crypto.createHash('md5') + , bl = new BufferList(function (err, buf) { + t.ok(Buffer.isBuffer(buf)) + t.ok(err === null) + t.equal(rndhash, hash(bl.slice(), 'md5')) + t.equal(rndhash, hash(buf, 'md5')) + + bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) + .on('close', function () { + var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') + s.on('data', md5sum.update.bind(md5sum)) + s.on('end', function() { + t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') + t.end() + }) + }) + + }) + + fs.writeFileSync('/tmp/bl_test_rnd.dat', random) + fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) +}) + +tape('instantiation with Buffer', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = crypto.randomBytes(1024) + , b = BufferList(buf) + + t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') + b = BufferList([ buf, buf2 ]) + t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') + t.end() +}) + +tape('test String appendage', function (t) { + var bl = new BufferList() + , b = Buffer.from('abcdefghij\xff\x00') + + bl.append('abcd') + bl.append('efg') + bl.append('hi') + bl.append('j') + bl.append('\xff\x00') + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + +tape('test Number appendage', function (t) { + var bl = new BufferList() + , b = Buffer.from('1234567890') + + bl.append(1234) + bl.append(567) + bl.append(89) + bl.append(0) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + +tape('write nothing, should get empty buffer', function (t) { + t.plan(3) + BufferList(function (err, data) { + t.notOk(err, 'no error') + t.ok(Buffer.isBuffer(data), 'got a buffer') + t.equal(0, data.length, 'got a zero-length buffer') + t.end() + }).end() +}) + +tape('unicode string', function (t) { + t.plan(2) + var inp1 = '\u2600' + , inp2 = '\u2603' + , exp = inp1 + ' and ' + inp2 + , bl = BufferList() + bl.write(inp1) + bl.write(' and ') + bl.write(inp2) + t.equal(exp, bl.toString()) + t.equal(Buffer.from(exp).toString('hex'), bl.toString('hex')) +}) + +tape('should emit finish', function (t) { + var source = BufferList() + , dest = BufferList() + + source.write('hello') + source.pipe(dest) + + dest.on('finish', function () { + t.equal(dest.toString('utf8'), 'hello') + t.end() + }) +}) + +tape('basic copy', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = Buffer.alloc(1024) + , b = BufferList(buf) + + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy after many appends', function (t) { + var buf = crypto.randomBytes(512) + , buf2 = Buffer.alloc(1024) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy at a precise position', function (t) { + var buf = crypto.randomBytes(1004) + , buf2 = Buffer.alloc(1024) + , b = BufferList(buf) + + b.copy(buf2, 20) + t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') + t.end() +}) + +tape('copy starting from a precise location', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = Buffer.alloc(5) + , b = BufferList(buf) + + b.copy(buf2, 0, 5) + t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy in an interval', function (t) { + var rnd = crypto.randomBytes(10) + , b = BufferList(rnd) // put the random bytes there + , actual = Buffer.alloc(3) + , expected = Buffer.alloc(3) + + rnd.copy(expected, 0, 5, 8) + b.copy(actual, 0, 5, 8) + + t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy an interval between two buffers', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = Buffer.alloc(10) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2, 0, 5, 15) + + t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('shallow slice across buffer boundaries', function (t) { + var bl = new BufferList(['First', 'Second', 'Third']) + + t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh') + t.end() +}) + +tape('shallow slice within single buffer', function (t) { + t.plan(2) + var bl = new BufferList(['First', 'Second', 'Third']) + + t.equal(bl.shallowSlice(5, 10).toString(), 'Secon') + t.equal(bl.shallowSlice(7, 10).toString(), 'con') + t.end() +}) + +tape('shallow slice single buffer', function (t) { + t.plan(3) + var bl = new BufferList(['First', 'Second', 'Third']) + + t.equal(bl.shallowSlice(0, 5).toString(), 'First') + t.equal(bl.shallowSlice(5, 11).toString(), 'Second') + t.equal(bl.shallowSlice(11, 16).toString(), 'Third') +}) + +tape('shallow slice with negative or omitted indices', function (t) { + t.plan(4) + var bl = new BufferList(['First', 'Second', 'Third']) + + t.equal(bl.shallowSlice().toString(), 'FirstSecondThird') + t.equal(bl.shallowSlice(5).toString(), 'SecondThird') + t.equal(bl.shallowSlice(5, -3).toString(), 'SecondTh') + t.equal(bl.shallowSlice(-8).toString(), 'ondThird') +}) + +tape('shallow slice does not make a copy', function (t) { + t.plan(1) + var buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')] + var bl = (new BufferList(buffers)).shallowSlice(5, -3) + + buffers[1].fill('h') + buffers[2].fill('h') + + t.equal(bl.toString(), 'hhhhhhhh') +}) + +tape('duplicate', function (t) { + t.plan(2) + + var bl = new BufferList('abcdefghij\xff\x00') + , dup = bl.duplicate() + + t.equal(bl.prototype, dup.prototype) + t.equal(bl.toString('hex'), dup.toString('hex')) +}) + +tape('destroy no pipe', function (t) { + t.plan(2) + + var bl = new BufferList('alsdkfja;lsdkfja;lsdk') + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) +}) + +!process.browser && tape('destroy with pipe before read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .pipe(bl) + + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + +}) + +!process.browser && tape('destroy with pipe before read end with race', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .pipe(bl) + + setTimeout(function () { + bl.destroy() + setTimeout(function () { + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + }, 500) + }, 500) +}) + +!process.browser && tape('destroy with pipe after read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + } +}) + +!process.browser && tape('destroy with pipe while writing to a destination', function (t) { + t.plan(4) + + var bl = new BufferList() + , ds = new BufferList() + + fs.createReadStream(__dirname + '/test.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.pipe(ds) + + setTimeout(function () { + bl.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + ds.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + }, 100) + } +}) + +!process.browser && tape('handle error', function (t) { + t.plan(2) + fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { + t.ok(err instanceof Error, 'has error') + t.notOk(data, 'no data') + })) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/LICENSE new file mode 100644 index 00000000..de322667 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/README.md new file mode 100644 index 00000000..6b4e0e16 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/index.js new file mode 100644 index 00000000..0478be81 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/brace-expansion/package.json new file mode 100644 index 00000000..6f1d3028 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/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": "/node-red-contrib-johnny-five/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": [ + "/node-red-contrib-johnny-five/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", + "_spec": "brace-expansion@^1.1.7", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/.jshintrc b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/.jshintrc new file mode 100644 index 00000000..468cce0d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/.jshintrc @@ -0,0 +1,11 @@ +{ + "node": true, + "browser": true, + "debug": true, + "mocha": true, + "undef": true, + "unused": true, + "predef": [ + "chrome" + ] +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/.npmignore new file mode 100644 index 00000000..0de689ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/.npmignore @@ -0,0 +1,4 @@ +demo +demoPacked +gulpfile.js +Makefile diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/LICENSE.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/LICENSE.md new file mode 100644 index 00000000..e9c48401 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Glen Arrowsmith + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/README.md new file mode 100644 index 00000000..43580605 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/README.md @@ -0,0 +1,147 @@ +# browser-serialport + +Robots in the browser. Just like [node-serialport](https://npmjs.org/package/serialport) but for browser apps. + + +## Why not Node.js? + +[Nodebots](http://nodebots.io/) are awesome but HTML5 apps have access to a lot of APIs that make sense for robotics like the [GamepadAPI](http://www.html5rocks.com/en/tutorials/doodles/gamepad/), [WebRTC Video and Data](http://www.webrtc.org/), [Web Speech API](http://www.google.com/intl/en/chrome/demos/speech.html), etc. Also you get a nice GUI and its easier to run. I have also made a fork of [Johnny-Five](https://github.com/garrows/johnny-five) to work with [Browserify](http://browserify.org/) as well by modifying it's dependancy [Firmata](https://github.com/garrows/firmata) to use browser-serialport. + +## Restrictions + +You will not be able to add this to your normal website. + +This library only works in a [Chrome Packaged App](http://developer.chrome.com/apps/about_apps.html) as this is the only way to get access to the [serial ports API](http://developer.chrome.com/apps/serial.html) in the browser. Incidentally, since [NW.js](http://nwjs.io/) (a.k.a. node-webkit) now fully supports the Chrome Packaged App platform, this means you can also use this library in NW.js v0.13+. + +If you want help making your first Chrome App, read the ["Create Your First App"](http://developer.chrome.com/apps/first_app.html) tutorial. + +There is currently no Firefox extension support but that might come soon if possible. + + +Known incompatibilities with node-serialport +------------------------------------------- +* Parsers not implemented +* Inconsistent error messages +* Chrome has a slightly different options set: + * __dataBits__: 7, 8 + * __stopBits__: 1, 2 + * __parity__: 'none', 'even', 'mark', 'odd', 'space' + * __flowControl__: 'RTSCTS' + + +## Installation + +``` +npm install browser-serialport +``` + +To Use +------ + +Opening a serial port: + +```js +var SerialPort = require("browser-serialport").SerialPort +var serialPort = new SerialPort("/dev/tty-usbserial1", { + baudrate: 57600 +}); +``` + +When opening a serial port, you can specify (in this order). + +1. Path to Serial Port - required. +1. Options - optional and described below. + +The options object allows you to pass named options to the serial port during initialization. The valid attributes for the options object are the following: + +* baudrate: Baud Rate, defaults to 9600. Should be one of: 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1800, 1200, 600, 300, 200, 150, 134, 110, 75, or 50. Custom rates as allowed by hardware is supported. +* databits: Data Bits, defaults to 8. Must be one of: 8, 7, ~~6~~, or ~~5~~. +* stopbits: Stop Bits, defaults to 1. Must be one of: 1 or 2. +* parity: Parity, defaults to 'none'. Must be one of: 'none', 'even', 'mark', 'odd', 'space' +* buffersize: Size of read buffer, defaults to 255. Must be an integer value. +* parser: The parser engine to use with read data, defaults to rawPacket strategy which just emits the raw buffer as a "data" event. Can be any function that accepts EventEmitter as first parameter and the raw buffer as the second parameter. + +**Note, we have added support for either all lowercase OR camelcase of the options (thanks @jagautier), use whichever style you prefer.** + +open event +---------- + +You MUST wait for the open event to be emitted before reading/writing to the serial port. The open happens asynchronously so installing 'data' listeners and writing +before the open event might result in... nothing at all. + +Assuming you are connected to a serial console, you would for example: + +```js +serialPort.on("open", function () { + console.log('open'); + serialPort.on('data', function(data) { + console.log('data received: ' + data); + }); + serialPort.write("ls\n", function(err, results) { + console.log('err ' + err); + console.log('results ' + results); + }); +}); +``` + +You can also call the open function, in this case instanciate the serialport with an additional flag. + +```js +var SerialPort = require("browser-serialport").SerialPort +var serialPort = new SerialPort("/dev/tty-usbserial1", { + baudrate: 57600 +}, false); // this is the openImmediately flag [default is true] + +serialPort.open(function (error) { + if ( error ) { + console.log('failed to open: '+error); + } else { + console.log('open'); + serialPort.on('data', function(data) { + console.log('data received: ' + data); + }); + serialPort.write("ls\n", function(err, results) { + console.log('err ' + err); + console.log('results ' + results); + }); + } +}); +``` + +List Ports +---------- + +You can also list the ports along with some metadata as well. + +```js +var serialPort = require("browser-serialport"); +serialPort.list(function (err, ports) { + ports.forEach(function(port) { + console.log(port.comName); + console.log(port.pnpId); + console.log(port.manufacturer); + }); +}); +``` + +Parsers +------- + +Browser-serialport doesn't as of 2.0.0 support parsers. + + +You can get updates of new data from the Serial Port as follows: + +```js +serialPort.on("data", function (data) { + sys.puts("here: "+data); +}); +``` + +You can write to the serial port by sending a string or buffer to the write method as follows: + +```js +serialPort.write("OMG IT WORKS\r"); +``` + +Enjoy and do cool things with this code. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/index.js new file mode 100644 index 00000000..318974f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/index.js @@ -0,0 +1,423 @@ +'use strict'; + +var EE = require('events').EventEmitter; +var util = require('util'); + +var DATABITS = [7, 8]; +var STOPBITS = [1, 2]; +var PARITY = ['none', 'even', 'mark', 'odd', 'space']; +var FLOWCONTROLS = ['RTSCTS']; + +var _options = { + baudrate: 9600, + parity: 'none', + rtscts: false, + databits: 8, + stopbits: 1, + buffersize: 256 +}; + +function convertOptions(options){ + switch (options.dataBits) { + case 7: + options.dataBits = 'seven'; + break; + case 8: + options.dataBits = 'eight'; + break; + } + + switch (options.stopBits) { + case 1: + options.stopBits = 'one'; + break; + case 2: + options.stopBits = 'two'; + break; + } + + switch (options.parity) { + case 'none': + options.parity = 'no'; + break; + } + + return options; +} + +function SerialPort(path, options, openImmediately, callback) { + + EE.call(this); + + var self = this; + + var args = Array.prototype.slice.call(arguments); + callback = args.pop(); + if (typeof(callback) !== 'function') { + callback = null; + } + + options = (typeof options !== 'function') && options || {}; + + openImmediately = (openImmediately === undefined || openImmediately === null) ? true : openImmediately; + + callback = callback || function (err) { + if (err) { + self.emit('error', err); + } + }; + + var err; + + options.baudRate = options.baudRate || options.baudrate || _options.baudrate; + + options.dataBits = options.dataBits || options.databits || _options.databits; + if (DATABITS.indexOf(options.dataBits) === -1) { + err = new Error('Invalid "databits": ' + options.dataBits); + callback(err); + return; + } + + options.stopBits = options.stopBits || options.stopbits || _options.stopbits; + if (STOPBITS.indexOf(options.stopBits) === -1) { + err = new Error('Invalid "stopbits": ' + options.stopbits); + callback(err); + return; + } + + options.parity = options.parity || _options.parity; + if (PARITY.indexOf(options.parity) === -1) { + err = new Error('Invalid "parity": ' + options.parity); + callback(err); + return; + } + + if (!path) { + err = new Error('Invalid port specified: ' + path); + callback(err); + return; + } + + options.rtscts = _options.rtscts; + + if (options.flowControl || options.flowcontrol) { + var fc = options.flowControl || options.flowcontrol; + + if (typeof fc === 'boolean') { + options.rtscts = true; + } else { + var clean = fc.every(function (flowControl) { + var fcup = flowControl.toUpperCase(); + var idx = FLOWCONTROLS.indexOf(fcup); + if (idx < 0) { + var err = new Error('Invalid "flowControl": ' + fcup + '. Valid options: ' + FLOWCONTROLS.join(', ')); + callback(err); + return false; + } else { + + // "XON", "XOFF", "XANY", "DTRDTS", "RTSCTS" + switch (idx) { + case 0: options.rtscts = true; break; + } + return true; + } + }); + if(!clean){ + return; + } + } + } + + options.bufferSize = options.bufferSize || options.buffersize || _options.buffersize; + + // defaults to chrome.serial if no options.serial passed + // inlined instead of on _options to allow mocking global chrome.serial for optional options test + options.serial = options.serial || (typeof chrome !== 'undefined' && chrome.serial); + + if (!options.serial) { + throw new Error('No access to serial ports. Try loading as a Chrome Application.'); + } + + this.options = convertOptions(options); + + this.options.serial.onReceiveError.addListener(function(info){ + + switch (info.error) { + + case 'disconnected': + case 'device_lost': + case 'system_error': + err = new Error('Disconnected'); + // send notification of disconnect + if (self.options.disconnectedCallback) { + self.options.disconnectedCallback(err); + } else { + self.emit('disconnect', err); + } + if(self.connectionId >= 0){ + self.close(); + } + break; + case 'timeout': + break; + } + + }); + + this.path = path; + + if (openImmediately) { + process.nextTick(function () { + self.open(callback); + }); + } +} + +util.inherits(SerialPort, EE); + +SerialPort.prototype.connectionId = -1; + +SerialPort.prototype.open = function (callback) { + var options = { + bitrate: parseInt(this.options.baudRate, 10), + dataBits: this.options.dataBits, + parityBit: this.options.parity, + stopBits: this.options.stopBits, + ctsFlowControl: this.options.rtscts + }; + + this.options.serial.connect(this.path, options, this.proxy('onOpen', callback)); +}; + +SerialPort.prototype.onOpen = function (callback, openInfo) { + if(chrome.runtime.lastError){ + if(typeof callback === 'function'){ + callback(chrome.runtime.lastError); + }else{ + this.emit('error', chrome.runtime.lastError); + } + return; + } + + this.connectionId = openInfo.connectionId; + + if (this.connectionId === -1) { + this.emit('error', new Error('Could not open port.')); + return; + } + + this.emit('open', openInfo); + + this._reader = this.proxy('onRead'); + + this.options.serial.onReceive.addListener(this._reader); + + if(typeof callback === 'function'){ + callback(chrome.runtime.lastError, openInfo); + } +}; + +SerialPort.prototype.onRead = function (readInfo) { + if (readInfo && this.connectionId === readInfo.connectionId) { + + if (this.options.dataCallback) { + this.options.dataCallback(toBuffer(readInfo.data)); + } else { + this.emit('data', toBuffer(readInfo.data)); + } + + } +}; + +SerialPort.prototype.write = function (buffer, callback) { + if (this.connectionId < 0) { + var err = new Error('Serialport not open.'); + if(typeof callback === 'function'){ + callback(err); + }else{ + this.emit('error', err); + } + return; + } + + if (typeof buffer === 'string') { + buffer = str2ab(buffer); + } + + //Make sure its not a browserify faux Buffer. + if (buffer instanceof ArrayBuffer === false) { + buffer = buffer2ArrayBuffer(buffer); + } + + this.options.serial.send(this.connectionId, buffer, function(info) { + if (typeof callback === 'function') { + callback(chrome.runtime.lastError, info); + } + }); +}; + + +SerialPort.prototype.close = function (callback) { + if (this.connectionId < 0) { + var err = new Error('Serialport not open.'); + if(typeof callback === 'function'){ + callback(err); + }else{ + this.emit('error', err); + } + return; + } + + this.options.serial.disconnect(this.connectionId, this.proxy('onClose', callback)); +}; + +SerialPort.prototype.onClose = function (callback, result) { + this.connectionId = -1; + this.emit('close'); + + this.removeAllListeners(); + if(this._reader){ + this.options.serial.onReceive.removeListener(this._reader); + this._reader = null; + } + + if (typeof callback === 'function') { + callback(chrome.runtime.lastError, result); + } +}; + +SerialPort.prototype.flush = function (callback) { + if (this.connectionId < 0) { + var err = new Error('Serialport not open.'); + if(typeof callback === 'function'){ + callback(err); + }else{ + this.emit('error', err); + } + return; + } + + var self = this; + + this.options.serial.flush(this.connectionId, function(result) { + if (chrome.runtime.lastError) { + if (typeof callback === 'function') { + callback(chrome.runtime.lastError, result); + } else { + self.emit('error', chrome.runtime.lastError); + } + return; + } else { + callback(null, result); + } + }); +}; + +SerialPort.prototype.drain = function (callback) { + if (this.connectionId < 0) { + var err = new Error('Serialport not open.'); + if(typeof callback === 'function'){ + callback(err); + }else{ + this.emit('error', err); + } + return; + } + + if (typeof callback === 'function') { + callback(); + } +}; + + +SerialPort.prototype.proxy = function () { + var self = this; + var proxyArgs = []; + + //arguments isnt actually an array. + for (var i = 0; i < arguments.length; i++) { + proxyArgs[i] = arguments[i]; + } + + var functionName = proxyArgs.splice(0, 1)[0]; + + var func = function() { + var funcArgs = []; + for (var i = 0; i < arguments.length; i++) { + funcArgs[i] = arguments[i]; + } + var allArgs = proxyArgs.concat(funcArgs); + + self[functionName].apply(self, allArgs); + }; + + return func; +}; + +SerialPort.prototype.set = function (options, callback) { + this.options.serial.setControlSignals(this.connectionId, options, function(result){ + callback(chrome.runtime.lastError, result); + }); +}; + +SerialPort.prototype.isOpen = function () { + return this.connectionId > -1; +}; + +function SerialPortList(callback) { + if (typeof chrome != 'undefined' && chrome.serial) { + chrome.serial.getDevices(function(ports) { + var portObjects = new Array(ports.length); + for (var i = 0; i < ports.length; i++) { + portObjects[i] = { + comName: ports[i].path, + manufacturer: ports[i].displayName, + serialNumber: '', + pnpId: '', + locationId:'', + vendorId: '0x' + (ports[i].vendorId||0).toString(16), + productId: '0x' + (ports[i].productId||0).toString(16) + }; + } + callback(chrome.runtime.lastError, portObjects); + }); + } else { + callback(new Error('No access to serial ports. Try loading as a Chrome Application.'), null); + } +} + +// Convert string to ArrayBuffer +function str2ab(str) { + var buf = new ArrayBuffer(str.length); + var bufView = new Uint8Array(buf); + for (var i = 0; i < str.length; i++) { + bufView[i] = str.charCodeAt(i); + } + return buf; +} + +// Convert buffer to ArrayBuffer +function buffer2ArrayBuffer(buffer) { + var buf = new ArrayBuffer(buffer.length); + var bufView = new Uint8Array(buf); + for (var i = 0; i < buffer.length; i++) { + bufView[i] = buffer[i]; + } + return buf; +} + +function toBuffer(ab) { + var buffer = new Buffer(ab.byteLength); + var view = new Uint8Array(ab); + for (var i = 0; i < buffer.length; ++i) { + buffer[i] = view[i]; + } + return buffer; +} + +module.exports = { + SerialPort: SerialPort, + list: SerialPortList, + buffer2ArrayBuffer: buffer2ArrayBuffer, + used: [] //TODO: Populate this somewhere. +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/package.json new file mode 100644 index 00000000..48fb41b7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/package.json @@ -0,0 +1,65 @@ +{ + "_from": "browser-serialport@latest", + "_id": "browser-serialport@2.1.0", + "_inBundle": false, + "_integrity": "sha1-+4QHfoS5u7uEk1quH8rJzmEF3H8=", + "_location": "/node-red-contrib-johnny-five/browser-serialport", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "browser-serialport@latest", + "name": "browser-serialport", + "escapedName": "browser-serialport", + "rawSpec": "latest", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/johnny-five" + ], + "_resolved": "https://registry.npmjs.org/browser-serialport/-/browser-serialport-2.1.0.tgz", + "_shasum": "fb84077e84b9bbbb84935aae1fcac9ce6105dc7f", + "_spec": "browser-serialport@latest", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five", + "author": { + "name": "Glen Arrowsmith @garrows" + }, + "browser": "./index.js", + "bugs": { + "url": "https://github.com/garrows/browser-serialport/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Robots in the browser. Just like node-serialport but for browser/chrome apps.", + "devDependencies": { + "chai": "^1.10.0", + "jshint": "^2.5.11", + "lodash": "^3.6.0", + "mocha": "^2.1.0", + "sinon": "^1.12.2", + "sinon-chai": "^2.6.0" + }, + "homepage": "https://github.com/garrows/browser-serialport#readme", + "keywords": [ + "serial", + "firmata", + "nodebots", + "chromebots", + "browserbots", + "robot", + "robots" + ], + "license": "MIT", + "main": "index.js", + "name": "browser-serialport", + "repository": { + "type": "git", + "url": "git://github.com/garrows/browser-serialport.git" + }, + "scripts": { + "test": "jshint index.js && mocha" + }, + "version": "2.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/test/parsers.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/test/parsers.js new file mode 100644 index 00000000..d024c7a8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/test/parsers.js @@ -0,0 +1,47 @@ +"use strict"; + +var chai = require('chai'); +var expect = chai.expect; +var sinonChai = require("sinon-chai"); +var sinon = require("sinon"); +chai.use(sinonChai); + +// var parsers = require('../parsers'); + +describe.skip("parsers", function () { + + describe("#raw", function () { + it("emits data exactly as it's written", function () { + var data = new Buffer("BOGUS"); + var spy = sinon.spy(); + parsers.raw({ emit: spy }, data); + expect(spy.getCall(0).args[1]).to.deep.equal(new Buffer("BOGUS")); + }); + }); + + describe("#readline", function () { + it("emits data events split on a delimiter", function () { + var data = new Buffer("I love robots\rEach and Every One\r"); + var spy = sinon.spy(); + var parser = parsers.readline(); + parser({ emit: spy }, data); + expect(spy).to.have.been.calledWith("data", "I love robots"); + expect(spy).to.have.been.calledWith("data", "Each and Every One"); + }); + }); + + describe('#byteLength', function(){ + it("emits data events every 8 bytes", function () { + var data = new Buffer("Robots are so freaking cool!"); + var spy = sinon.spy(); + var parser = parsers.byteLength(8); + parser({ emit: spy }, data); + expect(spy.callCount).to.equal(3); + expect(spy.getCall(0).args[1].length).to.equal(8); + expect(spy.getCall(0).args[1]).to.deep.equal(new Buffer("Robots a")); + expect(spy.getCall(1).args[1]).to.deep.equal(new Buffer("re so fr")); + expect(spy.getCall(2).args[1]).to.deep.equal(new Buffer("eaking c")); + }); + }); + +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/test/serialport-basic.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/test/serialport-basic.js new file mode 100644 index 00000000..e58a1270 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/browser-serialport/test/serialport-basic.js @@ -0,0 +1,434 @@ +'use strict'; + +var sinon = require('sinon'); +var chai = require('chai'); +var without = require('lodash/array/without'); +var expect = chai.expect; + +var MockedSerialPort = require('../'); +var SerialPort = MockedSerialPort.SerialPort; + +var options; + +function unset(msg){ + return function(){ + throw new Error(msg); + }; +} + +var serialListeners = []; + +var hardware = { + ports: {}, + createPort: function(path){ + this.ports[path] = true; + }, + reset: function(){ + this.ports = {}; + this.onReceive = unset('onreceive unset'); + this.onReceiveError = unset('onReceiveError unset'); + }, + onReceive: unset('onReceive unset'), + onReceiveError: unset('onReceiveError unset'), + emitData: function(buffer){ + process.nextTick(function(){ + var readInfo = {data: MockedSerialPort.buffer2ArrayBuffer(buffer), connectionId: 1}; + serialListeners.forEach(function(cb){ + cb(readInfo); + }); + }); + }, + disconnect: function(path){ + this.ports[path] = false; + var info = {error: 'disconnected', connectionId: 1}; + this.onReceiveError(info); + }, + timeout: function(path){ + this.ports[path] = false; + var info = {error: 'timeout', connectionId: 1}; + this.onReceiveError(info); + }, + loseDevice: function(path){ + this.ports[path] = false; + var info = {error: 'device_lost', connectionId: 1}; + this.onReceiveError(info); + }, + systemError: function(path){ + this.ports[path] = false; + var info = {error: 'system_error', connectionId: 1}; + this.onReceiveError(info); + } +}; + +describe('SerialPort', function () { + var sandbox; + + beforeEach(function () { + sandbox = sinon.sandbox.create(); + + global.chrome = { runtime: { lastError: null } }; + + serialListeners = []; + + options = { + serial: { + connect: function(path, options, cb){ + if (!hardware.ports[path]) { + global.chrome.runtime.lastError = new Error({message: 'Failed to connect to the port.'}); + } + + chai.assert.ok(options.bitrate, 'baudrate not set'); + chai.assert.ok(options.dataBits, 'databits not set'); + chai.assert.ok(options.parityBit, 'parity not set'); + chai.assert.ok(options.stopBits, 'stopbits not set'); + chai.assert.isBoolean(options.ctsFlowControl, 'flowcontrol not set'); + + cb({ + bitrate: 9600, + bufferSize: 4096, + connectionId: 1, + ctsFlowControl: true, + dataBits: 'eight', + name: '', + parityBit: 'no', + paused: false, + persistent: false, + receiveTimeout: 0, + sendTimeout: 0, + stopBits: 'one' + }); + }, + onReceive: { + addListener: function(cb){ + serialListeners.push(cb); + }, + removeListener: function(cb){ + serialListeners = without(serialListeners, cb); + } + }, + onReceiveError: { + addListener: function(cb){ + hardware.onReceiveError = cb; + } + }, + send: function(connectionId, buffer, cb){ + + }, + disconnect: function(connectionId, cb){ + cb(); + }, + setControlSignals: function(connectionId, options, cb){ + cb(); + } + } + }; + // Create a port for fun and profit + hardware.reset(); + hardware.createPort('/dev/exists'); + }); + + afterEach(function () { + options = null; + + sandbox.restore(); + }); + + describe('Constructor', function () { + it('opens the port immediately', function (done) { + var port = new SerialPort('/dev/exists', options, function (err) { + expect(err).to.not.be.ok; + done(); + }); + }); + + it('emits the open event', function (done) { + var port = new SerialPort('/dev/exists', options); + port.on('open', function(){ + done(); + }); + }); + + it.skip('emits an error on the factory when erroring without a callback', function (done) { + // finish the test on error + MockedSerialPort.once('error', function (err) { + chai.assert.isDefined(err, 'didn\'t get an error'); + done(); + }); + + var port = new SerialPort('/dev/johnJacobJingleheimerSchmidt'); + }); + + it('emits an error on the serialport when explicit error handler present', function (done) { + var port = new SerialPort('/dev/johnJacobJingleheimerSchmidt', options); + + port.once('error', function(err) { + chai.assert.isDefined(err); + done(); + }); + }); + + it('errors with invalid databits', function (done) { + var errorCallback = function (err) { + chai.assert.isDefined(err, 'err is not defined'); + done(); + }; + + var port = new SerialPort('/dev/exists', { databits : 19 }, false, errorCallback); + }); + + it('errors with invalid stopbits', function (done) { + var errorCallback = function (err) { + chai.assert.isDefined(err, 'err is not defined'); + done(); + }; + + var port = new SerialPort('/dev/exists', { stopbits : 19 }, false, errorCallback); + }); + + it('errors with invalid parity', function (done) { + var errorCallback = function (err) { + chai.assert.isDefined(err, 'err is not defined'); + done(); + }; + + var port = new SerialPort('/dev/exists', { parity : 'pumpkins' }, false, errorCallback); + }); + + it('errors with invalid flow control', function (done) { + var errorCallback = function (err) { + chai.assert.isDefined(err, 'err is not defined'); + done(); + }; + + var port = new SerialPort('/dev/exists', { flowcontrol : ['pumpkins'] }, false, errorCallback); + }); + + it('errors with invalid path', function (done) { + var errorCallback = function (err) { + chai.assert.isDefined(err, 'err is not defined'); + done(); + }; + + var port = new SerialPort(null, false, errorCallback); + }); + + it('allows optional options', function (done) { + global.chrome.serial = options.serial; + var cb = function () {}; + var port = new SerialPort('/dev/exists', cb); + // console.log(port); + expect(typeof port.options).to.eq('object'); + delete global.chrome.serial; + done(); + }); + + }); + + describe('Functions', function () { + + it('write errors when serialport not open', function (done) { + var cb = function () {}; + var port = new SerialPort('/dev/exists', options, false, cb); + port.write(null, function(err){ + chai.assert.isDefined(err, 'err is not defined'); + done(); + }); + }); + + it('close errors when serialport not open', function (done) { + var cb = function () {}; + var port = new SerialPort('/dev/exists', options, false, cb); + port.close(function(err){ + chai.assert.isDefined(err, 'err is not defined'); + done(); + }); + }); + + it('flush errors when serialport not open', function (done) { + var cb = function () {}; + var port = new SerialPort('/dev/exists', options, false, cb); + port.flush(function(err){ + chai.assert.isDefined(err, 'err is not defined'); + done(); + }); + }); + + it('set errors when serialport not open', function (done) { + var cb = function () {}; + var port = new SerialPort('/dev/exists', options, false, cb); + port.set({}, function(err){ + chai.assert.isDefined(err, 'err is not defined'); + done(); + }); + }); + + it('drain errors when serialport not open', function (done) { + var cb = function () {}; + var port = new SerialPort('/dev/exists', options, false, cb); + port.drain(function(err){ + chai.assert.isDefined(err, 'err is not defined'); + done(); + }); + }); + + }); + + describe('reading data', function () { + + it('emits data events by default', function (done) { + var testData = new Buffer('I am a really short string'); + var port = new SerialPort('/dev/exists', options, function () { + port.once('data', function(recvData) { + expect(recvData).to.eql(testData); + done(); + }); + hardware.emitData(testData); + }); + }); + + it('calls the dataCallback if set', function (done) { + var testData = new Buffer('I am a really short string'); + options.dataCallback = function (recvData) { + expect(recvData).to.eql(testData); + done(); + }; + + var port = new SerialPort('/dev/exists', options, function () { + hardware.emitData(testData); + }); + }); + + }); + + describe('#open', function () { + + it('passes the port to the bindings', function (done) { + var openSpy = sandbox.spy(options.serial, 'connect'); + var port = new SerialPort('/dev/exists', options, false); + port.open(function (err) { + expect(err).to.not.be.ok; + expect(openSpy.calledWith('/dev/exists')); + done(); + }); + }); + + it('calls back an error when opening an invalid port', function (done) { + var port = new SerialPort('/dev/unhappy', options, false); + port.open(function (err) { + expect(err).to.be.ok; + done(); + }); + }); + + it('emits data after being reopened', function (done) { + var data = new Buffer('Howdy!'); + var port = new SerialPort('/dev/exists', options, function () { + port.close(function () { + port.open(function () { + port.once('data', function (res) { + expect(res).to.eql(data); + done(); + }); + hardware.emitData(data); + }); + }); + }); + }); + + it('does not emit data twice if reopened', function (done) { + var data = new Buffer('Howdy!'); + var port = new SerialPort('/dev/exists', options, function () { + port.close(function () { + port.open(function () { + var count = 0; + port.on('data', function (res) { + count++; + }); + hardware.emitData(data); + + setTimeout(function(){ + expect(count).to.equal(1); + done(); + }, 200); + }); + }); + }); + }); + }); + + describe('#send', function () { + + it('errors when writing a closed port', function (done) { + var port = new SerialPort('/dev/exists', options, false); + port.write(new Buffer(''), function(err){ + expect(err).to.be.ok; + done(); + }); + }); + + }); + + describe('close', function () { + it('fires a close event when it\'s closed', function (done) { + var port = new SerialPort('/dev/exists', options, function () { + var closeSpy = sandbox.spy(); + port.on('close', closeSpy); + port.close(); + expect(closeSpy.calledOnce); + done(); + }); + }); + + it('fires a close event after being reopened', function (done) { + var port = new SerialPort('/dev/exists', options, function () { + var closeSpy = sandbox.spy(); + port.on('close', closeSpy); + port.close(); + port.open(); + port.close(); + expect(closeSpy.calledTwice); + done(); + }); + }); + + it('errors when closing an invalid port', function (done) { + var port = new SerialPort('/dev/exists', options, false); + port.close(function(err){ + expect(err).to.be.ok; + done(); + }); + }); + + it('emits a close event', function (done) { + var port = new SerialPort('/dev/exists', options, function () { + port.on('close', function () { + done(); + }); + port.close(); + }); + }); + }); + + describe('disconnect', function () { + it('fires a disconnect event', function (done) { + options.disconnectedCallback = function (err) { + expect(err).to.be.ok; + done(); + }; + var port = new SerialPort('/dev/exists', options, function () { + hardware.disconnect('/dev/exists'); + }); + }); + + it('emits a disconnect event', function (done) { + var port = new SerialPort('/dev/exists', options, function () { + port.on('disconnect', function () { + done(); + }); + hardware.disconnect('/dev/exists'); + }); + }); + }); + +}); + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/index.js new file mode 100644 index 00000000..0bd335ff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/index.js @@ -0,0 +1,17 @@ +function allocUnsafe (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } + + if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } + + if (Buffer.allocUnsafe) { + return Buffer.allocUnsafe(size) + } else { + return new Buffer(size) + } +} + +module.exports = allocUnsafe diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/package.json new file mode 100644 index 00000000..2fac5079 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/package.json @@ -0,0 +1,57 @@ +{ + "_from": "buffer-alloc-unsafe@^1.1.0", + "_id": "buffer-alloc-unsafe@1.1.0", + "_inBundle": false, + "_integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "_location": "/node-red-contrib-johnny-five/buffer-alloc-unsafe", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-alloc-unsafe@^1.1.0", + "name": "buffer-alloc-unsafe", + "escapedName": "buffer-alloc-unsafe", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/buffer-alloc" + ], + "_resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "_shasum": "bd7dc26ae2972d0eda253be061dba992349c19f0", + "_spec": "buffer-alloc-unsafe@^1.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc", + "bugs": { + "url": "https://github.com/LinusU/buffer-alloc-unsafe/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A [ponyfill](https://ponyfill.com) for `Buffer.allocUnsafe`.", + "devDependencies": { + "standard": "^7.1.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/LinusU/buffer-alloc-unsafe#readme", + "keywords": [ + "allocUnsafe", + "allocate", + "buffer allocUnsafe", + "buffer unsafe allocate", + "buffer", + "ponyfill", + "unsafe allocate" + ], + "license": "MIT", + "name": "buffer-alloc-unsafe", + "repository": { + "type": "git", + "url": "git+https://github.com/LinusU/buffer-alloc-unsafe.git" + }, + "scripts": { + "test": "standard && node test" + }, + "version": "1.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/readme.md new file mode 100644 index 00000000..8725ecf6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc-unsafe/readme.md @@ -0,0 +1,46 @@ +# Buffer Alloc Unsafe + +A [ponyfill](https://ponyfill.com) for `Buffer.allocUnsafe`. + +Works as Node.js: `v7.0.0`
+Works on Node.js: `v0.10.0` + +## Installation + +```sh +npm install --save buffer-alloc-unsafe +``` + +## Usage + +```js +const allocUnsafe = require('buffer-alloc-unsafe') + +console.log(allocUnsafe(10)) +//=> + +console.log(allocUnsafe(10)) +//=> + +console.log(allocUnsafe(10)) +//=> + +allocUnsafe(-10) +//=> RangeError: "size" argument must not be negative +``` + +## API + +### allocUnsafe(size) + +- `size` <Integer> The desired length of the new `Buffer` + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must be +less than or equal to the value of `buffer.kMaxLength` and greater than or equal +to zero. Otherwise, a `RangeError` is thrown. + +## See also + +- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` +- [buffer-fill](https://github.com/LinusU/buffer-fill) A ponyfill for `Buffer.fill` +- [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/index.js new file mode 100644 index 00000000..fe658606 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/index.js @@ -0,0 +1,32 @@ +var bufferFill = require('buffer-fill') +var allocUnsafe = require('buffer-alloc-unsafe') + +module.exports = function alloc (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } + + if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } + + if (Buffer.alloc) { + return Buffer.alloc(size, fill, encoding) + } + + var buffer = allocUnsafe(size) + + if (size === 0) { + return buffer + } + + if (fill === undefined) { + return bufferFill(buffer, 0) + } + + if (typeof encoding !== 'string') { + encoding = undefined + } + + return bufferFill(buffer, fill, encoding) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/package.json new file mode 100644 index 00000000..0acf5307 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/package.json @@ -0,0 +1,59 @@ +{ + "_from": "buffer-alloc@^1.2.0", + "_id": "buffer-alloc@1.2.0", + "_inBundle": false, + "_integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "_location": "/node-red-contrib-johnny-five/buffer-alloc", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-alloc@^1.2.0", + "name": "buffer-alloc", + "escapedName": "buffer-alloc", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/tar-stream" + ], + "_resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "_shasum": "890dd90d923a873e08e10e5fd51a57e5b7cce0ec", + "_spec": "buffer-alloc@^1.2.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/tar-stream", + "bugs": { + "url": "https://github.com/LinusU/buffer-alloc/issues" + }, + "bundleDependencies": false, + "dependencies": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + }, + "deprecated": false, + "description": "A [ponyfill](https://ponyfill.com) for `Buffer.alloc`.", + "devDependencies": { + "standard": "^7.1.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/LinusU/buffer-alloc#readme", + "keywords": [ + "alloc", + "allocate", + "buffer alloc", + "buffer allocate", + "buffer" + ], + "license": "MIT", + "name": "buffer-alloc", + "repository": { + "type": "git", + "url": "git+https://github.com/LinusU/buffer-alloc.git" + }, + "scripts": { + "test": "standard && node test" + }, + "version": "1.2.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/readme.md new file mode 100644 index 00000000..80c7d7bb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc/readme.md @@ -0,0 +1,43 @@ +# Buffer Alloc + +A [ponyfill](https://ponyfill.com) for `Buffer.alloc`. + +Works as Node.js: `v7.0.0`
+Works on Node.js: `v0.10.0` + +## Installation + +```sh +npm install --save buffer-alloc +``` + +## Usage + +```js +const alloc = require('buffer-alloc') + +console.log(alloc(4)) +//=> + +console.log(alloc(6, 0x41)) +//=> + +console.log(alloc(10, 'linus', 'utf8')) +//=> +``` + +## API + +### alloc(size[, fill[, encoding]]) + +- `size` <Integer> The desired length of the new `Buffer` +- `fill` <String> | <Buffer> | <Integer> A value to pre-fill the new `Buffer` with. **Default:** `0` +- `encoding` <String> If `fill` is a string, this is its encoding. **Default:** `'utf8'` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the `Buffer` will be zero-filled. + +## See also + +- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` +- [buffer-fill](https://github.com/LinusU/buffer-fill) A ponyfill for `Buffer.fill` +- [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/index.js new file mode 100644 index 00000000..428a9e1f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/index.js @@ -0,0 +1,113 @@ +/* Node.js 6.4.0 and up has full support */ +var hasFullSupport = (function () { + try { + if (!Buffer.isEncoding('latin1')) { + return false + } + + var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4) + + buf.fill('ab', 'ucs2') + + return (buf.toString('hex') === '61006200') + } catch (_) { + return false + } +}()) + +function isSingleByte (val) { + return (val.length === 1 && val.charCodeAt(0) < 256) +} + +function fillWithNumber (buffer, val, start, end) { + if (start < 0 || end > buffer.length) { + throw new RangeError('Out of range index') + } + + start = start >>> 0 + end = end === undefined ? buffer.length : end >>> 0 + + if (end > start) { + buffer.fill(val, start, end) + } + + return buffer +} + +function fillWithBuffer (buffer, val, start, end) { + if (start < 0 || end > buffer.length) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return buffer + } + + start = start >>> 0 + end = end === undefined ? buffer.length : end >>> 0 + + var pos = start + var len = val.length + while (pos <= (end - len)) { + val.copy(buffer, pos) + pos += len + } + + if (pos !== end) { + val.copy(buffer, pos, 0, end - pos) + } + + return buffer +} + +function fill (buffer, val, start, end, encoding) { + if (hasFullSupport) { + return buffer.fill(val, start, end, encoding) + } + + if (typeof val === 'number') { + return fillWithNumber(buffer, val, start, end) + } + + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = buffer.length + } else if (typeof end === 'string') { + encoding = end + end = buffer.length + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + + if (encoding === 'latin1') { + encoding = 'binary' + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + if (val === '') { + return fillWithNumber(buffer, 0, start, end) + } + + if (isSingleByte(val)) { + return fillWithNumber(buffer, val.charCodeAt(0), start, end) + } + + val = new Buffer(val, encoding) + } + + if (Buffer.isBuffer(val)) { + return fillWithBuffer(buffer, val, start, end) + } + + // Other values (e.g. undefined, boolean, object) results in zero-fill + return fillWithNumber(buffer, 0, start, end) +} + +module.exports = fill diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/package.json new file mode 100644 index 00000000..c961f505 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/package.json @@ -0,0 +1,49 @@ +{ + "_from": "buffer-fill@^1.0.0", + "_id": "buffer-fill@1.0.0", + "_inBundle": false, + "_integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "_location": "/node-red-contrib-johnny-five/buffer-fill", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-fill@^1.0.0", + "name": "buffer-fill", + "escapedName": "buffer-fill", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/buffer-alloc" + ], + "_resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "_shasum": "f8f78b76789888ef39f205cd637f68e702122b2c", + "_spec": "buffer-fill@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/buffer-alloc", + "bugs": { + "url": "https://github.com/LinusU/buffer-fill/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A [ponyfill](https://ponyfill.com) for `Buffer.fill`.", + "devDependencies": { + "buffer-alloc-unsafe": "^1.1.0", + "standard": "^7.1.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/LinusU/buffer-fill#readme", + "license": "MIT", + "name": "buffer-fill", + "repository": { + "type": "git", + "url": "git+https://github.com/LinusU/buffer-fill.git" + }, + "scripts": { + "test": "standard && node test" + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/readme.md new file mode 100644 index 00000000..ac307383 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-fill/readme.md @@ -0,0 +1,54 @@ +# Buffer Fill + +A [ponyfill](https://ponyfill.com) for `Buffer.fill`. + +Works as Node.js: `v6.4.0`
+Works on Node.js: `v0.10.0` + +## Installation + +```sh +npm install --save buffer-fill +``` + +## Usage + +```js +const fill = require('buffer-fill') +const buf = Buffer.allocUnsafe(5) + +console.log(buf.fill(8)) +//=> + +console.log(buf.fill(9, 2, 4)) +//=> + +console.log(buf.fill('linus', 'latin1')) +//=> + +console.log(buf.fill('\u0222')) +//=> +``` + +## API + +### fill(buf, value[, offset[, end]][, encoding]) + +- `value` <String> | <Buffer> | <Integer> The value to fill `buf` with +- `offset` <Integer> Where to start filling `buf`. **Default:** `0` +- `end` <Integer> Where to stop filling `buf` (not inclusive). **Default:** `buf.length` +- `encoding` <String> If `value` is a string, this is its encoding. **Default:** `'utf8'` +- Return: <Buffer> A reference to `buf` + +Fills `buf` with the specified `value`. If the `offset` and `end` are not given, +the entire `buf` will be filled. This is meant to be a small simplification to +allow the creation and filling of a `Buffer` to be done on a single line. + +If the final write of a `fill()` operation falls on a multi-byte character, then +only the first bytes of that character that fit into `buf` are written. + +## See also + +- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` +- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` +- [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/LICENSE new file mode 100644 index 00000000..e4bf1d69 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016, 2018 Linus Unnebäck + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/index.js new file mode 100644 index 00000000..d92a83d0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/index.js @@ -0,0 +1,69 @@ +var toString = Object.prototype.toString + +var isModern = ( + typeof Buffer.alloc === 'function' && + typeof Buffer.allocUnsafe === 'function' && + typeof Buffer.from === 'function' +) + +function isArrayBuffer (input) { + return toString.call(input).slice(8, -1) === 'ArrayBuffer' +} + +function fromArrayBuffer (obj, byteOffset, length) { + byteOffset >>>= 0 + + var maxLength = obj.byteLength - byteOffset + + if (maxLength < 0) { + throw new RangeError("'offset' is out of bounds") + } + + if (length === undefined) { + length = maxLength + } else { + length >>>= 0 + + if (length > maxLength) { + throw new RangeError("'length' is out of bounds") + } + } + + return isModern + ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) + : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + return isModern + ? Buffer.from(string, encoding) + : new Buffer(string, encoding) +} + +function bufferFrom (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (isArrayBuffer(value)) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + return isModern + ? Buffer.from(value) + : new Buffer(value) +} + +module.exports = bufferFrom diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/package.json new file mode 100644 index 00000000..170c63e1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/package.json @@ -0,0 +1,52 @@ +{ + "_from": "buffer-from@^1.0.0", + "_id": "buffer-from@1.1.1", + "_inBundle": false, + "_integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "_location": "/node-red-contrib-johnny-five/buffer-from", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "buffer-from@^1.0.0", + "name": "buffer-from", + "escapedName": "buffer-from", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/concat-stream" + ], + "_resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "_shasum": "32713bc028f75c02fdb710d7c7bcec1f2c6070ef", + "_spec": "buffer-from@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/concat-stream", + "bugs": { + "url": "https://github.com/LinusU/buffer-from/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.", + "devDependencies": { + "standard": "^7.1.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/LinusU/buffer-from#readme", + "keywords": [ + "buffer", + "buffer from" + ], + "license": "MIT", + "name": "buffer-from", + "repository": { + "type": "git", + "url": "git+https://github.com/LinusU/buffer-from.git" + }, + "scripts": { + "test": "standard && node test" + }, + "version": "1.1.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/readme.md new file mode 100644 index 00000000..9880a558 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/buffer-from/readme.md @@ -0,0 +1,69 @@ +# Buffer From + +A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available. + +## Installation + +```sh +npm install --save buffer-from +``` + +## Usage + +```js +const bufferFrom = require('buffer-from') + +console.log(bufferFrom([1, 2, 3, 4])) +//=> + +const arr = new Uint8Array([1, 2, 3, 4]) +console.log(bufferFrom(arr.buffer, 1, 2)) +//=> + +console.log(bufferFrom('test', 'utf8')) +//=> + +const buf = bufferFrom('test') +console.log(bufferFrom(buf)) +//=> +``` + +## API + +### bufferFrom(array) + +- `array` <Array> + +Allocates a new `Buffer` using an `array` of octets. + +### bufferFrom(arrayBuffer[, byteOffset[, length]]) + +- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer +- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0` +- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a TypedArray instance, the +newly created `Buffer` will share the same allocated memory as the TypedArray. + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +### bufferFrom(buffer) + +- `buffer` <Buffer> An existing `Buffer` to copy data from + +Copies the passed `buffer` data onto a new `Buffer` instance. + +### bufferFrom(string[, encoding]) + +- `string` <String> A string to encode. +- `encoding` <String> The encoding of `string`. **Default:** `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `string`. If +provided, the `encoding` parameter identifies the character encoding of +`string`. + +## See also + +- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` +- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.jshintrc b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.jshintrc new file mode 100644 index 00000000..3d1a1eda --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.jshintrc @@ -0,0 +1,60 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "es5": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": true + , "passfail": false +} \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.npmignore new file mode 100644 index 00000000..73734ed3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.npmignore @@ -0,0 +1,7 @@ +node_modules/ +build/ +libleveldb.so +libleveldb.a +test-data/ +_benchdb_* +*.sw* diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.travis.yml new file mode 100644 index 00000000..dad2273c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - "0.10" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/README.md new file mode 100644 index 00000000..b570888c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/README.md @@ -0,0 +1,86 @@ +CallbackStream +===== + +[![Build +Status](https://travis-ci.org/mcollina/callback-stream.png)](https://travis-ci.org/mcollina/callback-stream) + +It is a safe variant of the +[concat-stream](https://github.com/maxogden/node-concat-stream) +package that _will always return an array_. + +It does everything callback-stream does, minus the concatenation. +In fact, it just callbacks you with an array containing your +good stuff. + +It is based on the Stream 2 API, but it also works on node v0.8. +It also support Stream 3, which is bundled with node v0.12 and iojs. + +## Installation + +``` +npm install callback-stream --save +``` + +## Pipe usage + +```js +var callback = require('callback-stream') +var fs = require('fs') +var read = fs.createReadStream('readme.md') +var write = callback(function (err, data) { + console.log(err, data) +}) + +read.pipe(write) +``` + +## Object mode usage + +``` +var callback = require('callback-stream') +var write = callback.obj(function (err, data) { + // this will print ['hello', 'world'] + console.log(data) +}) + +write.write('hello') +write.write('world') +write.end() +``` + +## Contributing to CallbackStream + +* Check out the latest master to make sure the feature hasn't been + implemented or the bug hasn't been fixed yet +* Check out the issue tracker to make sure someone already hasn't + requested it and/or contributed it +* Fork the project +* Start a feature/bugfix branch +* Commit and push until you are happy with your contribution +* Make sure to add tests for it. This is important so I don't break it + in a future version unintentionally. + +## LICENSE - "MIT License" + +Copyright (c) 2013-2015 Matteo Collina, http://matteocollina.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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/index.js new file mode 100644 index 00000000..0c3e15e1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/index.js @@ -0,0 +1,51 @@ +'use strict' + +var Writable = require('readable-stream').Writable +var inherits = require('inherits') + +function CallbackStream (options, callback) { + if (!(this instanceof CallbackStream)) { + return new CallbackStream(options, callback) + } + + if (typeof options === 'function') { + callback = options + options = {} + } + + Writable.call(this, options) + + this.results = [] + this.callback = callback + + this.on('finish', deliversCallback) + this.once('pipe', handlePipe) +} + +function deliversCallback () { + this.callback(null, this.results) +} + +function handlePipe (source) { + source.on('error', this.callback) +} + +inherits(CallbackStream, Writable) + +CallbackStream.prototype._write = function (data, encoding, done) { + this.results.push(data) + done() +} + +CallbackStream.obj = function (options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + options.objectMode = true + + return new CallbackStream(options, callback) +} + +module.exports = CallbackStream diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/package.json new file mode 100644 index 00000000..777a2142 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/package.json @@ -0,0 +1,67 @@ +{ + "_from": "callback-stream@^1.0.2", + "_id": "callback-stream@1.1.0", + "_inBundle": false, + "_integrity": "sha1-RwGlEmbwbgbqpx/BcjOCLYdfSQg=", + "_location": "/node-red-contrib-johnny-five/callback-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "callback-stream@^1.0.2", + "name": "callback-stream", + "escapedName": "callback-stream", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/help-me" + ], + "_resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz", + "_shasum": "4701a51266f06e06eaa71fc17233822d875f4908", + "_spec": "callback-stream@^1.0.2", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/help-me", + "author": { + "name": "Matteo Collina", + "email": "hello@matteocollina.com" + }, + "bugs": { + "url": "http://github.com/mcollina/callback-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "> 1.0.0 < 3.0.0" + }, + "deprecated": false, + "description": "A pipeable stream that calls your callback", + "devDependencies": { + "pre-commit": "^1.1.1", + "standard": "^5.0.0", + "tap": "~0.4.2", + "tape": "^4.0.2" + }, + "homepage": "https://github.com/mcollina/callback-stream#readme", + "keywords": [ + "callback", + "stream" + ], + "license": "MIT", + "main": "index.js", + "name": "callback-stream", + "precommit": [ + "lint", + "test" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/callback-stream.git" + }, + "scripts": { + "lint": "standard", + "test": "tap test.js" + }, + "version": "1.1.0", + "website": "https://github.com/mcollina/callback-stream" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/test.js new file mode 100644 index 00000000..cc9aa98b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/callback-stream/test.js @@ -0,0 +1,57 @@ +'use strict' + +var test = require('tap').test +var callback = require('./') +var fs = require('fs') + +test('call the callback after end with object mode', function (t) { + var opts = { objectMode: true } + var stream = callback(opts, function (err, results) { + t.deepEqual(results, ['hello'], 'should return the ending value') + t.end() + }) + + stream.end('hello') +}) + +test('support multiple writes with object mode', function (t) { + var opts = { objectMode: true } + var stream = callback(opts, function (err, results) { + t.deepEqual(results, ['hello', 'world'], 'should return the ending value') + t.end() + }) + + stream.write('hello') + stream.end('world') +}) + +test('works without object mode', function (t) { + var stream = callback(function (err, results) { + t.equal(results.length, 1, 'should contain only one value') + t.deepEqual(results[0].toString(), 'world', 'should return the ending value') + t.end() + }) + + stream.end('world') +}) + +test('is pipeable', function (t) { + var write = callback(function (err, results) { + var actual = Buffer.concat(results).toString() + var expected = fs.readFileSync('README.md').toString() + t.equal(actual, expected, 'should have the same content of the file') + t.end() + }) + var read = fs.createReadStream('README.md') + + read.pipe(write) +}) + +test('callback.obj shortcut for objectMode', function (t) { + var stream = callback.obj(function (err, results) { + t.deepEqual(results, ['hello'], 'should return the ending value') + t.end() + }) + + stream.end('hello') +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/index.js new file mode 100644 index 00000000..4c81d6d2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/index.js @@ -0,0 +1,220 @@ +'use strict'; +const escapeStringRegexp = require('escape-string-regexp'); +const ansiStyles = require('ansi-styles'); +const supportsColor = require('supports-color'); + +const template = require('./templates.js'); + +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); + +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; + +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); + +const styles = Object.create(null); + +function applyOptions(obj, options) { + options = options || {}; + + // Detect level if not set manually + const scLevel = supportsColor ? supportsColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} + +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = Chalk; + + return chalk.template; + } + + applyOptions(this, options); +} + +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} + +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], key); + } + }; +} + +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } + + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); + }; + } + }; +} + +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model); + }; + } + }; +} + +const proto = Object.defineProperties(() => {}, styles); + +function build(_styles, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + + const self = this; + + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; + + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto + + return builder; +} + +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + + if (argsLen === 0) { + return ''; + } + + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || this.level <= 0 || !str) { + return str; + } + + // 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. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } + + for (const code of this._styles.slice().reverse()) { + // 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; + + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } + + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + + return str; +} + +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } + + return template(chalk, parts.join('')); +} + +Object.defineProperties(Chalk.prototype, styles); + +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = supportsColor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/license b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/package.json new file mode 100644 index 00000000..1a905826 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/package.json @@ -0,0 +1,95 @@ +{ + "_from": "chalk@2.1.0", + "_id": "chalk@2.1.0", + "_inBundle": false, + "_integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "_location": "/node-red-contrib-johnny-five/chalk", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "chalk@2.1.0", + "name": "chalk", + "escapedName": "chalk", + "rawSpec": "2.1.0", + "saveSpec": null, + "fetchSpec": "2.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/johnny-five" + ], + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "_shasum": "ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e", + "_spec": "chalk@2.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^3.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" + }, + "deprecated": false, + "description": "Terminal string styling done right", + "devDependencies": { + "ava": "*", + "coveralls": "^2.11.2", + "execa": "^0.7.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^3.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "templates.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", + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && nyc ava" + }, + "version": "2.1.0", + "xo": { + "envs": [ + "node", + "mocha" + ] + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/readme.md new file mode 100644 index 00000000..dfcfdf25 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/chalk/readme.md @@ -0,0 +1,306 @@ +

+
+
+ 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/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) + +### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) + +![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~17,000 packages](https://www.npmjs.com/browse/depended/chalk) as of June 20th, 2017 + + +## Install + +```console +$ npm install chalk +``` + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + 'World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.` + + + + + + \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ease-component/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ease-component/index.js new file mode 100644 index 00000000..4516199b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ease-component/index.js @@ -0,0 +1,170 @@ + +// easing functions from "Tween.js" + +exports.linear = function(n){ + return n; +}; + +exports.inQuad = function(n){ + return n * n; +}; + +exports.outQuad = function(n){ + return n * (2 - n); +}; + +exports.inOutQuad = function(n){ + n *= 2; + if (n < 1) return 0.5 * n * n; + return - 0.5 * (--n * (n - 2) - 1); +}; + +exports.inCube = function(n){ + return n * n * n; +}; + +exports.outCube = function(n){ + return --n * n * n + 1; +}; + +exports.inOutCube = function(n){ + n *= 2; + if (n < 1) return 0.5 * n * n * n; + return 0.5 * ((n -= 2 ) * n * n + 2); +}; + +exports.inQuart = function(n){ + return n * n * n * n; +}; + +exports.outQuart = function(n){ + return 1 - (--n * n * n * n); +}; + +exports.inOutQuart = function(n){ + n *= 2; + if (n < 1) return 0.5 * n * n * n * n; + return -0.5 * ((n -= 2) * n * n * n - 2); +}; + +exports.inQuint = function(n){ + return n * n * n * n * n; +} + +exports.outQuint = function(n){ + return --n * n * n * n * n + 1; +} + +exports.inOutQuint = function(n){ + n *= 2; + if (n < 1) return 0.5 * n * n * n * n * n; + return 0.5 * ((n -= 2) * n * n * n * n + 2); +}; + +exports.inSine = function(n){ + return 1 - Math.cos(n * Math.PI / 2 ); +}; + +exports.outSine = function(n){ + return Math.sin(n * Math.PI / 2); +}; + +exports.inOutSine = function(n){ + return .5 * (1 - Math.cos(Math.PI * n)); +}; + +exports.inExpo = function(n){ + return 0 == n ? 0 : Math.pow(1024, n - 1); +}; + +exports.outExpo = function(n){ + return 1 == n ? n : 1 - Math.pow(2, -10 * n); +}; + +exports.inOutExpo = function(n){ + if (0 == n) return 0; + if (1 == n) return 1; + if ((n *= 2) < 1) return .5 * Math.pow(1024, n - 1); + return .5 * (-Math.pow(2, -10 * (n - 1)) + 2); +}; + +exports.inCirc = function(n){ + return 1 - Math.sqrt(1 - n * n); +}; + +exports.outCirc = function(n){ + return Math.sqrt(1 - (--n * n)); +}; + +exports.inOutCirc = function(n){ + n *= 2 + if (n < 1) return -0.5 * (Math.sqrt(1 - n * n) - 1); + return 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1); +}; + +exports.inBack = function(n){ + var s = 1.70158; + return n * n * (( s + 1 ) * n - s); +}; + +exports.outBack = function(n){ + var s = 1.70158; + return --n * n * ((s + 1) * n + s) + 1; +}; + +exports.inOutBack = function(n){ + var s = 1.70158 * 1.525; + if ( ( n *= 2 ) < 1 ) return 0.5 * ( n * n * ( ( s + 1 ) * n - s ) ); + return 0.5 * ( ( n -= 2 ) * n * ( ( s + 1 ) * n + s ) + 2 ); +}; + +exports.inBounce = function(n){ + return 1 - exports.outBounce(1 - n); +}; + +exports.outBounce = function(n){ + if ( n < ( 1 / 2.75 ) ) { + return 7.5625 * n * n; + } else if ( n < ( 2 / 2.75 ) ) { + return 7.5625 * ( n -= ( 1.5 / 2.75 ) ) * n + 0.75; + } else if ( n < ( 2.5 / 2.75 ) ) { + return 7.5625 * ( n -= ( 2.25 / 2.75 ) ) * n + 0.9375; + } else { + return 7.5625 * ( n -= ( 2.625 / 2.75 ) ) * n + 0.984375; + } +}; + +exports.inOutBounce = function(n){ + if (n < .5) return exports.inBounce(n * 2) * .5; + return exports.outBounce(n * 2 - 1) * .5 + .5; +}; + +// aliases + +exports['in-quad'] = exports.inQuad; +exports['out-quad'] = exports.outQuad; +exports['in-out-quad'] = exports.inOutQuad; +exports['in-cube'] = exports.inCube; +exports['out-cube'] = exports.outCube; +exports['in-out-cube'] = exports.inOutCube; +exports['in-quart'] = exports.inQuart; +exports['out-quart'] = exports.outQuart; +exports['in-out-quart'] = exports.inOutQuart; +exports['in-quint'] = exports.inQuint; +exports['out-quint'] = exports.outQuint; +exports['in-out-quint'] = exports.inOutQuint; +exports['in-sine'] = exports.inSine; +exports['out-sine'] = exports.outSine; +exports['in-out-sine'] = exports.inOutSine; +exports['in-expo'] = exports.inExpo; +exports['out-expo'] = exports.outExpo; +exports['in-out-expo'] = exports.inOutExpo; +exports['in-circ'] = exports.inCirc; +exports['out-circ'] = exports.outCirc; +exports['in-out-circ'] = exports.inOutCirc; +exports['in-back'] = exports.inBack; +exports['out-back'] = exports.outBack; +exports['in-out-back'] = exports.inOutBack; +exports['in-bounce'] = exports.inBounce; +exports['out-bounce'] = exports.outBounce; +exports['in-out-bounce'] = exports.inOutBounce; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ease-component/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ease-component/package.json new file mode 100644 index 00000000..d77b3eae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ease-component/package.json @@ -0,0 +1,42 @@ +{ + "_from": "ease-component@latest", + "_id": "ease-component@1.0.0", + "_inBundle": false, + "_integrity": "sha1-s3VybbC1sEWVt3RAOW/sfapdd8k=", + "_location": "/node-red-contrib-johnny-five/ease-component", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "ease-component@latest", + "name": "ease-component", + "escapedName": "ease-component", + "rawSpec": "latest", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/johnny-five" + ], + "_resolved": "https://registry.npmjs.org/ease-component/-/ease-component-1.0.0.tgz", + "_shasum": "b375726db0b5b04595b77440396fec7daa5d77c9", + "_spec": "ease-component@latest", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five", + "bundleDependencies": false, + "component": { + "scripts": { + "ease/index.js": "index.js" + } + }, + "dependencies": {}, + "deprecated": false, + "description": "Easing functions (for canvas etc)", + "keywords": [ + "ease", + "easing", + "tween" + ], + "license": "MIT", + "name": "ease-component", + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/LICENSE new file mode 100644 index 00000000..757562ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/README.md new file mode 100644 index 00000000..f2560c93 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/README.md @@ -0,0 +1,52 @@ +# end-of-stream + +A node module that calls a callback when a readable/writable/duplex stream has completed or failed. + + npm install end-of-stream + +## Usage + +Simply pass a stream and a callback to the `eos`. +Both legacy streams, streams2 and stream3 are supported. + +``` js +var eos = require('end-of-stream'); + +eos(readableStream, function(err) { + // this will be set to the stream instance + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended', this === readableStream); +}); + +eos(writableStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished', this === writableStream); +}); + +eos(duplexStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended and finished', this === duplexStream); +}); + +eos(duplexStream, {readable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished but might still be readable'); +}); + +eos(duplexStream, {writable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended but might still be writable'); +}); + +eos(readableStream, {error:false}, function(err) { + // do not treat emit('error', err) as a end-of-stream +}); +``` + +## License + +MIT + +## Related + +`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/index.js new file mode 100644 index 00000000..be426c22 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/index.js @@ -0,0 +1,87 @@ +var once = require('once'); + +var noop = function() {}; + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; + + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; + + var onerror = function(err) { + callback.call(stream, err); + }; + + var onclose = function() { + if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close')); + }; + + var onrequest = function() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + if (isChildProcess(stream)) stream.on('exit', onexit); + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + + return function() { + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/package.json new file mode 100644 index 00000000..25660ba2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/end-of-stream/package.json @@ -0,0 +1,67 @@ +{ + "_from": "end-of-stream@^1.1.0", + "_id": "end-of-stream@1.4.1", + "_inBundle": false, + "_integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "_location": "/node-red-contrib-johnny-five/end-of-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "end-of-stream@^1.1.0", + "name": "end-of-stream", + "escapedName": "end-of-stream", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/duplexify", + "/node-red-contrib-johnny-five/mqtt", + "/node-red-contrib-johnny-five/mqtt/pump", + "/node-red-contrib-johnny-five/pump", + "/node-red-contrib-johnny-five/tar-fs/pump", + "/node-red-contrib-johnny-five/tar-stream" + ], + "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "_shasum": "ed29634d19baba463b6ce6b80a37213eab71ec43", + "_spec": "end-of-stream@^1.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/pump", + "author": { + "name": "Mathias Buus", + "email": "mathiasbuus@gmail.com" + }, + "bugs": { + "url": "https://github.com/mafintosh/end-of-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "once": "^1.4.0" + }, + "deprecated": false, + "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", + "files": [ + "index.js" + ], + "homepage": "https://github.com/mafintosh/end-of-stream", + "keywords": [ + "stream", + "streams", + "callback", + "finish", + "close", + "end", + "wait" + ], + "license": "MIT", + "main": "index.js", + "name": "end-of-stream", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/end-of-stream.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.4.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/.editorconfig b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/.editorconfig new file mode 100644 index 00000000..6c3bbec1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +trim_trailing_whitespace = true + +[{*.yml}] +indent_size = 2 +indent_style = space diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/CHANGES b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/CHANGES new file mode 100644 index 00000000..bb84baba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/CHANGES @@ -0,0 +1,650 @@ +For recent changelog see CHANGELOG.md + +----- + +v0.10.15 -- 2017.03.20 +* Fix Object.isValue (it was actually isNotValue) + +v0.10.14 -- 2017.03.15 +* Object.isValue util + +v0.10.13 -- 2017.03.13 +* Introduce JSON.safeStringify +* Improve message handling in error/custom +* Fix Array#concat shim +* Improve Array#flatten algorithm so it's stack trace friendly +* Make Object.isObject ES3 compatible + +v0.10.12 -- 2016.07.01 +* Ensure symbols are copied in Object.mixin +* Prevent RangeError errors in array#flatten +* Do not validate invalidate dates in validDate + +v0.10.11 -- 2015.12.18 +* Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens) + +v0.10.10 -- 2015.12.11 +* Add Object.isNumberValue util + +v0.10.9 -- 2015.12.01 +* Add Object.ensureNaturalNumber and Object.ensureNaturalNumberValue + +v0.10.8 -- 2015.10.02 +* Add Number.isNatural +* Add Object.find and Object.findKey +* Support arrays in Object.copyDeep +* Fix iteration issue in forEachRight and someRight +* Fix detection of native sinh +* Depend on es6-symbol v3 + +v0.10.7 -- 2015.04.22 +* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1. + Still they're non breaking and start the conventions to be used in v1 + * Object.validateArrayLike + * Object.validateArrayLikeObject + * Object.validateStringifiable + * Object.validateStringifiableValue + * Universal utilities for array-like/iterable objects + * Iterable.is + * Iterable.validate + * Iterable.validateObject + * Iterable.forEach +* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel +* Fix calculations of large numbers in Math.tanh +* Fix algorithm of Math.sinh +* Fix indexes to not use real symbols +* Fix length of String.fromCodePoint +* Fix tests of Array#copyWithin +* Update Travis CI configuration + +v0.10.6 -- 2015.02.02 +* Fix handling of infinite values in Math.trunc +* Fix handling of getters in Object.normalizeOptions + +v0.10.5 -- 2015.01.20 +* Add Function#toStringTokens +* Add Object.serialize and Object.unserialize +* Add String.randomUniq +* Fix Strin#camelToHyphen issue with tokens that end with digit +* Optimise Number.isInteger logic +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + +v0.10.4 -- 2014.04.30 +* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens) +* Improve documentations + +v0.10.3 -- 2014.04.29 +Provide accurate iterators handling: +* Array.from improvements: + * Assure right unicode symbols resolution when processing strings in Array.from + * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment +* Add methods: + * Array.prototype.entries + * Array.prototype.keys + * Array.prototype.values + * Array.prototype[@@iterator] + * String.prototype[@@iterator] + +Improve documentation + +v0.10.2 -- 2014.04.24 +- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are + no callable objects which are `typeof obj !== 'function'` +- Update Array.from map callback signature (up to latest resolution of TC39) +- Improve documentation + +v0.10.1 -- 2014.04.14 +Bump version for npm +(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago) + +v0.10.0 -- 2014.04.13 +Major update: +- All methods and function specified for ECMAScript 6 are now introduced as + shims accompanied with functions through which (optionally) they can be + implementend on native objects +- Filename convention was changed to shorter and strictly lower case names. e.g. + `lib/String/prototype/starts-with` became `string/#/starts-with` +- Generated functions are guaranteed to have expected length +- Objects with null prototype (created via `Object.create(null)`) are widely + supported (older version have crashed due to implied `obj.hasOwnProperty` and + related invocations) +- Support array subclasses +- When handling lists do not limit its length to Uint32 range +- Use newly introduced `Object.eq` for strict equality in place of `Object.is` +- Iteration of Object have been improved so properties that were hidden or + removed after iteration started are not iterated. + +Additions: +- `Array.isPlainArray` +- `Array.validArray` +- `Array.prototype.concat` (as updated with ES6) +- `Array.prototype.copyWithin` (as introduced with ES6) +- `Array.prototype.fill` (as introduced with ES6) +- `Array.prototype.filter` (as updated with ES6) +- `Array.prototype.findIndex` (as introduced with ES6) +- `Array.prototype.map` (as updated with ES6) +- `Array.prototype.separate` +- `Array.prototype.slice` (as updated with ES6) +- `Array.prototype.splice` (as updated with ES6) +- `Function.prototype.copy` +- `Math.acosh` (as introduced with ES6) +- `Math.atanh` (as introduced with ES6) +- `Math.cbrt` (as introduced with ES6) +- `Math.clz32` (as introduced with ES6) +- `Math.cosh` (as introduced with ES6) +- `Math.expm1` (as introduced with ES6) +- `Math.fround` (as introduced with ES6) +- `Math.hypot` (as introduced with ES6) +- `Math.imul` (as introduced with ES6) +- `Math.log2` (as introduced with ES6) +- `Math.log10` (as introduced with ES6) +- `Math.log1p` (as introduced with ES6) +- `Math.sinh` (as introduced with ES6) +- `Math.tanh` (as introduced with ES6) +- `Math.trunc` (as introduced with ES6) +- `Number.EPSILON` (as introduced with ES6) +- `Number.MIN_SAFE_INTEGER` (as introduced with ES6) +- `Number.MAX_SAFE_INTEGER` (as introduced with ES6) +- `Number.isFinite` (as introduced with ES6) +- `Number.isInteger` (as introduced with ES6) +- `Number.isSafeInteger` (as introduced with ES6) +- `Object.create` (with fix for V8 issue which disallows prototype turn of + objects derived from null +- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero + algorithm +- `Object.firstKey` +- `Object.keys` (as updated with ES6) +- `Object.mixinPrototypes` +- `Object.primitiveSet` +- `Object.setPrototypeOf` (as introduced with ES6) +- `Object.validObject` +- `RegExp.escape` +- `RegExp.prototype.match` (as introduced with ES6) +- `RegExp.prototype.replace` (as introduced with ES6) +- `RegExp.prototype.search` (as introduced with ES6) +- `RegExp.prototype.split` (as introduced with ES6) +- `RegExp.prototype.sticky` (as introduced with ES6) +- `RegExp.prototype.unicode` (as introduced with ES6) +- `String.fromCodePoint` (as introduced with ES6) +- `String.raw` (as introduced with ES6) +- `String.prototype.at` +- `String.prototype.codePointAt` (as introduced with ES6) +- `String.prototype.normalize` (as introduced with ES6) +- `String.prototype.plainReplaceAll` + +Removals: +- `reserved` set +- `Array.prototype.commonLeft` +- `Function.insert` +- `Function.remove` +- `Function.prototype.silent` +- `Function.prototype.wrap` +- `Object.descriptor` Move to external `d` project. + See: https://github.com/medikoo/d +- `Object.diff` +- `Object.extendDeep` +- `Object.reduce` +- `Object.values` +- `String.prototype.trimCommonLeft` + +Renames: +- `Function.i` into `Function.identity` +- `Function.k` into `Function.constant` +- `Number.toInt` into `Number.toInteger` +- `Number.toUint` into `Number.toPosInteger` +- `Object.extend` into `Object.assign` (as introduced in ES 6) +- `Object.extendProperties` into `Object.mixin`, with improved internal + handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6 +- `Object.isList` into `Object.isArrayLike` +- `Object.mapToArray` into `Object.toArray` (with fixed function length) +- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real + use case where we use this function) +- `Function.prototype.chain` into `Function.prototype.compose` +- `Function.prototype.match` into `Function.prototype.spread` +- `String.prototype.format` into `String.formatMethod` + +Improvements & Fixes: +- Remove workaround for primitive values handling in object iterators +- `Array.from`: Update so it follows ES 6 spec +- `Array.prototype.compact`: filters just null and undefined values + (not all falsies) +- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position + handling, improve internals +- `Array.prototype.find`: return undefined not null, in case of not found + (follow ES 6) +- `Array.prototype.remove` fix function length +- `Error.custom`: simplify, Custom class case is addressed by outer + `error-create` project -> https://github.com/medikoo/error-create +- `Error.isError` true only for Error instances (remove detection of host + Exception objects) +- `Number.prototype.pad`: Normalize negative pad +- `Object.clear`: Handle errors same way as in `Object.assign` +- `Object.compact`: filters just null and undefined values (not all falsies) +- `Object.compare`: Take into account NaN values +- `Object.copy`: Split into `Object.copy` and `Object.copyDeep` +- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where + `isCopyDeep` handles nested plain objects and plain arrays only +- `String.prototype.endsWith`: Adjust up to ES6 specification +- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm +- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace` +- `String.prototype.startsWith`: Adjust up to ES6 specification +- Update lint rules, and adjust code to that +- Update Travis CI configuration +- Remove Makefile (it's cross-env utility) + +v0.9.2 -- 2013.03.11 +Added: +* Array.prototype.isCopy +* Array.prototype.isUniq +* Error.CustomError +* Function.validFunction +* Object.extendDeep +* Object.descriptor.binder +* Object.safeTraverse +* RegExp.validRegExp +* String.prototype.capitalize +* String.prototype.simpleReplace + +Fixed: +* Fix Array.prototype.diff for sparse arrays +* Accept primitive objects as input values in Object iteration methods and + Object.clear, Object.count, Object.diff, Object.extend, + Object.getPropertyNames, Object.values +* Pass expected arguments to callbacks of Object.filter, Object.mapKeys, + Object.mapToArray, Object.map +* Improve callable callback support in Object.mapToArray + +v0.9.1 -- 2012.09.17 +* Object.reduce - reduce for hash-like collections +* Accapt any callable object as callback in Object.filter, mapKeys and map +* Convention cleanup + +v0.9.0 -- 2012.09.13 +We're getting to real solid API + +Removed: +* Function#memoize - it's grown up to be external package, to be soon published + as 'memoizee' +* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as + external package +# Function.arguments - obsolete +# Function.context - obsolete +# Function#flip - not readable when used, so it was never used +# Object.clone - obsolete and confusing + +Added: +* String#camelToHyphen - String format convertion + +Renamed: +* String#dashToCamelCase -> String#hyphenToCamel + +Fixes: +* Object.isObject - Quote names in literals that match reserved keywords + (older implementations crashed on that) +* String#repeat - Do not accept negative values (coerce them to 1) + +Improvements: +* Array#remove - Accepts many arguments, we can now remove many values at once +* Object iterators (forEach, map, some) - Compare function invoked with scope + object bound to this +* Function#curry - Algorithm cleanup +* Object.isCopy - Support for all types, not just plain objects +* Object.isPlainObject - Support for cross-frame objects +* Do not memoize any of the functions, it shouldn't be decided internally +* Remove Object.freeze calls in reserved, it's not up to convention +* Improved documentation +* Better linting (hard-core approach using both JSLint mod and JSHint) +* Optional arguments are now documented in funtions signature + +v0.8.2 -- 2012.06.22 +Fix errors in Array's intersection and exclusion methods, related to improper +usage of contains method + +v0.8.1 -- 2012.06.13 +Reorganized internal logic of Function.prototype.memoize. So it's more safe now +and clears cache properly. Additionally preventCache option was provided. + +v0.8.0 -- 2012.05.28 +Again, major overhaul. Probably last experimental stuff was trashed, all API +looks more like standard extensions now. + +Changes: +* Turn all Object.prototype extensions into functions and move them to Object +namespace. We learned that extending Object.prototype is bad idea in any case. +* Rename Function.prototype.curry into Function.prototype.partial. This function + is really doing partial application while currying is slightly different + concept. +* Convert Function.prototype.ncurry to new implementation of + Function.prototype.curry, it now serves real curry concept additionaly it + covers use cases for aritize and hold, which were removed. +* Rename Array's peek to last, and provide support for sparse arrays in it +* Rename Date's monthDaysCount into daysInMonth +* Simplify object iterators, now order of iteration can be configured with just + compareFn argument (no extra byKeys option) +* Rename Object.isDuplicate to Object.isCopy +* Rename Object.isEqual to Object.is which is compatible with future 'is' + keyword +* Function.memoize is now Function.prototype.memoize. Additionally clear cache + functionality is added, and access to original arguments object. +* Rename validation functions: assertNotNull to validValue, assertCallable to + validCallable. validValue was moved to Object namespace. On success they now + return validated value instead of true, it supports better composition. + Additionally created Date.validDate and Error.validError +* All documentation is now held in README.md not in code files. +* Move guid to String namespace. All guids now start with numbers. +* Array.generate: fill argument is now optional +* Object.toArray is now Array.from (as new ES6 specification draft suggests) +* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is) + versions of them (eIndexOf, eLastIndexOf) +* Turn all get* functions that returned methods into actuall methods (get* + functionality can still be achieved with help of Function.prototype.partial). + So: Date.getFormat is now Date.prototype.format, + Number.getPad is now Number.prototype.pad, + String.getFormat is now String.prototype.format, + String.getIndent is now String.prototype.indent, + String.getPad is now String.prototype.pad +* Refactored Object.descriptor, it is now just two functions, main one and + main.gs, main is for describing values, and gs for describing getters and + setters. Configuration is passed with first argument as string e.g. 'ce' for + configurable and enumerable. If no configuration string is provided then by + default it returns configurable and writable but not enumerable for value or + configurable but not enumerable for getter/setter +* Function.prototype.silent now returns prepared function (it was + expected to be fixed for 0.7) +* Reserved keywords map (reserved) is now array not hash. +* Object.merge is now Object.extend (while former Object.extend was completely + removed) - 'extend' implies that we change object, not creating new one (as + 'merge' may imply). Similarily Object.mergeProperties was renamed to + Object.extendProperties +* Position argument support in Array.prototype.contains and + String.prototype.contains (so it follows ES6 specification draft) +* endPosition argument support in String.prototype.endsWith and fromPosition + argument support in String.prototype.startsWith (so it follows ES6 + specification draft) +* Better and cleaner String.prototype.indent implementation. No default value + for indent string argument, optional nest value (defaults to 1), remove + nostart argument +* Correct length values for most methods (so they reflect length of similar + methods in standard) +* Length argument is now optional in number and string pad methods. +* Improve arguments validation in general, so it adheres to standard conventions +* Fixed format of package.json + +Removed methods and functions: +* Object.prototype.slice - Object is not ordered collection, so slice doesn't + make sense. +* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for + that +* Function.prototype.aritize and Function.prototype.hold - same functionality + can be achieved with new Function.prototype.curry +* Function.prototype.log - provided more generic Function.prototype.wrap for + same use case +* getNextIdGenerator - no use case for that (String.guid should be used if + needed) +* Object.toObject - Can be now acheived with Object(validValue(x)) +* Array.prototype.someValue - no real use case (personally used once and + case was already controversial) +* Date.prototype.duration - moved to external package +* Number.getAutoincrement - No real use case +* Object.prototype.extend, Object.prototype.override, + Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably + too complex, same should be achieved just with Object.create, + Object.descriptor and by saving references to super methods in local scope. +* Object.getCompareBy - Functions should be created individually for each use + case +* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and + same can be easily achieved with simple inline function +* String.getPrefixWith - Not real use case for something that can be easily + achieved with '+' operator +* Object.isPrimitive - It's just negation of Object.isObject +* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in + Number namespace and should rather be addressed with simple inline functions. +* Number.prototype.subtract - Should rather be addressed with simple inline + function + +New methods and functions: +* Array.prototype.lastIndex - Returns last declared index in array +* String.prototype.last - last for strings +* Function.prototype.wrap - Wrap function with other, it allows to specify + before and after behavior transform return value or prevent original function + from being called. +* Math.sign - Returns sign of a number (already in ES6 specification draft) +* Number.toInt - Converts value to integer (already in ES6 specification draft) +* Number.isNaN - Returns true if value is NaN (already in ES6 specification + draft) +* Number.toUint - Converts value to unsigned integer +* Number.toUint32 - Converts value to 32bit unsigned integer +* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of + standard methods (all methods that were using native indexOf or lastIndexOf + now uses eIndexOf and elastIndexOf respectively) +* Array.of - as it's specified for ES6 + +Fixes: +* Fixed binarySearch so it always returns valid list index +* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro + engine) +* Object.map now supports third argument for callback + +v0.7.1 -- 2012.01.05 +New methods: +* Array.prototype.firstIndex - returns first valid index of array (for + sparse arrays it may not be '0' + +Improvements: +* Array.prototype.first - now returns value for index returned by firstIndex +* Object.prototype.mapToArray - can be called without callback, then array of + key-value pairs is returned + +Fixes +* Array.prototype.forEachRight, object's length read through UInt32 conversion + +v0.7.0 -- 2011.12.27 +Major update. +Stepped back from experimental ideas and introduced more standard approach +taking example from how ES5 methods and functions are designed. One exceptions +is that, we don’t refrain from declaring methods for Object.prototype - it’s up +to developer whether how he decides to use it in his context (as function or as +method). + +In general: +* Removed any method 'functionalization' and functionalize method itself. + es5-ext declares plain methods, which can be configured to work as functions + with call.bind(method) - see documentation. +* Removed separation of Object methods for ES5 (with descriptors) and + ES3 (plain) - we're following ES5 idea on that, some methods are intended just + for enumerable properties and some are for all properties, all are declared + for Object.prototype +* Removed separation of Array generic (collected in List folder) and not generic + methods (collected in Array folder). Now all methods are generic and are in + Array/prototype folder. This separation also meant, that methods in Array are + usually destructive. We don’t do that separation now, there’s generally no use + case for destructive iterators, we should be fine with one version of each + method, (same as ES5 is fine with e.g. one, non destructive 'filter' method) +* Folder structure resembles tree of native ES5 Objects +* All methods are written with ES5 conventions in mind, it means that most + methods are generic and can be run on any object. In more detail: + ** Array.prototype and Object.prototype methods can be run on any object (any + not null or undefined value), + ** Date.prototype methods should be called only on Date instances. + ** Function.prototype methods can be called on any callable objects (not + necessarily functions) + ** Number.prototype & String.prototype methods can be called on any value, in + case of Number it it’ll be degraded to number, in case of string it’ll be + degraded to string. +* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version) + +Improvements for existing functions and methods: +* Function.memoize (was Function.cache) is now fully generic, can operate on any + type of arguments and it’s NaN safe (all NaN objects are considered equal) +* Method properties passed to Object.prototype.extend or + Object.prototype.override can aside of _super optionally take prototype object + via _proto argument +* Object iterators: forEach, mapToArray and every can now iterate in specified + order +* pluck, invoke and other functions that return reusable functions or methods + have now their results memoized. + +New methods: +* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive, + toObject +* Array: generate +* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first, + forEachRight, group, indexesOf, intersection, remove, someRight, someValue +* Boolean: isBoolean +* Date: isDate +* Function: arguments, context, insert, isArguments, remove +* Function.prototype: not, silent +* Number: getAutoincrement, isNumber +* Number.prototype: isLessOrEqual, isLess, subtract +* Object: assertCallable, descriptor (functions for clean descriptors), + getCompareBy, isCallable, isObject +* Object.prototype: clone (real clone), compact, count, diff, empty, + getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend, + slice, some, unset +* RegExp: isRegExp +* String: getPrefixWith, isString +* String.prototype: caseInsensitiveCompare, contains, isNumeric + +Renamed methods: +* Date.clone -> Date.prototype.copy +* Date.format -> Date.getFormat +* Date/day/floor -> Date.prototype.floorDay +* Date/month/floor -> Date.prototype.floorMonth +* Date/month/year -> Date.prototype.floorYear +* Function.cache -> Function.memoize +* Function.getApplyArg -> Function.prototype.match +* Function.sequence -> Function.prototype.chain +* List.findSameStartLength -> Array.prototype.commonLeft +* Number.pad -> Number.getPad +* Object/plain/clone -> Object.prototype.copy +* Object/plain/elevate -> Object.prototype.flatten +* Object/plain/same -> Object.prototype.isDuplicate +* Object/plain/setValue -> Object.getSet +* String.format -> String.getFormat +* String.indent -> String.getIndent +* String.pad -> String.getPad +* String.trimLeftStr -> String.prototype.trimCommonLeft +* Object.merge -> Object.prototype.mergeProperties +* Object/plain/pluck -> Object.prototype.get +* Array.clone is now Array.prototype.copy and can be used also on any array-like + objects +* List.isList -> Object.isList +* List.toArray -> Object.prototype.toArray +* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase + +Removed methods: +* Array.compact - removed destructive version (that operated on same array), we + have now non destructive version as Array.prototype.compact. +* Function.applyBind -> use apply.bind directly +* Function.bindBind -> use bind.bind directly +* Function.callBind -> use call.bind directly +* Fuction.clone -> no valid use case +* Function.dscope -> controversial approach, shouldn’t be considered seriously +* Function.functionalize -> It was experimental but standards are standards +* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’) +* List.concat -> Concat’s for array-like’s makes no sense, just convert to array + first +* List.every -> Use Array.prototype.every directly +* List.filter -> Use Array.prototype.filter directly +* List.forEach -> User Array.prototype.forEach directly +* List.isListObject -> No valid use case, do: isList(list) && (typeof list === + 'object’) +* List.map -> Use Array.prototype.map directly +* List.reduce -> Use Array.prototype.reduce directly +* List.shiftSame -> Use Array.prototype.commonLeft and do slice +* List.slice -> Use Array.prototype.slice directly +* List.some -> Use Array.prototype.some directly +* Object.bindMethods -> it was version that considered descriptors, we have now + Object.prototype.bindMethods which operates only on enumerable properties +* Object.every -> version that considered all properties, we have now + Object.prototype.every which iterates only enumerables +* Object.invoke -> no use case +* Object.mergeDeep -> no use case +* Object.pluck -> no use case +* Object.same -> it considered descriptors, now there’s only Object.isDuplicate + which compares only enumerable properties +* Object.sameType -> no use case +* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer + Object.descriptor functions +* Object/plain/link -> no use case (it was used internally only by + Object/plain/merge) +* Object/plain/setTrue -> now easily configurable by more universal + Object.getSet(true) +* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be + added + +v0.6.3 -- 2011.12.12 +* Cleared npm warning for misnamed property in package.json + +v0.6.2 -- 2011.08.12 +* Calling String.indent without scope (global scope then) now treated as calling + it with null scope, it allows more direct invocations when using default nest + string: indent().call(str, nest) + +v0.6.1 -- 2011.08.08 +* Added TAD test suite to devDependencies, configured test commands. + Tests can be run with 'make test' or 'npm test' + +v0.6.0 -- 2011.08.07 +New methods: +* Array: clone, compact (in place) +* Date: format, duration, clone, monthDaysCount, day.floor, month.floor, + year.floor +* Function: getApplyArg, , ncurry, rncurry, hold, cache, log +* List: findSameStartLength, shiftSame, peek, isListObject +* Number: pad +* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor, + toDescriptors, invoke +* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format + +Fixed: +* Object.extend does now prototypal extend as exptected +* Object.merge now tries to overwrite only configurable properties +* Function.flip + +Improved: +* Faster List.toArray +* Better global retrieval +* Functionalized all Function methods +* Renamed bindApply and bindCall to applyBind and callBind +* Removed Function.inherit (as it's unintuitive curry clone) +* Straightforward logic in Function.k +* Fixed naming of some tests files (letter case issue) +* Renamed Function.saturate into Function.lock +* String.dashToCamelCase digits support +* Strings now considered as List objects +* Improved List.compact +* Concise logic for List.concat +* Test wit TAD in clean ES5 context + +v0.5.1 -- 2011.07.11 +* Function's bindBind, bindCall and bindApply now more versatile + +v0.5.0 -- 2011.07.07 +* Removed Object.is and List.apply +* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention + consistent) +* Improved documentation + +v0.4.0 -- 2011.07.05 +* Take most functions on Object to Object.plain to keep them away from object + descriptors +* Object functions with ES5 standard in mind (object descriptors) + +v0.3.0 -- 2011.06.24 +* New functions +* Consistent file naming (dash instead of camelCase) + +v0.2.1 -- 2011.05.28 +* Renamed Functions.K and Function.S to to lowercase versions (use consistent + naming) + +v0.2.0 -- 2011.05.28 +* Renamed Array folder to List (as its generic functions for array-like objects) +* Added Makefile +* Added various functions + +v0.1.0 -- 2011.05.24 +* Initial version diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/LICENSE new file mode 100644 index 00000000..89a96eac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2011-2019, Mariusz Nowak, @medikoo, medikoo.com + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/README.md new file mode 100644 index 00000000..968c1e1a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/README.md @@ -0,0 +1,1029 @@ +[![Build status][nix-build-image]][nix-build-url] +[![Windows status][win-build-image]][win-build-url] +![Transpilation status][transpilation-image] +[![npm version][npm-image]][npm-url] + +# es5-ext + +## ECMAScript 5 extensions + +### (with respect to ECMAScript 6 standard) + +Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind. + +It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board. + +When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims. + +### Installation + + $ npm install es5-ext + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +### Usage + +#### ECMAScript 6 features + +You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already). + +```javascript +require("es5-ext/array/from/implement"); +Array.from("foo"); // ['f', 'o', 'o'] +``` + +You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not. + +```javascript +var aFrom = require("es5-ext/array/from"); +aFrom("foo"); // ['f', 'o', 'o'] +``` + +If you want to use shim unconditionally (even if native implementation exists) do: + +```javascript +var aFrom = require("es5-ext/array/from/shim"); +aFrom("foo"); // ['f', 'o', 'o'] +``` + +##### List of ES6 shims + +It's about properties introduced with ES6 and those that have been updated in new spec. + +- `Array.from` -> `require('es5-ext/array/from')` +- `Array.of` -> `require('es5-ext/array/of')` +- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')` +- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')` +- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')` +- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')` +- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')` +- `Array.prototype.find` -> `require('es5-ext/array/#/find')` +- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')` +- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')` +- `Array.prototype.map` -> `require('es5-ext/array/#/map')` +- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')` +- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')` +- `Array.prototype.values` -> `require('es5-ext/array/#/values')` +- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')` +- `Math.acosh` -> `require('es5-ext/math/acosh')` +- `Math.asinh` -> `require('es5-ext/math/asinh')` +- `Math.atanh` -> `require('es5-ext/math/atanh')` +- `Math.cbrt` -> `require('es5-ext/math/cbrt')` +- `Math.clz32` -> `require('es5-ext/math/clz32')` +- `Math.cosh` -> `require('es5-ext/math/cosh')` +- `Math.exmp1` -> `require('es5-ext/math/expm1')` +- `Math.fround` -> `require('es5-ext/math/fround')` +- `Math.hypot` -> `require('es5-ext/math/hypot')` +- `Math.imul` -> `require('es5-ext/math/imul')` +- `Math.log1p` -> `require('es5-ext/math/log1p')` +- `Math.log2` -> `require('es5-ext/math/log2')` +- `Math.log10` -> `require('es5-ext/math/log10')` +- `Math.sign` -> `require('es5-ext/math/sign')` +- `Math.signh` -> `require('es5-ext/math/signh')` +- `Math.tanh` -> `require('es5-ext/math/tanh')` +- `Math.trunc` -> `require('es5-ext/math/trunc')` +- `Number.EPSILON` -> `require('es5-ext/number/epsilon')` +- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')` +- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')` +- `Number.isFinite` -> `require('es5-ext/number/is-finite')` +- `Number.isInteger` -> `require('es5-ext/number/is-integer')` +- `Number.isNaN` -> `require('es5-ext/number/is-nan')` +- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')` +- `Object.assign` -> `require('es5-ext/object/assign')` +- `Object.keys` -> `require('es5-ext/object/keys')` +- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')` +- `Promise.prototype.finally` -> `require('es5-ext/promise/#/finally')` +- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')` +- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')` +- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')` +- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')` +- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')` +- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')` +- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')` +- `String.raw` -> `require('es5-ext/string/raw')` +- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')` +- `String.prototype.contains` -> `require('es5-ext/string/#/contains')` +- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')` +- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')` +- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')` +- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')` +- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')` + +#### Non ECMAScript standard features + +**es5-ext** provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes: + +```javascript +Object.defineProperty(Function.prototype, "partial", { + value: require("es5-ext/function/#/partial"), + configurable: true, + enumerable: false, + writable: true +}); +Object.defineProperty(Array.prototype, "flatten", { + value: require("es5-ext/array/#/flatten"), + configurable: true, + enumerable: false, + writable: true +}); +Object.defineProperty(String.prototype, "capitalize", { + value: require("es5-ext/string/#/capitalize"), + configurable: true, + enumerable: false, + writable: true +}); +``` + +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. + +**Important:** Remember to **not** extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine **only** if you're the _owner_ of the global scope, so e.g. in final project you lead development of. + +When you're in situation when native extensions are not good idea, then you should use methods indirectly: + +```javascript +var flatten = require("es5-ext/array/#/flatten"); + +flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +for better convenience you can turn methods into functions: + +```javascript +var call = Function.prototype.call; +var flatten = call.bind(require("es5-ext/array/#/flatten")); + +flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application + +```javascript +var util = {}; +util.partial = call.bind(require("es5-ext/function/#/partial")); +util.flatten = call.bind(require("es5-ext/array/#/flatten")); +util.startsWith = call.bind(require("es5-ext/string/#/starts-with")); + +util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +As with native ones most methods are generic and can be run on any type of object. + +## API + +### Global extensions + +#### global _(es5-ext/global)_ + +Object that represents global scope + +### Array Constructor extensions + +#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). +Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned. + +#### generate([length[, …fill]]) _(es5-ext/array/generate)_ + +Generate an array of pre-given _length_ built of repeated arguments. + +#### isPlainArray(x) _(es5-ext/array/is-plain-array)_ + +Returns true if object is plain array (not instance of one of the Array's extensions). + +#### of([…items]) _(es5-ext/array/of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). +Create an array from given arguments. + +#### toArray(obj) _(es5-ext/array/to-array)_ + +Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back. + +#### validArray(obj) _(es5-ext/array/valid-array)_ + +Returns `obj` if it's an array, otherwise throws `TypeError` + +### Array Prototype extensions + +#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_ + +In **sorted** list search for index of item for which _compareFn_ returns value closest to _0_. +It's variant of binary search algorithm + +#### arr.clear() _(es5-ext/array/#/clear)_ + +Clears the array + +#### arr.compact() _(es5-ext/array/#/compact)_ + +Returns a copy of the context with all non-values (`null` or `undefined`) removed. + +#### arr.concat() _(es5-ext/array/#/concat)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). +ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context. + +#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_ + +Whether list contains the given value. + +#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). + +#### arr.diff(other) _(es5-ext/array/#/diff)_ + +Returns the array of elements that are present in context list but not present in other list. + +#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_ + +_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_ + +_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.entries() _(es5-ext/array/#/entries)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). +Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value. + +#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_ + +Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments). + +#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). + +#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). +ES6's version of `filter`, returns array of same type as the context. + +#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). +Return first element for which given function returns true + +#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). +Return first index for which given function returns true + +#### arr.first() _(es5-ext/array/#/first)_ + +Returns value for first defined index + +#### arr.firstIndex() _(es5-ext/array/#/first-index)_ + +Returns first declared index of the array + +#### arr.flatten() _(es5-ext/array/#/flatten)_ + +Returns flattened version of the array + +#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_ + +`forEach` starting from last element + +#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_ + +Group list elements by value returned by _cb_ function + +#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_ + +Returns array of all indexes of given value + +#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_ + +Computes the array of values that are the intersection of all lists (context list and lists given in arguments) + +#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_ + +Returns true if both context and _other_ lists have same content + +#### arr.isUniq() _(es5-ext/array/#/is-uniq)_ + +Returns true if all values in array are unique + +#### arr.keys() _(es5-ext/array/#/keys)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). +Returns iterator object, which traverses all array indexes. + +#### arr.last() _(es5-ext/array/#/last)_ + +Returns value of last defined index + +#### arr.lastIndex() _(es5-ext/array/#/last)_ + +Returns last defined index of the array + +#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). +ES6's version of `map`, returns array of same type as the context. + +#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_ + +Remove values from the array + +#### arr.separate(sep) _(es5-ext/array/#/separate)_ + +Returns array with items separated with `sep` value + +#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). +ES6's version of `slice`, returns array of same type as the context. + +#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_ + +`some` starting from last element + +#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). +ES6's version of `splice`, returns array of same type as the context. + +#### arr.uniq() _(es5-ext/array/#/uniq)_ + +Returns duplicate-free version of the array + +#### arr.values() _(es5-ext/array/#/values)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). +Returns iterator object which traverses all array values. + +#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). +Returns iterator object which traverses all array values. + +### Boolean Constructor extensions + +#### isBoolean(x) _(es5-ext/boolean/is-boolean)_ + +Whether value is boolean + +### Date Constructor extensions + +#### isDate(x) _(es5-ext/date/is-date)_ + +Whether value is date instance + +#### validDate(x) _(es5-ext/date/valid-date)_ + +If given object is not date throw TypeError in other case return it. + +### Date Prototype extensions + +#### date.copy(date) _(es5-ext/date/#/copy)_ + +Returns a copy of the date object + +#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_ + +Returns number of days of date's month + +#### date.floorDay() _(es5-ext/date/#/floor-day)_ + +Sets the date time to 00:00:00.000 + +#### date.floorMonth() _(es5-ext/date/#/floor-month)_ + +Sets date day to 1 and date time to 00:00:00.000 + +#### date.floorYear() _(es5-ext/date/#/floor-year)_ + +Sets date month to 0, day to 1 and date time to 00:00:00.000 + +#### date.format(pattern) _(es5-ext/date/#/format)_ + +Formats date up to given string. Supported patterns: + +- `%Y` - Year with century, 1999, 2003 +- `%y` - Year without century, 99, 03 +- `%m` - Month, 01..12 +- `%d` - Day of the month 01..31 +- `%H` - Hour (24-hour clock), 00..23 +- `%M` - Minute, 00..59 +- `%S` - Second, 00..59 +- `%L` - Milliseconds, 000..999 + +### Error Constructor extensions + +#### custom(message/_, code, ext_/) _(es5-ext/error/custom)_ + +Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) + +#### isError(x) _(es5-ext/error/is-error)_ + +Whether value is an error (instance of `Error`). + +#### validError(x) _(es5-ext/error/valid-error)_ + +If given object is not error throw TypeError in other case return it. + +### Error Prototype extensions + +#### err.throw() _(es5-ext/error/#/throw)_ + +Throws error + +### Function Constructor extensions + +Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### constant(x) _(es5-ext/function/constant)_ + +Returns a constant function that returns pregiven argument + +_k(x)(y) =def x_ + +#### identity(x) _(es5-ext/function/identity)_ + +Identity function. Returns first argument + +_i(x) =def x_ + +#### invoke(name[, …args]) _(es5-ext/function/invoke)_ + +Returns a function that takes an object as an argument, and applies object's +_name_ method to arguments. +_name_ can be name of the method or method itself. + +_invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_ + +#### isArguments(x) _(es5-ext/function/is-arguments)_ + +Whether value is arguments object + +#### isFunction(arg) _(es5-ext/function/is-function)_ + +Whether value is instance of function + +#### noop() _(es5-ext/function/noop)_ + +No operation function + +#### pluck(name) _(es5-ext/function/pluck)_ + +Returns a function that takes an object, and returns the value of its _name_ +property + +_pluck(name)(obj) =def obj[name]_ + +#### validFunction(arg) _(es5-ext/function/valid-function)_ + +If given object is not function throw TypeError in other case return it. + +### Function Prototype extensions + +Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### fn.compose([…fns]) _(es5-ext/function/#/compose)_ + +Applies the functions in reverse argument-list order. + +_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_ + +`compose` can also be used in plain function form as: + +_compose(f1, f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_ + +#### fn.copy() _(es5-ext/function/#/copy)_ + +Produces copy of given function + +#### fn.curry([n]) _(es5-ext/function/#/curry)_ + +Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. +If _n_ is not provided then it defaults to context function length + +_f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_ + +#### fn.lock([…args]) _(es5-ext/function/#/lock)_ + +Returns a function that applies the underlying function to _args_, and ignores its own arguments. + +_f.lock(…args)(…args2) =def f(…args)_ + +_Named after it's counterpart in Google Closure_ + +#### fn.not() _(es5-ext/function/#/not)_ + +Returns a function that returns boolean negation of value returned by underlying function. + +_f.not()(…args) =def !f(…args)_ + +#### fn.partial([…args]) _(es5-ext/function/#/partial)_ + +Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args. + +_f.partial(…args1)(…args2) =def f(…args1, …args2)_ + +#### fn.spread() _(es5-ext/function/#/spread)_ + +Returns a function that applies underlying function with first list argument + +_f.match()(args) =def f.apply(null, args)_ + +#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_ + +Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties. + +### Math extensions + +#### acosh(x) _(es5-ext/math/acosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). + +#### asinh(x) _(es5-ext/math/asinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). + +#### atanh(x) _(es5-ext/math/atanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). + +#### cbrt(x) _(es5-ext/math/cbrt)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). + +#### clz32(x) _(es5-ext/math/clz32)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). + +#### cosh(x) _(es5-ext/math/cosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). + +#### expm1(x) _(es5-ext/math/expm1)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). + +#### fround(x) _(es5-ext/math/fround)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). + +#### hypot([…values]) _(es5-ext/math/hypot)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). + +#### imul(x, y) _(es5-ext/math/imul)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). + +#### log1p(x) _(es5-ext/math/log1p)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). + +#### log2(x) _(es5-ext/math/log2)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). + +#### log10(x) _(es5-ext/math/log10)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). + +#### sign(x) _(es5-ext/math/sign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). + +#### sinh(x) _(es5-ext/math/sinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). + +#### tanh(x) _(es5-ext/math/tanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). + +#### trunc(x) _(es5-ext/math/trunc)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). + +### Number Constructor extensions + +#### EPSILON _(es5-ext/number/epsilon)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). + +The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16. + +#### isFinite(x) _(es5-ext/number/is-finite)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). +Whether value is finite. Differs from global isNaN that it doesn't do type coercion. + +#### isInteger(x) _(es5-ext/number/is-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). +Whether value is integer. + +#### isNaN(x) _(es5-ext/number/is-nan)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). +Whether value is NaN. Differs from global isNaN that it doesn't do type coercion. + +#### isNumber(x) _(es5-ext/number/is-number)_ + +Whether given value is number + +#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). + +#### MAX*SAFE_INTEGER *(es5-ext/number/max-safe-integer)\_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). +The value of Number.MAX_SAFE_INTEGER is 9007199254740991. + +#### MIN*SAFE_INTEGER *(es5-ext/number/min-safe-integer)\_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). +The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1). + +#### toInteger(x) _(es5-ext/number/to-integer)_ + +Converts value to integer + +#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_ + +Converts value to positive integer. If provided value is less than 0, then 0 is returned + +#### toUint32(x) _(es5-ext/number/to-uint32)_ + +Converts value to unsigned 32 bit integer. This type is used for array lengths. +See: http://www.2ality.com/2012/02/js-integers.html + +### Number Prototype extensions + +#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_ + +Pad given number with zeros. Returns string + +### Object Constructor extensions + +#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). +Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten. + +#### clear(obj) _(es5-ext/object/clear)_ + +Remove all enumerable own properties of the object + +#### compact(obj) _(es5-ext/object/compact)_ + +Returns copy of the object with all enumerable properties that have no falsy values + +#### compare(obj1, obj2) _(es5-ext/object/compare)_ + +Universal cross-type compare function. To be used for e.g. array sort. + +#### copy(obj) _(es5-ext/object/copy)_ + +Returns copy of the object with all enumerable properties. + +#### copyDeep(obj) _(es5-ext/object/copy-deep)_ + +Returns deep copy of the object with all enumerable properties. + +#### count(obj) _(es5-ext/object/count)_ + +Counts number of enumerable own properties on object + +#### create(obj[, properties]) _(es5-ext/object/create)_ + +`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804). + +When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined. + +It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype. + +Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround. + +#### eq(x, y) _(es5-ext/object/eq)_ + +Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_ + +Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_ + +Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value. + +#### firstKey(obj) _(es5-ext/object/first-key)_ + +Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object. + +#### flatten(obj) _(es5-ext/object/flatten)_ + +Returns new object, with flatten properties of input object + +_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_ + +#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_ + +Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object +Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### getPropertyNames() _(es5-ext/object/get-property-names)_ + +Get all (not just own) property names of the object + +#### is(x, y) _(es5-ext/object/is)_ + +Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### isArrayLike(x) _(es5-ext/object/is-array-like)_ + +Whether object is array-like object + +#### isCopy(x, y) _(es5-ext/object/is-copy)_ + +Two values are considered a copy of same value when all of their own enumerable properties have same values. + +#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_ + +Deep comparision of objects + +#### isEmpty(obj) _(es5-ext/object/is-empty)_ + +True if object doesn't have any own enumerable property + +#### isObject(arg) _(es5-ext/object/is-object)_ + +Whether value is not primitive + +#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_ + +Whether object is plain object, its protototype should be Object.prototype and it cannot be host object. + +#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_ + +Search object for value + +#### keys(obj) _(es5-ext/object/keys)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). +ES6's version of `keys`, doesn't throw on primitive input + +#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_ + +Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object. + +#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_ + +Create new object with same values, but remapped keys + +#### mixin(target, source) _(es5-ext/object/mixin)_ + +Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten). +_It was for a moment part of ECMAScript 6 draft._ + +#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_ + +Extends _target_, with all source and source's prototype properties. +Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support). + +#### normalizeOptions(options) _(es5-ext/object/normalize-options)_ + +Normalizes options object into flat plain object. + +Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use. + +- It never returns input `options` object back (always a copy is created) +- `options` can be undefined in such case empty plain object is returned. +- Copies all enumerable properties found down prototype chain. + +#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_ + +Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true. + +#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_ + +Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator + +#### serialize(value) _(es5-ext/object/serialize)_ + +Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions. + +#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). +If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed. + +#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_ + +Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided +testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_ + +Creates an array of results of calling a provided function on every key-value pair in this object. +Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### unserialize(str) _(es5-ext/object/unserialize)_ + +Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize) + +#### validCallable(x) _(es5-ext/object/valid-callable)_ + +If given object is not callable throw TypeError in other case return it. + +#### validObject(x) _(es5-ext/object/valid-object)_ + +Throws error if given value is not an object, otherwise it is returned. + +#### validValue(x) _(es5-ext/object/valid-value)_ + +Throws error if given value is `null` or `undefined`, otherwise returns value. + +### Promise Prototype extensions + +#### promise.finally(onFinally) _(es5-ext/promise/#/finally)_ + +[_Introduced with ECMAScript 2018_](https://tc39.github.io/ecma262/#sec-promise.prototype.finally). + +### RegExp Constructor extensions + +#### escape(str) _(es5-ext/reg-exp/escape)_ + +Escapes string to be used in regular expression + +#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_ + +Whether object is regular expression + +#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_ + +If object is regular expression it is returned, otherwise TypeError is thrown. + +### RegExp Prototype extensions + +#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_ + +Whether regular expression has `sticky` flag. + +It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented. + +#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_ + +Whether regular expression has `unicode` flag. + +It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented. + +#### re.match(string) _(es5-ext/reg-exp/#/match)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). + +#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). + +#### re.search(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). + +#### re.split(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). + +#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +### String Constructor extensions + +#### formatMethod(fMap) _(es5-ext/string/format-method)_ + +Creates format method. It's used e.g. to create `Date.prototype.format` method + +#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint) + +#### isString(x) _(es5-ext/string/is-string)_ + +Whether object is string + +#### randomUniq() _(es5-ext/string/random-uniq)_ + +Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice) + +#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw) + +### String Prototype extensions + +#### str.at(pos) _(es5-ext/string/#/at)_ + +_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_ + +Returns a string at given position in Unicode-safe manner. +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at). + +#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_ + +Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree. +Useful when converting names from js property convention into filename convention. + +#### str.capitalize() _(es5-ext/string/#/capitalize)_ + +Capitalize first character of a string + +#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_ + +Case insensitive compare + +#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat) + +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt). + +#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains) + +Whether string contains given string. + +#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). +Whether strings ends with given string + +#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_ + +Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree. +Useful when converting names from filename convention to js property name convention. + +#### str.indent(str[, count]) _(es5-ext/string/#/indent)_ + +Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times). + +#### str.last() _(es5-ext/string/#/last)_ + +Return last character + +#### str.normalize([form]) _(es5-ext/string/#/normalize)_ + +[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). +Returns the Unicode Normalization Form of a given string. +Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js) + +#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_ + +Pad string with _fill_. +If _length_ si given than _fill_ is reapated _length_ times. +If _length_ is negative then pad is applied from right. + +#### str.repeat(n) _(es5-ext/string/#/repeat)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). +Repeat given string _n_ times + +#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case). + +#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case). + +#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). +Whether strings starts with given string + +#### str[@@iterator] _(es5-ext/string/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). +Returns iterator object which traverses all string characters (with respect to unicode symbols) + +### Tests + + $ npm test + +[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/es5-ext/branches/master/shields_badge.svg +[nix-build-url]: https://semaphoreci.com/medikoo-org/es5-ext +[win-build-image]: https://ci.appveyor.com/api/projects/status/3jox67ksw3p8hkwh?svg=true +[win-build-url]: https://ci.appveyor.com/project/medikoo/es5-ext +[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg +[npm-image]: https://img.shields.io/npm/v/es5-ext.svg +[npm-url]: https://www.npmjs.com/package/es5-ext diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/implement.js new file mode 100644 index 00000000..8073f2bc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, require("es6-symbol").iterator, { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/index.js new file mode 100644 index 00000000..d9377465 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype[require("es6-symbol").iterator] : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..6445c04e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/is-implemented.js @@ -0,0 +1,16 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function () { + var arr = ["foo", 1], iterator, result; + if (typeof arr[iteratorSymbol] !== "function") return false; + iterator = arr[iteratorSymbol](); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== "foo") return false; + if (result.done !== false) return false; + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/shim.js new file mode 100644 index 00000000..307b1c0a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/@@iterator/shim.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("../values/shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/_compare-by-length.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/_compare-by-length.js new file mode 100644 index 00000000..f1c0cacc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/_compare-by-length.js @@ -0,0 +1,9 @@ +// Used internally to sort array of lists by length + +"use strict"; + +var toPosInt = require("../../number/to-pos-integer"); + +module.exports = function (arr1, arr2) { + return toPosInt(arr1.length) - toPosInt(arr2.length); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/binary-search.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/binary-search.js new file mode 100644 index 00000000..9b2c42ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/binary-search.js @@ -0,0 +1,28 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + + , floor = Math.floor; + +module.exports = function (compareFn) { + var length, low, high, middle; + + value(this); + callable(compareFn); + + length = toPosInt(this.length); + low = 0; + high = length - 1; + + while (low <= high) { + middle = floor((low + high) / 2); + if (compareFn(this[middle]) < 0) high = middle - 1; + else low = middle + 1; + } + + if (high < 0) return 0; + if (high >= length) return length - 1; + return high; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/clear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/clear.js new file mode 100644 index 00000000..fd539c9b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/clear.js @@ -0,0 +1,12 @@ +// Inspired by Google Closure: +// http://closure-library.googlecode.com/svn/docs/ +// closure_goog_array_array.js.html#goog.array.clear + +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function () { + value(this).length = 0; + return this; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/compact.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/compact.js new file mode 100644 index 00000000..3da1309d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/compact.js @@ -0,0 +1,13 @@ +// Inspired by: http://documentcloud.github.com/underscore/#compact + +"use strict"; + +var isValue = require("../../object/is-value"); + +var filter = Array.prototype.filter; + +module.exports = function () { + return filter.call(this, function (val) { + return isValue(val); + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/implement.js new file mode 100644 index 00000000..a5a1a409 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "concat", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/index.js new file mode 100644 index 00000000..8bbb7bc1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.concat : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/is-implemented.js new file mode 100644 index 00000000..2a3a9fc6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { + return (new SubArray()).concat("foo") instanceof SubArray; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/shim.js new file mode 100644 index 00000000..5158dde5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/concat/shim.js @@ -0,0 +1,48 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , toPosInt = require("../../../number/to-pos-integer") + , isObject = require("../../../object/is-object") + , isConcatSpreadable = require("es6-symbol").isConcatSpreadable + , isArray = Array.isArray + , concat = Array.prototype.concat + , forEach = Array.prototype.forEach + , isSpreadable; + +isSpreadable = function (value) { + if (!value) return false; + if (!isObject(value)) return false; + if (value[isConcatSpreadable] !== undefined) { + return Boolean(value[isConcatSpreadable]); + } + return isArray(value); +}; + +// eslint-disable-next-line no-unused-vars +module.exports = function (item /*, …items*/) { + var result; + if (!this || !isArray(this) || isPlainArray(this)) { + return concat.apply(this, arguments); + } + result = new this.constructor(); + if (isSpreadable(this)) { + forEach.call(this, function (val, i) { + result[i] = val; + }); + } else { + result[0] = this; + } + forEach.call(arguments, function (arg) { + var base; + if (isSpreadable(arg)) { + base = result.length; + result.length += toPosInt(arg.length); + forEach.call(arg, function (val, i) { + result[base + i] = val; + }); + return; + } + result.push(arg); + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/contains.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/contains.js new file mode 100644 index 00000000..cde6850e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/contains.js @@ -0,0 +1,7 @@ +"use strict"; + +var indexOf = require("./e-index-of"); + +module.exports = function (searchElement/*, position*/) { + return indexOf.call(this, searchElement, arguments[1]) > -1; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/implement.js new file mode 100644 index 00000000..4658fcb4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "copyWithin", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/index.js new file mode 100644 index 00000000..0919b79b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.copyWithin : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/is-implemented.js new file mode 100644 index 00000000..40c499e6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5]; + if (typeof arr.copyWithin !== "function") return false; + return String(arr.copyWithin(1, 3)) === "1,4,5,4,5"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/shim.js new file mode 100644 index 00000000..aad220ca --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/copy-within/shim.js @@ -0,0 +1,45 @@ +// Taken from: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var toInteger = require("../../../number/to-integer") + , toPosInt = require("../../../number/to-pos-integer") + , validValue = require("../../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty + , max = Math.max + , min = Math.min; + +module.exports = function (target, start /*, end*/) { + var arr = validValue(this) + , end = arguments[2] + , length = toPosInt(arr.length) + , to + , from + , fin + , count + , direction; + + target = toInteger(target); + start = toInteger(start); + end = end === undefined ? length : toInteger(end); + + to = target < 0 ? max(length + target, 0) : min(target, length); + from = start < 0 ? max(length + start, 0) : min(start, length); + fin = end < 0 ? max(length + end, 0) : min(end, length); + count = min(fin - from, length - to); + direction = 1; + + if (from < to && to < from + count) { + direction = -1; + from += count - 1; + to += count - 1; + } + while (count > 0) { + if (objHasOwnProperty.call(arr, from)) arr[to] = arr[from]; + else delete arr[from]; + from += direction; + to += direction; + count -= 1; + } + return arr; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/diff.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/diff.js new file mode 100644 index 00000000..fbb1682b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/diff.js @@ -0,0 +1,13 @@ +"use strict"; + +var value = require("../../object/valid-value") + , contains = require("./contains") + , filter = Array.prototype.filter; + +module.exports = function (other) { + value(this); + value(other); + return filter.call(this, function (item) { + return !contains.call(other, item); + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/e-index-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/e-index-of.js new file mode 100644 index 00000000..8b070117 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/e-index-of.js @@ -0,0 +1,28 @@ +"use strict"; + +var numberIsNaN = require("../../number/is-nan") + , toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , indexOf = Array.prototype.indexOf + , objHasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs + , floor = Math.floor; + +module.exports = function (searchElement /*, fromIndex*/) { + var i, length, fromIndex, val; + if (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments); + + length = toPosInt(value(this).length); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = 0; + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i < length; ++i) { + if (objHasOwnProperty.call(this, i)) { + val = this[i]; + if (numberIsNaN(val)) return i; // Jslint: ignore + } + } + return -1; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/e-last-index-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/e-last-index-of.js new file mode 100644 index 00000000..15dbe05b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/e-last-index-of.js @@ -0,0 +1,31 @@ +"use strict"; + +var numberIsNaN = require("../../number/is-nan") + , toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , lastIndexOf = Array.prototype.lastIndexOf + , objHasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs + , floor = Math.floor; + +module.exports = function (searchElement /*, fromIndex*/) { + var i, fromIndex, val; + if (!numberIsNaN(searchElement)) { + // Jslint: ignore + return lastIndexOf.apply(this, arguments); + } + + value(this); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = toPosInt(this.length) - 1; + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i >= 0; --i) { + if (objHasOwnProperty.call(this, i)) { + val = this[i]; + if (numberIsNaN(val)) return i; // Jslint: ignore + } + } + return -1; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/implement.js new file mode 100644 index 00000000..acc8a111 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "entries", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/index.js new file mode 100644 index 00000000..f18f7d92 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.entries : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/is-implemented.js new file mode 100644 index 00000000..335f1c20 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/is-implemented.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function () { + var arr = [1, "foo"], iterator, result; + if (typeof arr.entries !== "function") return false; + iterator = arr.entries(); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result || !result.value) return false; + if (result.value[0] !== 0) return false; + if (result.value[1] !== 1) return false; + if (result.done !== false) return false; + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/shim.js new file mode 100644 index 00000000..caa45b7a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/entries/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array"); +module.exports = function () { + return new ArrayIterator(this, "key+value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/exclusion.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/exclusion.js new file mode 100644 index 00000000..41057d06 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/exclusion.js @@ -0,0 +1,31 @@ +"use strict"; + +var value = require("../../object/valid-value") + , aFrom = require("../from") + , toArray = require("../to-array") + , contains = require("./contains") + , byLength = require("./_compare-by-length") + , filter = Array.prototype.filter + , push = Array.prototype.push; + +module.exports = function (/* …lists*/) { + var lists, seen, result; + if (!arguments.length) return aFrom(this); + push.apply(lists = [this], arguments); + lists.forEach(value); + seen = []; + result = []; + lists.sort(byLength).forEach(function (list) { + result = result + .filter(function (item) { + return !contains.call(list, item); + }) + .concat( + filter.call(list, function (item) { + return !contains.call(seen, item); + }) + ); + push.apply(seen, toArray(list)); + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/implement.js new file mode 100644 index 00000000..9de58b75 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "fill", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/index.js new file mode 100644 index 00000000..a8272475 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.fill : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/is-implemented.js new file mode 100644 index 00000000..5d6d02e1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.fill !== "function") return false; + return String(arr.fill(-1, -3)) === "1,2,3,-1,-1,-1"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/shim.js new file mode 100644 index 00000000..0040bf81 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/fill/shim.js @@ -0,0 +1,25 @@ +// Taken from: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var toInteger = require("../../../number/to-integer") + , toPosInt = require("../../../number/to-pos-integer") + , validValue = require("../../../object/valid-value") + , max = Math.max + , min = Math.min; + +module.exports = function (value /*, start, end*/) { + var arr = validValue(this) + , start = arguments[1] + , end = arguments[2] + , length = toPosInt(arr.length) + , relativeStart + , i; + + start = start === undefined ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + + relativeStart = start < 0 ? max(length + start, 0) : min(start, length); + for (i = relativeStart; i < length && i < end; ++i) arr[i] = value; + return arr; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/implement.js new file mode 100644 index 00000000..45025751 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "filter", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/index.js new file mode 100644 index 00000000..ad2082d9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.filter : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/is-implemented.js new file mode 100644 index 00000000..06de0996 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/is-implemented.js @@ -0,0 +1,11 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe") + + , pass = function () { + return true; +}; + +module.exports = function () { + return (new SubArray()).filter(pass) instanceof SubArray; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/shim.js new file mode 100644 index 00000000..38304e4b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/filter/shim.js @@ -0,0 +1,23 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , callable = require("../../../object/valid-callable") + , isArray = Array.isArray + , filter = Array.prototype.filter + , forEach = Array.prototype.forEach + , call = Function.prototype.call; + +module.exports = function (callbackFn /*, thisArg*/) { + var result, thisArg, i; + if (!this || !isArray(this) || isPlainArray(this)) { + return filter.apply(this, arguments); + } + callable(callbackFn); + thisArg = arguments[1]; + result = new this.constructor(); + i = 0; + forEach.call(this, function (val, j, self) { + if (call.call(callbackFn, thisArg, val, j, self)) result[i++] = val; + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/implement.js new file mode 100644 index 00000000..4876b9e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "findIndex", + { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/index.js new file mode 100644 index 00000000..3d505b1f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.findIndex : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/is-implemented.js new file mode 100644 index 00000000..818c920e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/is-implemented.js @@ -0,0 +1,11 @@ +"use strict"; + +var fn = function (value) { + return value > 3; +}; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.findIndex !== "function") return false; + return arr.findIndex(fn) === 3; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/shim.js new file mode 100644 index 00000000..bc82827a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find-index/shim.js @@ -0,0 +1,26 @@ +"use strict"; + +var callable = require("../../../object/valid-callable") + , ensureValue = require("../../../object/valid-value") + , some = Array.prototype.some + , apply = Function.prototype.apply; + +module.exports = function (predicate /*, thisArg*/) { + var k, self; + self = Object(ensureValue(this)); + callable(predicate); + + return some.call( + self, + function (value, index) { + if (apply.call(predicate, this, arguments)) { + k = index; + return true; + } + return false; + }, + arguments[1] + ) + ? k + : -1; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/implement.js new file mode 100644 index 00000000..d8ebc5b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "find", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/index.js new file mode 100644 index 00000000..131a71be --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.find : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/is-implemented.js new file mode 100644 index 00000000..aa278a7b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/is-implemented.js @@ -0,0 +1,11 @@ +"use strict"; + +var fn = function (value) { + return value > 3; +}; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.find !== "function") return false; + return arr.find(fn) === 4; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/shim.js new file mode 100644 index 00000000..c45a9380 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/find/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +var findIndex = require("../find-index/shim"); + +// eslint-disable-next-line no-unused-vars +module.exports = function (predicate /*, thisArg*/) { + var index = findIndex.apply(this, arguments); + return index === -1 ? undefined : this[index]; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/first-index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/first-index.js new file mode 100644 index 00000000..19bff541 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/first-index.js @@ -0,0 +1,15 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var i, length; + if (!(length = toPosInt(value(this).length))) return null; + i = 0; + while (!objHasOwnProperty.call(this, i)) { + if (++i === length) return null; + } + return i; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/first.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/first.js new file mode 100644 index 00000000..ca76833b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/first.js @@ -0,0 +1,9 @@ +"use strict"; + +var firstIndex = require("./first-index"); + +module.exports = function () { + var i; + if ((i = firstIndex.call(this)) !== null) return this[i]; + return undefined; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/flatten.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/flatten.js new file mode 100644 index 00000000..40167274 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/flatten.js @@ -0,0 +1,40 @@ +// Stack grow safe implementation + +"use strict"; + +var ensureValue = require("../../object/valid-value") + , isArray = Array.isArray + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var input = ensureValue(this), index = 0, remaining, remainingIndexes, length, i, result = []; + // Jslint: ignore + main: while (input) { + length = input.length; + for (i = index; i < length; ++i) { + if (!objHasOwnProperty.call(input, i)) continue; + if (isArray(input[i])) { + if (i < length - 1) { + // eslint-disable-next-line max-depth + if (!remaining) { + remaining = []; + remainingIndexes = []; + } + remaining.push(input); + remainingIndexes.push(i + 1); + } + input = input[i]; + index = 0; + continue main; + } + result.push(input[i]); + } + if (remaining) { + input = remaining.pop(); + index = remainingIndexes.pop(); + } else { + input = null; + } + } + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/for-each-right.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/for-each-right.js new file mode 100644 index 00000000..ebf076b1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/for-each-right.js @@ -0,0 +1,19 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb /*, thisArg*/) { + var i, self, thisArg; + + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = toPosInt(self.length) - 1; i >= 0; --i) { + if (objHasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/group.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/group.js new file mode 100644 index 00000000..711eb586 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/group.js @@ -0,0 +1,28 @@ +// Inspired by Underscore's groupBy: +// http://documentcloud.github.com/underscore/#groupBy + +"use strict"; + +var callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + , forEach = Array.prototype.forEach + , apply = Function.prototype.apply; + +module.exports = function (cb /*, thisArg*/) { + var result; + + value(this); + callable(cb); + + result = Object.create(null); + forEach.call( + this, + function (item) { + var key = apply.call(cb, this, arguments); + if (!result[key]) result[key] = []; + result[key].push(item); + }, + arguments[1] + ); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/index.js new file mode 100644 index 00000000..596e83b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/index.js @@ -0,0 +1,41 @@ +"use strict"; + +module.exports = { + "@@iterator": require("./@@iterator"), + "binarySearch": require("./binary-search"), + "clear": require("./clear"), + "compact": require("./compact"), + "concat": require("./concat"), + "contains": require("./contains"), + "copyWithin": require("./copy-within"), + "diff": require("./diff"), + "eIndexOf": require("./e-index-of"), + "eLastIndexOf": require("./e-last-index-of"), + "entries": require("./entries"), + "exclusion": require("./exclusion"), + "fill": require("./fill"), + "filter": require("./filter"), + "find": require("./find"), + "findIndex": require("./find-index"), + "first": require("./first"), + "firstIndex": require("./first-index"), + "flatten": require("./flatten"), + "forEachRight": require("./for-each-right"), + "keys": require("./keys"), + "group": require("./group"), + "indexesOf": require("./indexes-of"), + "intersection": require("./intersection"), + "isCopy": require("./is-copy"), + "isEmpty": require("./is-empty"), + "isUniq": require("./is-uniq"), + "last": require("./last"), + "lastIndex": require("./last-index"), + "map": require("./map"), + "remove": require("./remove"), + "separate": require("./separate"), + "slice": require("./slice"), + "someRight": require("./some-right"), + "splice": require("./splice"), + "uniq": require("./uniq"), + "values": require("./values") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/indexes-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/indexes-of.js new file mode 100644 index 00000000..6c39cd92 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/indexes-of.js @@ -0,0 +1,12 @@ +"use strict"; + +var indexOf = require("./e-index-of"); + +module.exports = function (value /*, fromIndex*/) { + var result = [], i, fromIndex = arguments[1]; + while ((i = indexOf.call(this, value, fromIndex)) !== -1) { + result.push(i); + fromIndex = i + 1; + } + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/intersection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/intersection.js new file mode 100644 index 00000000..91261d5f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/intersection.js @@ -0,0 +1,21 @@ +"use strict"; + +var value = require("../../object/valid-value") + , contains = require("./contains") + , byLength = require("./_compare-by-length") + , filter = Array.prototype.filter + , push = Array.prototype.push + , slice = Array.prototype.slice; + +module.exports = function (/* …list*/) { + var lists; + if (!arguments.length) slice.call(this); + push.apply(lists = [this], arguments); + lists.forEach(value); + lists.sort(byLength); + return lists.reduce(function (list1, list2) { + return filter.call(list1, function (item) { + return contains.call(list2, item); + }); + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-copy.js new file mode 100644 index 00000000..1413b95d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-copy.js @@ -0,0 +1,21 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , eq = require("../../object/eq") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (other) { + var i, length; + value(this); + value(other); + length = toPosInt(this.length); + if (length !== toPosInt(other.length)) return false; + for (i = 0; i < length; ++i) { + if (objHasOwnProperty.call(this, i) !== objHasOwnProperty.call(other, i)) { + return false; + } + if (!eq(this[i], other[i])) return false; + } + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-empty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-empty.js new file mode 100644 index 00000000..80a30695 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-empty.js @@ -0,0 +1,8 @@ +"use strict"; + +var ensureArray = require("../../object/ensure-array") + , firstIndex = require("./first-index"); + +module.exports = function () { + return firstIndex.call(ensureArray(this)) === null; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-uniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-uniq.js new file mode 100644 index 00000000..148a5a91 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/is-uniq.js @@ -0,0 +1,14 @@ +"use strict"; + +var indexOf = require("./e-index-of") + + , every = Array.prototype.every + , isFirst; + +isFirst = function (value, index) { + return indexOf.call(this, value) === index; +}; + +module.exports = function () { + return every.call(this, isFirst, this); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/implement.js new file mode 100644 index 00000000..40d0df01 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "keys", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/index.js new file mode 100644 index 00000000..50a18f19 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.keys : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/is-implemented.js new file mode 100644 index 00000000..70a171f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/is-implemented.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function () { + var arr = [1, "foo"], iterator, result; + if (typeof arr.keys !== "function") return false; + iterator = arr.keys(); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== 0) return false; + if (result.done !== false) return false; + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/shim.js new file mode 100644 index 00000000..c3c68c6d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/keys/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array"); +module.exports = function () { + return new ArrayIterator(this, "key"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/last-index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/last-index.js new file mode 100644 index 00000000..74aaba46 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/last-index.js @@ -0,0 +1,15 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var i, length; + if (!(length = toPosInt(value(this).length))) return null; + i = length - 1; + while (!objHasOwnProperty.call(this, i)) { + if (--i === -1) return null; + } + return i; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/last.js new file mode 100644 index 00000000..38bb359b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/last.js @@ -0,0 +1,9 @@ +"use strict"; + +var lastIndex = require("./last-index"); + +module.exports = function () { + var i; + if ((i = lastIndex.call(this)) !== null) return this[i]; + return undefined; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/implement.js new file mode 100644 index 00000000..a6d1d900 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "map", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/index.js new file mode 100644 index 00000000..101c0649 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.map : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/is-implemented.js new file mode 100644 index 00000000..24ab9084 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var identity = require("../../../function/identity") + , SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { + return (new SubArray()).map(identity) instanceof SubArray; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/shim.js new file mode 100644 index 00000000..6d8cc1fb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/map/shim.js @@ -0,0 +1,21 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , callable = require("../../../object/valid-callable") + + , isArray = Array.isArray, map = Array.prototype.map + , forEach = Array.prototype.forEach, call = Function.prototype.call; + +module.exports = function (callbackFn/*, thisArg*/) { + var result, thisArg; + if (!this || !isArray(this) || isPlainArray(this)) { + return map.apply(this, arguments); + } + callable(callbackFn); + thisArg = arguments[1]; + result = new this.constructor(this.length); + forEach.call(this, function (val, i, self) { + result[i] = call.call(callbackFn, thisArg, val, i, self); + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/remove.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/remove.js new file mode 100644 index 00000000..6a8a0867 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/remove.js @@ -0,0 +1,17 @@ +"use strict"; + +var indexOf = require("./e-index-of") + , forEach = Array.prototype.forEach + , splice = Array.prototype.splice; + +// eslint-disable-next-line no-unused-vars +module.exports = function (itemToRemove /*, …item*/) { + forEach.call( + arguments, + function (item) { + var index = indexOf.call(this, item); + if (index !== -1) splice.call(this, index, 1); + }, + this + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/separate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/separate.js new file mode 100644 index 00000000..35e1cc5a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/separate.js @@ -0,0 +1,12 @@ +"use strict"; + +var forEach = Array.prototype.forEach; + +module.exports = function (sep) { + var result = []; + forEach.call(this, function (val) { + result.push(val, sep); + }); + result.pop(); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/implement.js new file mode 100644 index 00000000..568e87a1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "slice", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/index.js new file mode 100644 index 00000000..c80ee359 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.slice : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/is-implemented.js new file mode 100644 index 00000000..47904c20 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { + return (new SubArray()).slice() instanceof SubArray; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/shim.js new file mode 100644 index 00000000..ff13085b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/slice/shim.js @@ -0,0 +1,36 @@ +"use strict"; + +var toInteger = require("../../../number/to-integer") + , toPosInt = require("../../../number/to-pos-integer") + , isPlainArray = require("../../is-plain-array") + , isArray = Array.isArray + , slice = Array.prototype.slice + , objHasOwnProperty = Object.prototype.hasOwnProperty + , max = Math.max; + +module.exports = function (start, end) { + var length, result, i; + if (!this || !isArray(this) || isPlainArray(this)) { + return slice.apply(this, arguments); + } + length = toPosInt(this.length); + start = toInteger(start); + if (start < 0) start = max(length + start, 0); + else if (start > length) start = length; + if (end === undefined) { + end = length; + } else { + end = toInteger(end); + if (end < 0) end = max(length + end, 0); + else if (end > length) end = length; + } + if (start > end) start = end; + result = new this.constructor(end - start); + i = 0; + while (start !== end) { + if (objHasOwnProperty.call(this, start)) result[i] = this[start]; + ++i; + ++start; + } + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/some-right.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/some-right.js new file mode 100644 index 00000000..d9a665fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/some-right.js @@ -0,0 +1,21 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , value = require("../../object/valid-value") + , objHasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb /*, thisArg*/) { + var i, self, thisArg; + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = toPosInt(self.length) - 1; i >= 0; --i) { + if (objHasOwnProperty.call(self, i) && call.call(cb, thisArg, self[i], i, self)) { + return true; + } + } + return false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/implement.js new file mode 100644 index 00000000..1e1682b0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "splice", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/index.js new file mode 100644 index 00000000..e5fda951 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.prototype.splice : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/is-implemented.js new file mode 100644 index 00000000..afbb95a6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +var SubArray = require("../../_sub-array-dummy-safe"); + +module.exports = function () { + return (new SubArray()).splice(0) instanceof SubArray; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/shim.js new file mode 100644 index 00000000..dc8d837b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/splice/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var isPlainArray = require("../../is-plain-array") + , isArray = Array.isArray + , splice = Array.prototype.splice + , forEach = Array.prototype.forEach; + +// eslint-disable-next-line no-unused-vars +module.exports = function (start, deleteCount /*, …items*/) { + var arr = splice.apply(this, arguments), result; + if (!this || !isArray(this) || isPlainArray(this)) return arr; + result = new this.constructor(arr.length); + forEach.call(arr, function (val, i) { + result[i] = val; + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/uniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/uniq.js new file mode 100644 index 00000000..944ce933 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/uniq.js @@ -0,0 +1,15 @@ +"use strict"; + +var indexOf = require("./e-index-of") + + , filter = Array.prototype.filter + + , isFirst; + +isFirst = function (value, index) { + return indexOf.call(this, value) === index; +}; + +module.exports = function () { + return filter.call(this, isFirst, this); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/implement.js new file mode 100644 index 00000000..b43e9f64 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array.prototype, "values", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/index.js new file mode 100644 index 00000000..30a50bae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Array.prototype.values : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/is-implemented.js new file mode 100644 index 00000000..8b72568a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/is-implemented.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function () { + var arr = ["foo", 1], iterator, result; + if (typeof arr.values !== "function") return false; + iterator = arr.values(); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== "foo") return false; + if (result.done !== false) return false; + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/shim.js new file mode 100644 index 00000000..e46a0526 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/#/values/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array"); +module.exports = function () { + return new ArrayIterator(this, "value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_is-extensible.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_is-extensible.js new file mode 100644 index 00000000..a9e8ee79 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_is-extensible.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = (function () { + var SubArray = require("./_sub-array-dummy"), arr; + + if (!SubArray) return false; + arr = new SubArray(); + if (!Array.isArray(arr)) return false; + if (!(arr instanceof SubArray)) return false; + + arr[34] = "foo"; + return arr.length === 35; +}()); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_sub-array-dummy-safe.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_sub-array-dummy-safe.js new file mode 100644 index 00000000..80e3b3c5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_sub-array-dummy-safe.js @@ -0,0 +1,25 @@ +"use strict"; + +var setPrototypeOf = require("../object/set-prototype-of") + , isExtensible = require("./_is-extensible"); + +module.exports = (function () { + var SubArray; + + if (isExtensible) return require("./_sub-array-dummy"); + + if (!setPrototypeOf) return null; + SubArray = function () { + var arr = Array.apply(this, arguments); + setPrototypeOf(arr, SubArray.prototype); + return arr; + }; + setPrototypeOf(SubArray, Array); + SubArray.prototype = Object.create(Array.prototype, { + constructor: { value: SubArray, +enumerable: false, +writable: true, + configurable: true } + }); + return SubArray; +}()); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_sub-array-dummy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_sub-array-dummy.js new file mode 100644 index 00000000..cf111522 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/_sub-array-dummy.js @@ -0,0 +1,20 @@ +"use strict"; + +var setPrototypeOf = require("../object/set-prototype-of"); + +module.exports = (function () { + var SubArray; + + if (!setPrototypeOf) return null; + SubArray = function () { + Array.apply(this, arguments); +}; + setPrototypeOf(SubArray, Array); + SubArray.prototype = Object.create(Array.prototype, { + constructor: { value: SubArray, +enumerable: false, +writable: true, + configurable: true } + }); + return SubArray; +}()); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/implement.js new file mode 100644 index 00000000..41172242 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array, "from", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/index.js new file mode 100644 index 00000000..ca4492d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.from + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/is-implemented.js new file mode 100644 index 00000000..3567c876 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function () { + var from = Array.from, arr, result; + if (typeof from !== "function") return false; + arr = ["raz", "dwa"]; + result = from(arr); + return Boolean(result && (result !== arr) && (result[1] === "dwa")); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/shim.js new file mode 100644 index 00000000..8e3581db --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/from/shim.js @@ -0,0 +1,119 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , isArguments = require("../../function/is-arguments") + , isFunction = require("../../function/is-function") + , toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , validValue = require("../../object/valid-value") + , isValue = require("../../object/is-value") + , isString = require("../../string/is-string") + , isArray = Array.isArray + , call = Function.prototype.call + , desc = { configurable: true, enumerable: true, writable: true, value: null } + , defineProperty = Object.defineProperty; + +// eslint-disable-next-line complexity, max-lines-per-function +module.exports = function (arrayLike /*, mapFn, thisArg*/) { + var mapFn = arguments[1] + , thisArg = arguments[2] + , Context + , i + , j + , arr + , length + , code + , iterator + , result + , getIterator + , value; + + arrayLike = Object(validValue(arrayLike)); + + if (isValue(mapFn)) callable(mapFn); + if (!this || this === Array || !isFunction(this)) { + // Result: Plain array + if (!mapFn) { + if (isArguments(arrayLike)) { + // Source: Arguments + length = arrayLike.length; + if (length !== 1) return Array.apply(null, arrayLike); + arr = new Array(1); + arr[0] = arrayLike[0]; + return arr; + } + if (isArray(arrayLike)) { + // Source: Array + arr = new Array(length = arrayLike.length); + for (i = 0; i < length; ++i) arr[i] = arrayLike[i]; + return arr; + } + } + arr = []; + } else { + // Result: Non plain array + Context = this; + } + + if (!isArray(arrayLike)) { + if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) { + // Source: Iterator + iterator = callable(getIterator).call(arrayLike); + if (Context) arr = new Context(); + result = iterator.next(); + i = 0; + while (!result.done) { + value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + result = iterator.next(); + ++i; + } + length = i; + } else if (isString(arrayLike)) { + // Source: String + length = arrayLike.length; + if (Context) arr = new Context(); + for (i = 0, j = 0; i < length; ++i) { + value = arrayLike[i]; + if (i + 1 < length) { + code = value.charCodeAt(0); + // eslint-disable-next-line max-depth + if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i]; + } + value = mapFn ? call.call(mapFn, thisArg, value, j) : value; + if (Context) { + desc.value = value; + defineProperty(arr, j, desc); + } else { + arr[j] = value; + } + ++j; + } + length = j; + } + } + if (length === undefined) { + // Source: array or array-like + length = toPosInt(arrayLike.length); + if (Context) arr = new Context(length); + for (i = 0; i < length; ++i) { + value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; + if (Context) { + desc.value = value; + defineProperty(arr, i, desc); + } else { + arr[i] = value; + } + } + } + if (Context) { + desc.value = null; + arr.length = length; + } + return arr; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/generate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/generate.js new file mode 100644 index 00000000..42b69303 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/generate.js @@ -0,0 +1,18 @@ +"use strict"; + +var toPosInt = require("../number/to-pos-integer") + , value = require("../object/valid-value") + , slice = Array.prototype.slice; + +module.exports = function (length /*, …fill*/) { + var arr, currentLength; + length = toPosInt(value(length)); + if (length === 0) return []; + + arr = arguments.length < 2 ? [undefined] : slice.call(arguments, 1, 1 + length); + + while ((currentLength = arr.length) < length) { + arr = arr.concat(arr.slice(0, length - currentLength)); + } + return arr; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/index.js new file mode 100644 index 00000000..49ff58ee --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/index.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "from": require("./from"), + "generate": require("./generate"), + "isPlainArray": require("./is-plain-array"), + "of": require("./of"), + "toArray": require("./to-array"), + "validArray": require("./valid-array") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/is-plain-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/is-plain-array.js new file mode 100644 index 00000000..ca3d25bb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/is-plain-array.js @@ -0,0 +1,11 @@ +"use strict"; + +var isArray = Array.isArray, getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (obj) { + var proto; + if (!obj || !isArray(obj)) return false; + proto = getPrototypeOf(obj); + if (!isArray(proto)) return false; + return !isArray(getPrototypeOf(proto)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/implement.js new file mode 100644 index 00000000..92f8f3e3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Array, "of", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/index.js new file mode 100644 index 00000000..43ab3f62 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Array.of + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/is-implemented.js new file mode 100644 index 00000000..20b80c20 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function () { + var of = Array.of, result; + if (typeof of !== "function") return false; + result = of("foo", "bar"); + return Boolean(result && (result[1] === "bar")); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/shim.js new file mode 100644 index 00000000..6cc9c383 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/of/shim.js @@ -0,0 +1,19 @@ +"use strict"; + +var isFunction = require("../../function/is-function") + , slice = Array.prototype.slice + , defineProperty = Object.defineProperty + , desc = { configurable: true, enumerable: true, writable: true, value: null }; + +module.exports = function (/* …items*/) { + var result, i, length; + if (!this || this === Array || !isFunction(this)) return slice.call(arguments); + result = new this(length = arguments.length); + for (i = 0; i < length; ++i) { + desc.value = arguments[i]; + defineProperty(result, i, desc); + } + desc.value = null; + result.length = length; + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/to-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/to-array.js new file mode 100644 index 00000000..2078b7a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/to-array.js @@ -0,0 +1,9 @@ +"use strict"; + +var from = require("./from") + + , isArray = Array.isArray; + +module.exports = function (arrayLike) { + return isArray(arrayLike) ? arrayLike : from(arrayLike); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/valid-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/valid-array.js new file mode 100644 index 00000000..1e58c39a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/array/valid-array.js @@ -0,0 +1,8 @@ +"use strict"; + +var isArray = Array.isArray; + +module.exports = function (value) { + if (isArray(value)) return value; + throw new TypeError(value + " is not an array"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/boolean/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/boolean/index.js new file mode 100644 index 00000000..ffd3fd25 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/boolean/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + isBoolean: require("./is-boolean") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/boolean/is-boolean.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/boolean/is-boolean.js new file mode 100644 index 00000000..394845f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/boolean/is-boolean.js @@ -0,0 +1,10 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(true); + +module.exports = function (value) { + return ( + typeof value === "boolean" || + (typeof value === "object" && (value instanceof Boolean || objToString.call(value) === id)) + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/copy.js new file mode 100644 index 00000000..9638a653 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/copy.js @@ -0,0 +1,7 @@ +"use strict"; + +var getTime = Date.prototype.getTime; + +module.exports = function () { + return new Date(getTime.call(this)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/days-in-month.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/days-in-month.js new file mode 100644 index 00000000..8e8ca4d4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/days-in-month.js @@ -0,0 +1,17 @@ +"use strict"; + +var getMonth = Date.prototype.getMonth; + +module.exports = function () { + switch (getMonth.call(this)) { + case 1: + return this.getFullYear() % 4 ? 28 : 29; + case 3: + case 5: + case 8: + case 10: + return 30; + default: + return 31; + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-day.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-day.js new file mode 100644 index 00000000..db696d38 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-day.js @@ -0,0 +1,8 @@ +"use strict"; + +var setHours = Date.prototype.setHours; + +module.exports = function () { + setHours.call(this, 0, 0, 0, 0); + return this; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-month.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-month.js new file mode 100644 index 00000000..c9c0460b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-month.js @@ -0,0 +1,8 @@ +"use strict"; + +var floorDay = require("./floor-day"); + +module.exports = function () { + floorDay.call(this).setDate(1); + return this; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-year.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-year.js new file mode 100644 index 00000000..e9b6f0fe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/floor-year.js @@ -0,0 +1,8 @@ +"use strict"; + +var floorMonth = require("./floor-month"); + +module.exports = function () { + floorMonth.call(this).setMonth(0); + return this; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/format.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/format.js new file mode 100644 index 00000000..519d77c4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/format.js @@ -0,0 +1,38 @@ +/* eslint id-length: "off" */ + +"use strict"; + +var pad = require("../../number/#/pad") + , date = require("../valid-date") + , format; + +format = require("../../string/format-method")({ + Y: function () { + return String(this.getFullYear()); + }, + y: function () { + return String(this.getFullYear()).slice(-2); + }, + m: function () { + return pad.call(this.getMonth() + 1, 2); + }, + d: function () { + return pad.call(this.getDate(), 2); + }, + H: function () { + return pad.call(this.getHours(), 2); + }, + M: function () { + return pad.call(this.getMinutes(), 2); + }, + S: function () { + return pad.call(this.getSeconds(), 2); + }, + L: function () { + return pad.call(this.getMilliseconds(), 3); + } +}); + +module.exports = function (pattern) { + return format.call(date(this), pattern); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/index.js new file mode 100644 index 00000000..1781e218 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/#/index.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = { + copy: require("./copy"), + daysInMonth: require("./days-in-month"), + floorDay: require("./floor-day"), + floorMonth: require("./floor-month"), + floorYear: require("./floor-year"), + format: require("./format") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/ensure-time-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/ensure-time-value.js new file mode 100644 index 00000000..09f5afcf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/ensure-time-value.js @@ -0,0 +1,10 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , toInteger = require("../number/to-integer") + , isTimeValue = require("./is-time-value"); + +module.exports = function (value) { + if (isTimeValue(value)) return toInteger(value); + throw new TypeError(safeToString(value) + " is not a valid time value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/index.js new file mode 100644 index 00000000..c1431497 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/index.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "ensureTimeValue": require("./ensure-time-value"), + "isDate": require("./is-date"), + "isTimeValue": require("./is-time-value"), + "validDate": require("./valid-date") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/is-date.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/is-date.js new file mode 100644 index 00000000..f45bde46 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/is-date.js @@ -0,0 +1,10 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(new Date()); + +module.exports = function (value) { + return ( + (value && !isNaN(value) && (value instanceof Date || objToString.call(value) === id)) || + false + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/is-time-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/is-time-value.js new file mode 100644 index 00000000..0deb0b97 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/is-time-value.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (value) { + try { value = Number(value); } + catch (e) { return false; } + if (isNaN(value)) return false; + if (Math.abs(value) > 8.64e15) return false; + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/valid-date.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/valid-date.js new file mode 100644 index 00000000..0c73dc5d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/date/valid-date.js @@ -0,0 +1,8 @@ +"use strict"; + +var isDate = require("./is-date"); + +module.exports = function (value) { + if (!isDate(value)) throw new TypeError(value + " is not valid Date object"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/#/index.js new file mode 100644 index 00000000..ac9a4306 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/#/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + throw: require("./throw") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/#/throw.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/#/throw.js new file mode 100644 index 00000000..3fe6bb4c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/#/throw.js @@ -0,0 +1,7 @@ +"use strict"; + +var error = require("../valid-error"); + +module.exports = function () { + throw error(this); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/custom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/custom.js new file mode 100644 index 00000000..0e4c8cb1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/custom.js @@ -0,0 +1,20 @@ +"use strict"; + +var assign = require("../object/assign") + , isObject = require("../object/is-object") + , isValue = require("../object/is-value") + , captureStackTrace = Error.captureStackTrace; + +exports = module.exports = function (message /*, code, ext*/) { + var err = new Error(message), code = arguments[1], ext = arguments[2]; + if (!isValue(ext)) { + if (isObject(code)) { + ext = code; + code = null; + } + } + if (isValue(ext)) assign(err, ext); + if (isValue(code)) err.code = code; + if (captureStackTrace) captureStackTrace(err, exports); + return err; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/index.js new file mode 100644 index 00000000..cb7054a2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "custom": require("./custom"), + "isError": require("./is-error"), + "validError": require("./valid-error") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/is-error.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/is-error.js new file mode 100644 index 00000000..aad67ed9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/is-error.js @@ -0,0 +1,7 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(new Error()); + +module.exports = function (value) { + return (value && (value instanceof Error || objToString.call(value) === id)) || false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/valid-error.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/valid-error.js new file mode 100644 index 00000000..432f7ba2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/error/valid-error.js @@ -0,0 +1,8 @@ +"use strict"; + +var isError = require("./is-error"); + +module.exports = function (value) { + if (!isError(value)) throw new TypeError(value + " is not an Error object"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/compose.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/compose.js new file mode 100644 index 00000000..c1d37b4b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/compose.js @@ -0,0 +1,20 @@ +"use strict"; + +var isValue = require("../../object/is-value") + , callable = require("../../object/valid-callable") + , aFrom = require("../../array/from"); + +var apply = Function.prototype.apply + , call = Function.prototype.call + , callFn = function (arg, fn) { return call.call(fn, this, arg); }; + +module.exports = function (fnIgnored/*, …fnn*/) { + var fns, first; + var args = aFrom(arguments); + fns = isValue(this) ? [this].concat(args) : args; + fns.forEach(callable); + fns = fns.reverse(); + first = fns[0]; + fns = fns.slice(1); + return function (argIgnored) { return fns.reduce(callFn, apply.call(first, this, arguments)); }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/copy.js new file mode 100644 index 00000000..f0403b30 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/copy.js @@ -0,0 +1,23 @@ +"use strict"; + +var mixin = require("../../object/mixin") + , validFunction = require("../valid-function") + , re = /^\s*function\s*([\0-')-\uffff]+)*\s*\(([\0-(*-\uffff]*)\)\s*\{/; + +module.exports = function () { + var match = String(validFunction(this)).match(re), fn; + + // eslint-disable-next-line no-new-func + fn = new Function( + "fn", + "return function " + + match[1].trim() + + "(" + + match[2] + + ") { return fn.apply(this, arguments); };" + )(this); + try { + mixin(fn, this); + } catch (ignore) {} + return fn; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/curry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/curry.js new file mode 100644 index 00000000..cc1e14a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/curry.js @@ -0,0 +1,24 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , callable = require("../../object/valid-callable") + , defineLength = require("../_define-length") + + , slice = Array.prototype.slice, apply = Function.prototype.apply + , curry; + +curry = function self(fn, length, preArgs) { + return defineLength(function () { + var args = preArgs + ? preArgs.concat(slice.call(arguments, 0, length - preArgs.length)) + : slice.call(arguments, 0, length); + return args.length === length ? apply.call(fn, this, args) + : self(fn, length, args); + }, preArgs ? length - preArgs.length : length); +}; + +module.exports = function (/* Length*/) { + var length = arguments[0]; + return curry(callable(this), + isNaN(length) ? toPosInt(this.length) : toPosInt(length)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/index.js new file mode 100644 index 00000000..02ae9f49 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/index.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = { + compose: require("./compose"), + copy: require("./copy"), + curry: require("./curry"), + lock: require("./lock"), + microtaskDelay: require("./microtask-delay"), + not: require("./not"), + partial: require("./partial"), + spread: require("./spread"), + toStringTokens: require("./to-string-tokens") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/lock.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/lock.js new file mode 100644 index 00000000..dcd93bb1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/lock.js @@ -0,0 +1,14 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + + , apply = Function.prototype.apply; + +module.exports = function (/* …args*/) { + var fn = callable(this) + , args = arguments; + + return function () { + return apply.call(fn, this, args); +}; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/microtask-delay.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/microtask-delay.js new file mode 100644 index 00000000..89d47be5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/microtask-delay.js @@ -0,0 +1,14 @@ +"use strict"; + +var ensurePlainFunction = require("../../object/ensure-plain-function") + , defineLength = require("../_define-length") + , nextTick = require("next-tick"); + +var apply = Function.prototype.apply; + +module.exports = function () { + var src = ensurePlainFunction(this); + return defineLength(function () { + nextTick(apply.bind(src, this, arguments)); + }, this.length); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/not.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/not.js new file mode 100644 index 00000000..82d64def --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/not.js @@ -0,0 +1,14 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + , defineLength = require("../_define-length") + + , apply = Function.prototype.apply; + +module.exports = function () { + var fn = callable(this); + + return defineLength(function () { + return !apply.call(fn, this, arguments); + }, fn.length); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/partial.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/partial.js new file mode 100644 index 00000000..1734b135 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/partial.js @@ -0,0 +1,16 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + , aFrom = require("../../array/from") + , defineLength = require("../_define-length") + + , apply = Function.prototype.apply; + +module.exports = function (/* …args*/) { + var fn = callable(this) + , args = aFrom(arguments); + + return defineLength(function () { + return apply.call(fn, this, args.concat(aFrom(arguments))); + }, fn.length - args.length); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/spread.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/spread.js new file mode 100644 index 00000000..755553b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/spread.js @@ -0,0 +1,12 @@ +"use strict"; + +var callable = require("../../object/valid-callable") + + , apply = Function.prototype.apply; + +module.exports = function () { + var fn = callable(this); + return function (args) { + return apply.call(fn, this, args); +}; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/to-string-tokens.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/to-string-tokens.js new file mode 100644 index 00000000..4ce026a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/#/to-string-tokens.js @@ -0,0 +1,17 @@ +"use strict"; + +var validFunction = require("../valid-function"); + +var re1 = /^\s*function[\0-')-\uffff]*\(([\0-(*-\uffff]*)\)\s*\{([\0-\uffff]*)\}\s*$/ + , re2 = /^\s*\(?([\0-'*-\uffff]*)\)?\s*=>\s*(\{?[\0-\uffff]*\}?)\s*$/; + +module.exports = function () { + var str = String(validFunction(this)), data = str.match(re1); + if (!data) { + data = str.match(re2); + if (!data) throw new Error("Unrecognized string format"); + data[1] = data[1].trim(); + if (data[2][0] === "{") data[2] = data[2].trim().slice(1, -1); + } + return { args: data[1], body: data[2] }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/_define-length.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/_define-length.js new file mode 100644 index 00000000..13749d3b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/_define-length.js @@ -0,0 +1,56 @@ +"use strict"; + +var toPosInt = require("../number/to-pos-integer"); + +var test = function (arg1, arg2) { + return arg2; +}; + +var desc, defineProperty, generate, mixin; + +try { + Object.defineProperty(test, "length", { + configurable: true, + writable: false, + enumerable: false, + value: 1 + }); +} catch (ignore) {} + +if (test.length === 1) { + // ES6 + desc = { configurable: true, writable: false, enumerable: false }; + defineProperty = Object.defineProperty; + module.exports = function (fn, length) { + length = toPosInt(length); + if (fn.length === length) return fn; + desc.value = length; + return defineProperty(fn, "length", desc); + }; +} else { + mixin = require("../object/mixin"); + generate = (function () { + var cache = []; + return function (length) { + var args, i = 0; + if (cache[length]) return cache[length]; + args = []; + while (length--) args.push("a" + (++i).toString(36)); + // eslint-disable-next-line no-new-func + return new Function( + "fn", + "return function (" + args.join(", ") + ") { return fn.apply(this, arguments); };" + ); + }; + }()); + module.exports = function (src, length) { + var target; + length = toPosInt(length); + if (src.length === length) return src; + target = generate(length)(src); + try { + mixin(target, src); + } catch (ignore) {} + return target; + }; +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/constant.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/constant.js new file mode 100644 index 00000000..c41435d5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/constant.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (value) { + return function () { + return value; + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/identity.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/identity.js new file mode 100644 index 00000000..01a5aadf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/identity.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (value) { + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/index.js new file mode 100644 index 00000000..1574fbbb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/index.js @@ -0,0 +1,15 @@ +// Export all modules. + +"use strict"; + +module.exports = { + "#": require("./#"), + "constant": require("./constant"), + "identity": require("./identity"), + "invoke": require("./invoke"), + "isArguments": require("./is-arguments"), + "isFunction": require("./is-function"), + "noop": require("./noop"), + "pluck": require("./pluck"), + "validFunction": require("./valid-function") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/invoke.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/invoke.js new file mode 100644 index 00000000..c3d23f2d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/invoke.js @@ -0,0 +1,15 @@ +"use strict"; + +var isCallable = require("../object/is-callable") + , value = require("../object/valid-value") + + , slice = Array.prototype.slice, apply = Function.prototype.apply; + +module.exports = function (name/*, …args*/) { + var args = slice.call(arguments, 1), isFn = isCallable(name); + return function (obj) { + value(obj); + return apply.call(isFn ? name : obj[name], obj, + args.concat(slice.call(arguments, 1))); + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/is-arguments.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/is-arguments.js new file mode 100644 index 00000000..f4bf4060 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/is-arguments.js @@ -0,0 +1,12 @@ +"use strict"; + +var objToString = Object.prototype.toString + , id = objToString.call( + (function () { + return arguments; + })() +); + +module.exports = function (value) { + return objToString.call(value) === id; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/is-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/is-function.js new file mode 100644 index 00000000..d3d92f4e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/is-function.js @@ -0,0 +1,7 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(require("./noop")); + +module.exports = function (value) { + return typeof value === "function" && objToString.call(value) === id; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/noop.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/noop.js new file mode 100644 index 00000000..6174f033 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/noop.js @@ -0,0 +1,4 @@ +"use strict"; + +// eslint-disable-next-line no-empty-function +module.exports = function () {}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/pluck.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/pluck.js new file mode 100644 index 00000000..8507128a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/pluck.js @@ -0,0 +1,9 @@ +"use strict"; + +var value = require("../object/valid-value"); + +module.exports = function (name) { + return function (obj) { + return value(obj)[name]; + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/valid-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/valid-function.js new file mode 100644 index 00000000..060bd645 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/function/valid-function.js @@ -0,0 +1,8 @@ +"use strict"; + +var isFunction = require("./is-function"); + +module.exports = function (value) { + if (!isFunction(value)) throw new TypeError(value + " is not a function"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/global.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/global.js new file mode 100644 index 00000000..27d05047 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/global.js @@ -0,0 +1,15 @@ +module.exports = (function () { + if (this) return this; + + // Unexpected strict mode (may happen if e.g. bundled into ESM module) be nice + + // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis + // In all ES5 engines global object inherits from Object.prototype + // (if you approached one that doesn't please report) + Object.defineProperty(Object.prototype, "__global__", { + get: function () { return this; }, + configurable: true + }); + try { return __global__; } + finally { delete Object.prototype.__global__; } +})(); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/index.js new file mode 100644 index 00000000..0919764e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/index.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = { + global: require("./global"), + optionalChaining: require("./optional-chaining"), + safeToString: require("./safe-to-string"), + toShortStringRepresentation: require("./to-short-string-representation"), + + array: require("./array"), + boolean: require("./boolean"), + date: require("./date"), + error: require("./error"), + function: require("./function"), + iterable: require("./iterable"), + json: require("./json"), + math: require("./math"), + number: require("./number"), + object: require("./object"), + promise: require("./promise"), + regExp: require("./reg-exp"), + string: require("./string") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/for-each.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/for-each.js new file mode 100644 index 00000000..2840e952 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/for-each.js @@ -0,0 +1,12 @@ +"use strict"; + +var forOf = require("es6-iterator/for-of") + , isIterable = require("es6-iterator/is-iterable") + , iterable = require("./validate") + + , forEach = Array.prototype.forEach; + +module.exports = function (target, cb/*, thisArg*/) { + if (isIterable(iterable(target))) forOf(target, cb, arguments[2]); + else forEach.call(target, cb, arguments[2]); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/index.js new file mode 100644 index 00000000..4b898fc8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = { + forEach: require("./for-each"), + is: require("./is"), + validate: require("./validate"), + validateObject: require("./validate-object") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/is.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/is.js new file mode 100644 index 00000000..aa5a9b9e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/is.js @@ -0,0 +1,11 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , isValue = require("../object/is-value") + , isArrayLike = require("../object/is-array-like"); + +module.exports = function (value) { + if (!isValue(value)) return false; + if (typeof value[iteratorSymbol] === "function") return true; + return isArrayLike(value); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/validate-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/validate-object.js new file mode 100644 index 00000000..26e622b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/validate-object.js @@ -0,0 +1,9 @@ +"use strict"; + +var isObject = require("../object/is-object") + , is = require("./is"); + +module.exports = function (value) { + if (is(value) && isObject(value)) return value; + throw new TypeError(value + " is not an iterable or array-like object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/validate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/validate.js new file mode 100644 index 00000000..94a91c47 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/iterable/validate.js @@ -0,0 +1,8 @@ +"use strict"; + +var is = require("./is"); + +module.exports = function (value) { + if (is(value)) return value; + throw new TypeError(value + " is not an iterable or array-like"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/json/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/json/index.js new file mode 100644 index 00000000..14b25cd6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/json/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + safeStringify: require("./safe-stringify") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/json/safe-stringify.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/json/safe-stringify.js new file mode 100644 index 00000000..2154f6c0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/json/safe-stringify.js @@ -0,0 +1,41 @@ +"use strict"; + +var compact = require("../array/#/compact") + , isObject = require("../object/is-object") + , toArray = require("../object/to-array") + , isArray = Array.isArray + , stringify = JSON.stringify; + +module.exports = function self(value /*, replacer, space*/) { + var replacer = arguments[1], space = arguments[2]; + try { + return stringify(value, replacer, space); + } catch (e) { + if (!isObject(value)) return null; + if (typeof value.toJSON === "function") return null; + if (isArray(value)) { + return ( + "[" + + compact.call( + value.map(function (item) { + return self(item, replacer, space); + }) + ) + + "]" + ); + } + return ( + "{" + + compact + .call( + toArray(value, function (item, key) { + item = self(item, replacer, space); + if (!item) return null; + return stringify(key) + ":" + item; + }) + ) + .join(",") + + "}" + ); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_decimal-adjust.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_decimal-adjust.js new file mode 100644 index 00000000..fd0b0025 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_decimal-adjust.js @@ -0,0 +1,29 @@ +// Credit: +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round +// #Decimal_rounding + +"use strict"; + +var isValue = require("../object/is-value") + , ensureInteger = require("../object/ensure-integer"); + +var split = String.prototype.split; + +module.exports = function (type) { + return function (value/*, exp*/) { + value = Number(value); + var exp = arguments[1]; + if (isValue(exp)) exp = ensureInteger(exp); + if (!value) return value; + if (!exp) return Math[type](value); + if (!isFinite(value)) return value; + + // Shift + var tokens = split.call(value, "e"); + value = Math[type](tokens[0] + "e" + ((tokens[1] || 0) - exp)); + + // Shift back + tokens = value.toString().split("e"); + return Number(tokens[0] + "e" + (Number(tokens[1] || 0) + exp)); + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_pack-ieee754.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_pack-ieee754.js new file mode 100644 index 00000000..b3edf8d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_pack-ieee754.js @@ -0,0 +1,88 @@ +/* eslint no-bitwise: "off" */ +// Credit: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var abs = Math.abs + , floor = Math.floor + , log = Math.log + , min = Math.min + , pow = Math.pow + , LN2 = Math.LN2 + , roundToEven; + +roundToEven = function (num) { + var whole = floor(num), fraction = num - whole; + if (fraction < 0.5) return whole; + if (fraction > 0.5) return whole + 1; + return whole % 2 ? whole + 1 : whole; +}; + +// eslint-disable-next-line max-statements, max-lines-per-function +module.exports = function (value, ebits, fbits) { + var bias = (1 << (ebits - 1)) - 1, sign, e, fraction, i, bits, str, bytes; + + // Compute sign, exponent, fraction + if (isNaN(value)) { + // NaN + // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping + e = (1 << ebits) - 1; + fraction = pow(2, fbits - 1); + sign = 0; + } else if (value === Infinity || value === -Infinity) { + e = (1 << ebits) - 1; + fraction = 0; + sign = value < 0 ? 1 : 0; + } else if (value === 0) { + e = 0; + fraction = 0; + sign = 1 / value === -Infinity ? 1 : 0; + } else { + sign = value < 0; + value = abs(value); + + if (value >= pow(2, 1 - bias)) { + e = min(floor(log(value) / LN2), 1023); + fraction = roundToEven((value / pow(2, e)) * pow(2, fbits)); + if (fraction / pow(2, fbits) >= 2) { + e += 1; + fraction = 1; + } + if (e > bias) { + // Overflow + e = (1 << ebits) - 1; + fraction = 0; + } else { + // Normal + e += bias; + fraction -= pow(2, fbits); + } + } else { + // Subnormal + e = 0; + fraction = roundToEven(value / pow(2, 1 - bias - fbits)); + } + } + + // Pack sign, exponent, fraction + bits = []; + for (i = fbits; i; i -= 1) { + bits.push(fraction % 2 ? 1 : 0); + fraction = floor(fraction / 2); + } + for (i = ebits; i; i -= 1) { + bits.push(e % 2 ? 1 : 0); + e = floor(e / 2); + } + bits.push(sign ? 1 : 0); + bits.reverse(); + str = bits.join(""); + + // Bits to bytes + bytes = []; + while (str.length) { + bytes.push(parseInt(str.substring(0, 8), 2)); + str = str.substring(8); + } + return bytes; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_unpack-ieee754.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_unpack-ieee754.js new file mode 100644 index 00000000..83fa9475 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/_unpack-ieee754.js @@ -0,0 +1,33 @@ +/* eslint no-bitwise: "off" */ +// Credit: https://github.com/paulmillr/es6-shim/ + +"use strict"; + +var pow = Math.pow; + +module.exports = function (bytes, ebits, fbits) { + // Bytes to bits + var bits = [], i, j, bit, str, bias, sign, e, fraction; + + for (i = bytes.length; i; i -= 1) { + bit = bytes[i - 1]; + for (j = 8; j; j -= 1) { + bits.push(bit % 2 ? 1 : 0); + bit >>= 1; + } + } + bits.reverse(); + str = bits.join(""); + + // Unpack sign, exponent, fraction + bias = (1 << (ebits - 1)) - 1; + sign = parseInt(str.substring(0, 1), 2) ? -1 : 1; + e = parseInt(str.substring(1, 1 + ebits), 2); + fraction = parseInt(str.substring(1 + ebits), 2); + + // Produce number + if (e === (1 << ebits) - 1) return fraction === 0 ? sign * Infinity : NaN; + if (e > 0) return sign * pow(2, e - bias) * (1 + fraction / pow(2, fbits)); + if (fraction !== 0) return sign * pow(2, -(bias - 1)) * (fraction / pow(2, fbits)); + return sign < 0 ? -0 : 0; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/implement.js new file mode 100644 index 00000000..ea75c7d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "acosh", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/index.js new file mode 100644 index 00000000..160f6b99 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.acosh + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/is-implemented.js new file mode 100644 index 00000000..2e973013 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var acosh = Math.acosh; + if (typeof acosh !== "function") return false; + return acosh(2) === 1.3169578969248166; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/shim.js new file mode 100644 index 00000000..3e632ffb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/acosh/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +var log = Math.log, sqrt = Math.sqrt; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < 1) return NaN; + if (value === 1) return 0; + if (value === Infinity) return value; + return log(value + sqrt(value * value - 1)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/implement.js new file mode 100644 index 00000000..efa6704e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "asinh", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/index.js new file mode 100644 index 00000000..b5fb120f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.asinh + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/is-implemented.js new file mode 100644 index 00000000..a7e0f20f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var asinh = Math.asinh; + if (typeof asinh !== "function") return false; + return asinh(2) === 1.4436354751788103; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/shim.js new file mode 100644 index 00000000..30ce2e4d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/asinh/shim.js @@ -0,0 +1,15 @@ +"use strict"; + +var log = Math.log, sqrt = Math.sqrt; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + if (value < 0) { + value = -value; + return -log(value + sqrt(value * value + 1)); + } + return log(value + sqrt(value * value + 1)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/implement.js new file mode 100644 index 00000000..47d5cc22 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "atanh", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/index.js new file mode 100644 index 00000000..51fbcd66 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.atanh + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/is-implemented.js new file mode 100644 index 00000000..4787c4fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var atanh = Math.atanh; + if (typeof atanh !== "function") return false; + return Math.round(atanh(0.5) * 1e15) === 549306144334055; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/shim.js new file mode 100644 index 00000000..9383e971 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/atanh/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var log = Math.log; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < -1) return NaN; + if (value > 1) return NaN; + if (value === -1) return -Infinity; + if (value === 1) return Infinity; + if (value === 0) return value; + return 0.5 * log((1 + value) / (1 - value)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/implement.js new file mode 100644 index 00000000..f5adbab0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "cbrt", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/index.js new file mode 100644 index 00000000..47806407 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.cbrt + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/is-implemented.js new file mode 100644 index 00000000..a8ac0db2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var cbrt = Math.cbrt; + if (typeof cbrt !== "function") return false; + return cbrt(2) === 1.2599210498948732; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/shim.js new file mode 100644 index 00000000..8871c552 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cbrt/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +var pow = Math.pow; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + if (value < 0) return -pow(-value, 1 / 3); + return pow(value, 1 / 3); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/ceil-10.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/ceil-10.js new file mode 100644 index 00000000..351221f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/ceil-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_decimal-adjust")("ceil"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/implement.js new file mode 100644 index 00000000..10b4a41d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "clz32", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/index.js new file mode 100644 index 00000000..a16ee33a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.clz32 + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/is-implemented.js new file mode 100644 index 00000000..ee6d8828 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var clz32 = Math.clz32; + if (typeof clz32 !== "function") return false; + return clz32(1000) === 22; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/shim.js new file mode 100644 index 00000000..2b526c2c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/clz32/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (value) { + // eslint-disable-next-line no-bitwise + value >>>= 0; + return value ? 32 - value.toString(2).length : 32; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/implement.js new file mode 100644 index 00000000..6f42b387 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "cosh", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/index.js new file mode 100644 index 00000000..5ed349af --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.cosh + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/is-implemented.js new file mode 100644 index 00000000..7173054c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var cosh = Math.cosh; + if (typeof cosh !== "function") return false; + return cosh(1) === 1.5430806348152437; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/shim.js new file mode 100644 index 00000000..c762c84d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/cosh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +var exp = Math.exp; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return 1; + if (!isFinite(value)) return Infinity; + return (exp(value) + exp(-value)) / 2; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/implement.js new file mode 100644 index 00000000..8c9d8111 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "expm1", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/index.js new file mode 100644 index 00000000..5b5dff6b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.expm1 + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/is-implemented.js new file mode 100644 index 00000000..dfd056e0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var expm1 = Math.expm1; + if (typeof expm1 !== "function") return false; + return expm1(1).toFixed(15) === "1.718281828459045"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/shim.js new file mode 100644 index 00000000..ce737b3b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/expm1/shim.js @@ -0,0 +1,16 @@ +// Thanks: https://github.com/monolithed/ECMAScript-6 + +"use strict"; + +var exp = Math.exp; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (value === Infinity) return Infinity; + if (value === -Infinity) return -1; + + if (value > -1.0e-6 && value < 1.0e-6) return value + value * value / 2; + return exp(value) - 1; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/floor-10.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/floor-10.js new file mode 100644 index 00000000..3cb0c119 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/floor-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_decimal-adjust")("floor"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/implement.js new file mode 100644 index 00000000..b54d2fca --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "fround", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/index.js new file mode 100644 index 00000000..db409e83 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.fround + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/is-implemented.js new file mode 100644 index 00000000..ad2b705d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var fround = Math.fround; + if (typeof fround !== "function") return false; + return fround(1.337) === 1.3370000123977661; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/shim.js new file mode 100644 index 00000000..bfbc54c6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/fround/shim.js @@ -0,0 +1,35 @@ +/* global Float32Array */ + +// Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js + +"use strict"; + +var toFloat32; + +if (typeof Float32Array === "undefined") { + toFloat32 = (function () { + var pack = require("../_pack-ieee754") + , unpack = require("../_unpack-ieee754"); + + return function (value) { + return unpack(pack(value, 8, 23), 8, 23); + }; + }()); +} else { + toFloat32 = (function () { + var float32Array = new Float32Array(1); + return function (num) { + float32Array[0] = num; + return float32Array[0]; + }; + }()); +} + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + + return toFloat32(value); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/implement.js new file mode 100644 index 00000000..e2b3928b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "hypot", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/index.js new file mode 100644 index 00000000..a030a419 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.hypot + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/is-implemented.js new file mode 100644 index 00000000..d317bc7e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var hypot = Math.hypot; + if (typeof hypot !== "function") return false; + return hypot(3, 4) === 5; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/shim.js new file mode 100644 index 00000000..2a92b171 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/hypot/shim.js @@ -0,0 +1,43 @@ +// Thanks for hints: https://github.com/paulmillr/es6-shim + +"use strict"; + +var some = Array.prototype.some + , abs = Math.abs + , sqrt = Math.sqrt + , compare = function (val1, val2) { + return val2 - val1; +} + , divide = function (value) { + return value / this; +} + , add = function (sum, number) { + return sum + number * number; +}; + +// eslint-disable-next-line no-unused-vars +module.exports = function (val1, val2 /*, …valn*/) { + var result, numbers; + if (!arguments.length) return 0; + some.call(arguments, function (val) { + if (isNaN(val)) { + result = NaN; + return false; + } + if (!isFinite(val)) { + result = Infinity; + return true; + } + if (result !== undefined) return false; + val = Number(val); + if (val === 0) return false; + if (numbers) numbers.push(abs(val)); + else numbers = [abs(val)]; + return false; + }); + if (result !== undefined) return result; + if (!numbers) return 0; + + numbers.sort(compare); + return numbers[0] * sqrt(numbers.map(divide, numbers[0]).reduce(add, 0)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/implement.js new file mode 100644 index 00000000..bff57735 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "imul", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/index.js new file mode 100644 index 00000000..a756d594 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.imul + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/is-implemented.js new file mode 100644 index 00000000..0f329198 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var imul = Math.imul; + if (typeof imul !== "function") return false; + return imul(-1, 8) === -8; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/shim.js new file mode 100644 index 00000000..a14e5895 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/imul/shim.js @@ -0,0 +1,17 @@ +/* eslint no-bitwise: "off" */ + +// Thanks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference +// /Global_Objects/Math/imul + +"use strict"; + +module.exports = function (val1, val2) { + var xh = (val1 >>> 16) & 0xffff + , xl = val1 & 0xffff + , yh = (val2 >>> 16) & 0xffff + , yl = val2 & 0xffff; + + // The shift by 0 fixes the sign on the high part + // the final |0 converts the unsigned value into a signed value + return (xl * yl + ((xh * yl + xl * yh) << 16 >>> 0)) | 0; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/index.js new file mode 100644 index 00000000..a59269cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/index.js @@ -0,0 +1,24 @@ +"use strict"; + +module.exports = { + acosh: require("./acosh"), + asinh: require("./asinh"), + atanh: require("./atanh"), + cbrt: require("./cbrt"), + ceil10: require("./ceil-10"), + clz32: require("./clz32"), + cosh: require("./cosh"), + expm1: require("./expm1"), + floor10: require("./floor-10"), + fround: require("./fround"), + hypot: require("./hypot"), + imul: require("./imul"), + log10: require("./log10"), + log2: require("./log2"), + log1p: require("./log1p"), + round10: require("./round-10"), + sign: require("./sign"), + sinh: require("./sinh"), + tanh: require("./tanh"), + trunc: require("./trunc") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/implement.js new file mode 100644 index 00000000..669cee88 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "log10", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/index.js new file mode 100644 index 00000000..bc2ec481 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.log10 + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/is-implemented.js new file mode 100644 index 00000000..f2217597 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var log10 = Math.log10; + if (typeof log10 !== "function") return false; + return log10(2) === 0.3010299956639812; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/shim.js new file mode 100644 index 00000000..e8599a26 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log10/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var log = Math.log, LOG10E = Math.LOG10E; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < 0) return NaN; + if (value === 0) return -Infinity; + if (value === 1) return 0; + if (value === Infinity) return Infinity; + + return log(value) * LOG10E; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/implement.js new file mode 100644 index 00000000..36fcee61 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "log1p", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/index.js new file mode 100644 index 00000000..41c67364 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.log1p + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/is-implemented.js new file mode 100644 index 00000000..7626ab47 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var log1p = Math.log1p; + if (typeof log1p !== "function") return false; + return log1p(1) === 0.6931471805599453; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/shim.js new file mode 100644 index 00000000..7c6f2273 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log1p/shim.js @@ -0,0 +1,17 @@ +// Thanks: https://github.com/monolithed/ECMAScript-6/blob/master/ES6.js + +"use strict"; + +var log = Math.log; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < -1) return NaN; + if (value === -1) return -Infinity; + if (value === 0) return value; + if (value === Infinity) return Infinity; + + if (value > -1.0e-8 && value < 1.0e-8) return value - value * value / 2; + return log(1 + value); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/implement.js new file mode 100644 index 00000000..f1c04e09 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "log2", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/index.js new file mode 100644 index 00000000..d319caec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.log2 + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/is-implemented.js new file mode 100644 index 00000000..c70963f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var log2 = Math.log2; + if (typeof log2 !== "function") return false; + return log2(3).toFixed(15) === "1.584962500721156"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/shim.js new file mode 100644 index 00000000..51fcdae9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/log2/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var log = Math.log, LOG2E = Math.LOG2E; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value < 0) return NaN; + if (value === 0) return -Infinity; + if (value === 1) return 0; + if (value === Infinity) return Infinity; + + return log(value) * LOG2E; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/round-10.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/round-10.js new file mode 100644 index 00000000..228c2351 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/round-10.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_decimal-adjust")("round"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/implement.js new file mode 100644 index 00000000..bc7da14d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "sign", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/index.js new file mode 100644 index 00000000..9f286564 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.sign + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/is-implemented.js new file mode 100644 index 00000000..23ff83a6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var sign = Math.sign; + if (typeof sign !== "function") return false; + return (sign(10) === 1) && (sign(-20) === -1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/shim.js new file mode 100644 index 00000000..760c69d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sign/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (value) { + value = Number(value); + if (isNaN(value) || (value === 0)) return value; + return value > 0 ? 1 : -1; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/implement.js new file mode 100644 index 00000000..cc4c40bc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "sinh", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/index.js new file mode 100644 index 00000000..2c43dce1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.sinh + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/is-implemented.js new file mode 100644 index 00000000..5e4ee40c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var sinh = Math.sinh; + if (typeof sinh !== "function") return false; + return (sinh(1) === 1.1752011936438014) && (sinh(Number.MIN_VALUE) === 5e-324); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/shim.js new file mode 100644 index 00000000..fc6a0477 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/sinh/shim.js @@ -0,0 +1,18 @@ +// Parts of implementation taken from es6-shim project +// See: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js + +"use strict"; + +var expm1 = require("../expm1") + , abs = Math.abs + , exp = Math.exp + , e = Math.E; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (!isFinite(value)) return value; + if (abs(value) < 1) return (expm1(value) - expm1(-value)) / 2; + return (exp(value - 1) - exp(-value - 1)) * e / 2; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/implement.js new file mode 100644 index 00000000..9e30d10d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "tanh", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/index.js new file mode 100644 index 00000000..7c45d988 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.tanh + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/is-implemented.js new file mode 100644 index 00000000..b17a1bc4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var tanh = Math.tanh; + if (typeof tanh !== "function") return false; + return (tanh(1) === 0.7615941559557649) && (tanh(Number.MAX_VALUE) === 1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/shim.js new file mode 100644 index 00000000..974dd7cd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/tanh/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var exp = Math.exp; + +module.exports = function (value) { + var num1, num2; + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (value === Infinity) return 1; + if (value === -Infinity) return -1; + num1 = exp(value); + if (num1 === Infinity) return 1; + num2 = exp(-value); + if (num2 === Infinity) return -1; + return (num1 - num2) / (num1 + num2); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/implement.js new file mode 100644 index 00000000..1ecc124c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Math, "trunc", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/index.js new file mode 100644 index 00000000..94c02691 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Math.trunc + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/is-implemented.js new file mode 100644 index 00000000..b1507352 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var trunc = Math.trunc; + if (typeof trunc !== "function") return false; + return (trunc(13.67) === 13) && (trunc(-13.67) === -13); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/shim.js new file mode 100644 index 00000000..bf6ac8cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/math/trunc/shim.js @@ -0,0 +1,13 @@ +"use strict"; + +var floor = Math.floor; + +module.exports = function (value) { + if (isNaN(value)) return NaN; + value = Number(value); + if (value === 0) return value; + if (value === Infinity) return Infinity; + if (value === -Infinity) return -Infinity; + if (value > 0) return floor(value); + return -floor(-value); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/#/index.js new file mode 100644 index 00000000..e6e21c30 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/#/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + pad: require("./pad") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/#/pad.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/#/pad.js new file mode 100644 index 00000000..26fe4b63 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/#/pad.js @@ -0,0 +1,15 @@ +"use strict"; + +var pad = require("../../string/#/pad") + , toPosInt = require("../to-pos-integer") + + , toFixed = Number.prototype.toFixed; + +module.exports = function (length/*, precision*/) { + var precision; + length = toPosInt(length); + precision = toPosInt(arguments[1]); + + return pad.call(precision ? toFixed.call(this, precision) : this, + "0", length + (precision ? 1 + precision : 0)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/implement.js new file mode 100644 index 00000000..fa19131a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "EPSILON", { value: require("./"), + configurable: false, +enumerable: false, +writable: false }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/index.js new file mode 100644 index 00000000..12e8a8d2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = 2.220446049250313e-16; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/is-implemented.js new file mode 100644 index 00000000..1cfbded2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/epsilon/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function () { + return typeof Number.EPSILON === "number"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/index.js new file mode 100644 index 00000000..b57ff150 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "EPSILON": require("./epsilon"), + "isFinite": require("./is-finite"), + "isInteger": require("./is-integer"), + "isNaN": require("./is-nan"), + "isNatural": require("./is-natural"), + "isNumber": require("./is-number"), + "isSafeInteger": require("./is-safe-integer"), + "MAX_SAFE_INTEGER": require("./max-safe-integer"), + "MIN_SAFE_INTEGER": require("./min-safe-integer"), + "toInteger": require("./to-integer"), + "toPosInteger": require("./to-pos-integer"), + "toUint32": require("./to-uint32") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/implement.js new file mode 100644 index 00000000..17f67cbc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isFinite", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/index.js new file mode 100644 index 00000000..dbeaf7b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Number.isFinite + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/is-implemented.js new file mode 100644 index 00000000..eadd0507 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var numberIsFinite = Number.isFinite; + if (typeof numberIsFinite !== "function") return false; + return !numberIsFinite("23") && numberIsFinite(34) && !numberIsFinite(Infinity); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/shim.js new file mode 100644 index 00000000..72dd7aae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-finite/shim.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (value) { + return (typeof value === "number") && isFinite(value); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/implement.js new file mode 100644 index 00000000..dd1f3bd0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isInteger", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/index.js new file mode 100644 index 00000000..71cde73a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Number.isInteger + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/is-implemented.js new file mode 100644 index 00000000..f357c717 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var isInteger = Number.isInteger; + if (typeof isInteger !== "function") return false; + return !isInteger("23") && isInteger(34) && !isInteger(32.34); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/shim.js new file mode 100644 index 00000000..12058b5a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-integer/shim.js @@ -0,0 +1,8 @@ +// Credit: http://www.2ality.com/2014/05/is-integer.html + +"use strict"; + +module.exports = function (value) { + if (typeof value !== "number") return false; + return value % 1 === 0; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/implement.js new file mode 100644 index 00000000..2f9126c9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isNaN", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/index.js new file mode 100644 index 00000000..9128d5c0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Number.isNaN + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/is-implemented.js new file mode 100644 index 00000000..756838a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var numberIsNaN = Number.isNaN; + if (typeof numberIsNaN !== "function") return false; + return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/shim.js new file mode 100644 index 00000000..b5730d1d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-nan/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (value) { + // eslint-disable-next-line no-self-compare + return value !== value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-natural.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-natural.js new file mode 100644 index 00000000..329966e3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-natural.js @@ -0,0 +1,7 @@ +"use strict"; + +var isInteger = require("./is-integer"); + +module.exports = function (num) { + return isInteger(num) && (num >= 0); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-number.js new file mode 100644 index 00000000..3da0712d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-number.js @@ -0,0 +1,10 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(1); + +module.exports = function (value) { + return ( + typeof value === "number" || + (value instanceof Number || (typeof value === "object" && objToString.call(value) === id)) + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/implement.js new file mode 100644 index 00000000..6092db75 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "isSafeInteger", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/index.js new file mode 100644 index 00000000..d4314df1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Number.isSafeInteger + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/is-implemented.js new file mode 100644 index 00000000..36b0db56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function () { + var isSafeInteger = Number.isSafeInteger; + if (typeof isSafeInteger !== "function") return false; + return !isSafeInteger("23") && isSafeInteger(34232322323) && + !isSafeInteger(9007199254740992); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/shim.js new file mode 100644 index 00000000..de7f22f3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/is-safe-integer/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +var isInteger = require("../is-integer/shim") + , maxValue = require("../max-safe-integer") + + , abs = Math.abs; + +module.exports = function (value) { + if (!isInteger(value)) return false; + return abs(value) <= maxValue; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/implement.js new file mode 100644 index 00000000..be5a2933 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "MAX_SAFE_INTEGER", { value: require("./"), + configurable: false, +enumerable: false, +writable: false }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/index.js new file mode 100644 index 00000000..75a41e7c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = Math.pow(2, 53) - 1; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/is-implemented.js new file mode 100644 index 00000000..09a7da75 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/max-safe-integer/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function () { + return typeof Number.MAX_SAFE_INTEGER === "number"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/implement.js new file mode 100644 index 00000000..77d02745 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Number, "MIN_SAFE_INTEGER", { value: require("./"), + configurable: false, +enumerable: false, +writable: false }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/index.js new file mode 100644 index 00000000..cde45146 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = -(Math.pow(2, 53) - 1); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/is-implemented.js new file mode 100644 index 00000000..7b63253f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/min-safe-integer/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function () { + return typeof Number.MIN_SAFE_INTEGER === "number"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-integer.js new file mode 100644 index 00000000..524395ce --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-integer.js @@ -0,0 +1,12 @@ +"use strict"; + +var sign = require("../math/sign") + + , abs = Math.abs, floor = Math.floor; + +module.exports = function (value) { + if (isNaN(value)) return 0; + value = Number(value); + if ((value === 0) || !isFinite(value)) return value; + return sign(value) * floor(abs(value)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-pos-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-pos-integer.js new file mode 100644 index 00000000..fe2813da --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-pos-integer.js @@ -0,0 +1,9 @@ +"use strict"; + +var toInteger = require("./to-integer") + + , max = Math.max; + +module.exports = function (value) { + return max(0, toInteger(value)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-uint32.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-uint32.js new file mode 100644 index 00000000..cb3590aa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/number/to-uint32.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (value) { + // eslint-disable-next-line no-bitwise + return value >>> 0; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/_iterate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/_iterate.js new file mode 100644 index 00000000..1f0c85fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/_iterate.js @@ -0,0 +1,30 @@ +// Internal method, used by iteration functions. +// Calls a function for each key-value pair found in object +// Optionally takes compareFn to iterate object in specific order + +"use strict"; + +var callable = require("./valid-callable") + , value = require("./valid-value") + , bind = Function.prototype.bind + , call = Function.prototype.call + , keys = Object.keys + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (method, defVal) { + return function (obj, cb /*, thisArg, compareFn*/) { + var list, thisArg = arguments[2], compareFn = arguments[3]; + obj = Object(value(obj)); + callable(cb); + + list = keys(obj); + if (compareFn) { + list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined); + } + if (typeof method !== "function") method = list[method]; + return call.call(method, list, function (key, index) { + if (!objPropertyIsEnumerable.call(obj, key)) return defVal; + return call.call(cb, thisArg, obj[key], key, obj, index); + }); + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign-deep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign-deep.js new file mode 100644 index 00000000..4a8597a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign-deep.js @@ -0,0 +1,34 @@ +"use strict"; + +var includes = require("../array/#/contains") + , uniq = require("../array/#/uniq") + , copyDeep = require("./copy-deep") + , objForEach = require("./for-each") + , isPlainObject = require("./is-plain-object") + , ensureValue = require("./valid-value"); + +var isArray = Array.isArray, slice = Array.prototype.slice; + +var deepAssign = function (target, source) { + if (target === source) return target; + if (isPlainObject(target) && isPlainObject(source)) { + objForEach(source, function (value, key) { target[key] = deepAssign(target[key], value); }); + return target; + } + if (isArray(target) && isArray(source)) { + source.forEach(function (item) { + if (includes.call(target, item)) return; + if (isArray(item) || isPlainObject(item)) item = copyDeep(item); + target.push(item); + }); + return target; + } + if (isPlainObject(source) || isArray(source)) return copyDeep(source); + return source; +}; + +module.exports = function (target/*, ...objects*/) { + return uniq + .call([ensureValue(target)].concat(slice.call(arguments, 1).map(ensureValue))) + .reduce(deepAssign); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/implement.js new file mode 100644 index 00000000..de3c92f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Object, "assign", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/index.js new file mode 100644 index 00000000..1dd31e64 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Object.assign + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/is-implemented.js new file mode 100644 index 00000000..6b90ea96 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function () { + var assign = Object.assign, obj; + if (typeof assign !== "function") return false; + obj = { foo: "raz" }; + assign(obj, { bar: "dwa" }, { trzy: "trzy" }); + return (obj.foo + obj.bar + obj.trzy) === "razdwatrzy"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/shim.js new file mode 100644 index 00000000..afa58f2f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/assign/shim.js @@ -0,0 +1,23 @@ +"use strict"; + +var keys = require("../keys") + , value = require("../valid-value") + , max = Math.max; + +module.exports = function (dest, src /*, …srcn*/) { + var error, i, length = max(arguments.length, 2), assign; + dest = Object(value(dest)); + assign = function (key) { + try { + dest[key] = src[key]; + } catch (e) { + if (!error) error = e; + } + }; + for (i = 1; i < length; ++i) { + src = arguments[i]; + keys(src).forEach(assign); + } + if (error !== undefined) throw error; + return dest; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/clear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/clear.js new file mode 100644 index 00000000..268cc5b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/clear.js @@ -0,0 +1,16 @@ +"use strict"; + +var keys = require("./keys"); + +module.exports = function (obj) { + var error; + keys(obj).forEach(function (key) { + try { + delete this[key]; + } catch (e) { + if (!error) error = e; + } + }, obj); + if (error !== undefined) throw error; + return obj; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/compact.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/compact.js new file mode 100644 index 00000000..9943aedc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/compact.js @@ -0,0 +1,10 @@ +"use strict"; + +var filter = require("./filter") + , isValue = require("./is-value"); + +module.exports = function (obj) { + return filter(obj, function (val) { + return isValue(val); + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/compare.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/compare.js new file mode 100644 index 00000000..8d078589 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/compare.js @@ -0,0 +1,45 @@ +"use strict"; + +var strCompare = require("../string/#/case-insensitive-compare") + , isObject = require("./is-object") + , isValue = require("./is-value") + , numIsNaN = require("../number/is-nan") + , resolve + , typeMap; + +typeMap = { + undefined: 0, + object: 1, + boolean: 2, + string: 3, + number: 4 +}; + +resolve = function (a) { + if (isObject(a)) { + if (typeof a.valueOf !== "function") return NaN; + a = a.valueOf(); + if (isObject(a)) { + if (typeof a.toString !== "function") return NaN; + a = a.toString(); + if (typeof a !== "string") return NaN; + } + } + return a; +}; + +module.exports = function (val1, val2) { + if (val1 === val2) return 0; // Same + + val1 = resolve(val1); + val2 = resolve(val2); + // eslint-disable-next-line eqeqeq + if (val1 == val2) return typeMap[typeof val1] - typeMap[typeof val2]; + if (!isValue(val1)) return -1; + if (!isValue(val2)) return 1; + if (typeof val1 === "string" || typeof val2 === "string") { + return strCompare.call(val1, val2); + } + if (numIsNaN(val1) && numIsNaN(val2)) return 0; // Jslint: ignore + return Number(val1) - Number(val2); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/copy-deep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/copy-deep.js new file mode 100644 index 00000000..39f9a1d6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/copy-deep.js @@ -0,0 +1,37 @@ +"use strict"; + +var forEach = require("./for-each") + , isPlainObject = require("./is-plain-object") + , ensureValue = require("./valid-value") + , isArray = Array.isArray; + +var copyValue = function (value, ancestors, ancestorsCopy) { + var mode; + if (isPlainObject(value)) mode = "object"; + else if (isArray(value)) mode = "array"; + if (!mode) return value; + + var copy = ancestorsCopy[ancestors.indexOf(value)]; + if (copy) return copy; + copy = mode === "object" ? {} : []; + + ancestors.push(value); + ancestorsCopy.push(copy); + if (mode === "object") { + forEach(value, function (item, key) { + copy[key] = copyValue(item, ancestors, ancestorsCopy); + }); + } else { + value.forEach(function (item, index) { + copy[index] = copyValue(item, ancestors, ancestorsCopy); + }); + } + ancestors.pop(); + ancestorsCopy.pop(); + + return copy; +}; + +module.exports = function (source) { + return copyValue(ensureValue(source), [], []); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/copy.js new file mode 100644 index 00000000..5368e428 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/copy.js @@ -0,0 +1,19 @@ +"use strict"; + +var aFrom = require("../array/from") + , assign = require("./assign") + , value = require("./valid-value"); + +module.exports = function (obj/*, propertyNames, options*/) { + var copy = Object(value(obj)), propertyNames = arguments[1], options = Object(arguments[2]); + if (copy !== obj && !propertyNames) return copy; + var result = {}; + if (propertyNames) { + aFrom(propertyNames, function (propertyName) { + if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName]; + }); + } else { + assign(result, obj); + } + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/count.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/count.js new file mode 100644 index 00000000..8a2a71ef --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/count.js @@ -0,0 +1,7 @@ +"use strict"; + +var keys = require("./keys"); + +module.exports = function (obj) { + return keys(obj).length; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/create.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/create.js new file mode 100644 index 00000000..9e3e6e8d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/create.js @@ -0,0 +1,48 @@ +// Workaround for http://code.google.com/p/v8/issues/detail?id=2804 + +"use strict"; + +var create = Object.create, shim; + +if (!require("./set-prototype-of/is-implemented")()) { + shim = require("./set-prototype-of/shim"); +} + +module.exports = (function () { + var nullObject, polyProps, desc; + if (!shim) return create; + if (shim.level !== 1) return create; + + nullObject = {}; + polyProps = {}; + desc = { + configurable: false, + enumerable: false, + writable: true, + value: undefined + }; + Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { + if (name === "__proto__") { + polyProps[name] = { + configurable: true, + enumerable: false, + writable: true, + value: undefined + }; + return; + } + polyProps[name] = desc; + }); + Object.defineProperties(nullObject, polyProps); + + Object.defineProperty(shim, "nullPolyfill", { + configurable: false, + enumerable: false, + writable: false, + value: nullObject + }); + + return function (prototype, props) { + return create(prototype === null ? nullObject : prototype, props); + }; +}()); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-array.js new file mode 100644 index 00000000..5ca7a949 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-array.js @@ -0,0 +1,9 @@ +"use strict"; + +var toShortString = require("../to-short-string-representation") + , isArray = require("./is-array-like"); + +module.exports = function (value) { + if (isArray(value)) return value; + throw new TypeError(toShortString(value) + " is not a array"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-finite-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-finite-number.js new file mode 100644 index 00000000..4f6e4b4a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-finite-number.js @@ -0,0 +1,9 @@ +"use strict"; + +var isFiniteNumber = require("./is-finite-number") + , safeToString = require("../safe-to-string"); + +module.exports = function (value) { + if (isFiniteNumber(value)) return Number(value); + throw new TypeError(safeToString(value) + " does not represent a finite number value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-integer.js new file mode 100644 index 00000000..9ec64b5b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-integer.js @@ -0,0 +1,9 @@ +"use strict"; + +var toShortString = require("../to-short-string-representation") + , isInteger = require("./is-integer"); + +module.exports = function (num) { + if (!isInteger(num)) throw new TypeError(toShortString(num) + " is not a integer"); + return Number(num); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-natural-number-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-natural-number-value.js new file mode 100644 index 00000000..1a901aa4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-natural-number-value.js @@ -0,0 +1,10 @@ +"use strict"; + +var isNaturalValue = require("./is-natural-number-value") + , toShortString = require("../to-short-string-representation"); + +module.exports = function (arg) { + var num = Number(arg); + if (!isNaturalValue(arg)) throw new TypeError(toShortString(arg) + " is not a natural number"); + return num; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-natural-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-natural-number.js new file mode 100644 index 00000000..ec7e5146 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-natural-number.js @@ -0,0 +1,10 @@ +"use strict"; + +var isNatural = require("../number/is-natural") + , toShortString = require("../to-short-string-representation"); + +module.exports = function (arg) { + var num = Number(arg); + if (!isNatural(num)) throw new TypeError(toShortString(arg) + " is not a natural number"); + return num; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-plain-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-plain-function.js new file mode 100644 index 00000000..6cd9853e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-plain-function.js @@ -0,0 +1,11 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isPlainFunction = require("./is-plain-function"); + +module.exports = function (value) { + if (!isPlainFunction(value)) { + throw new TypeError(safeToString(value) + " is not a plain function"); + } + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-plain-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-plain-object.js new file mode 100644 index 00000000..7fb2b933 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-plain-object.js @@ -0,0 +1,9 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isPlainObject = require("./is-plain-object"); + +module.exports = function (value) { + if (!isPlainObject(value)) throw new TypeError(safeToString(value) + " is not a plain object"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-promise.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-promise.js new file mode 100644 index 00000000..b5b53563 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-promise.js @@ -0,0 +1,9 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isPromise = require("./is-promise"); + +module.exports = function (value) { + if (!isPromise(value)) throw new TypeError(safeToString(value) + " is not a promise"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-thenable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-thenable.js new file mode 100644 index 00000000..c55c17ad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/ensure-thenable.js @@ -0,0 +1,9 @@ +"use strict"; + +var safeToString = require("../safe-to-string") + , isThenable = require("./is-thenable"); + +module.exports = function (value) { + if (!isThenable(value)) throw new TypeError(safeToString(value) + " is not a thenable"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/implement.js new file mode 100644 index 00000000..5c2a246d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Object, "entries", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/index.js new file mode 100644 index 00000000..4a297d6a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.entries : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/is-implemented.js new file mode 100644 index 00000000..e13c2e65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function () { + try { + return Object.entries({ foo: 12 })[0][0] === "foo"; + } catch (e) { + return false; + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/shim.js new file mode 100644 index 00000000..2348e446 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/entries/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var ensureValue = require("../valid-value"); + +module.exports = function (object) { + ensureValue(object); + var result = []; + object = Object(object); + for (var key in object) { + if (!propertyIsEnumerable.call(object, key)) continue; + result.push([key, object[key]]); + } + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/eq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/eq.js new file mode 100644 index 00000000..03124680 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/eq.js @@ -0,0 +1,7 @@ +"use strict"; + +var numIsNaN = require("../number/is-nan"); + +module.exports = function (val1, val2) { + return val1 === val2 || (numIsNaN(val1) && numIsNaN(val2)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/every.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/every.js new file mode 100644 index 00000000..892b5485 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/every.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")("every", true); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/filter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/filter.js new file mode 100644 index 00000000..c7dd969b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/filter.js @@ -0,0 +1,14 @@ +"use strict"; + +var callable = require("./valid-callable") + , forEach = require("./for-each") + , call = Function.prototype.call; + +module.exports = function (obj, cb /*, thisArg*/) { + var result = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, targetObj, index) { + if (call.call(cb, thisArg, value, key, targetObj, index)) result[key] = targetObj[key]; + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/find-key.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/find-key.js new file mode 100644 index 00000000..6da6ba6f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/find-key.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")(require("../array/#/find"), false); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/find.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/find.js new file mode 100644 index 00000000..5960421a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/find.js @@ -0,0 +1,10 @@ +"use strict"; + +var findKey = require("./find-key") + , isValue = require("./is-value"); + +// eslint-disable-next-line no-unused-vars +module.exports = function (obj, cb /*, thisArg, compareFn*/) { + var key = findKey.apply(this, arguments); + return isValue(key) ? obj[key] : key; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/first-key.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/first-key.js new file mode 100644 index 00000000..3666de57 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/first-key.js @@ -0,0 +1,13 @@ +"use strict"; + +var value = require("./valid-value") + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (obj) { + var i; + value(obj); + for (i in obj) { + if (objPropertyIsEnumerable.call(obj, i)) return i; + } + return null; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/flatten.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/flatten.js new file mode 100644 index 00000000..34e1ab09 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/flatten.js @@ -0,0 +1,17 @@ +"use strict"; + +var isPlainObject = require("./is-plain-object") + , forEach = require("./for-each") + + , process; + +process = function self(value, key) { + if (isPlainObject(value)) forEach(value, self, this); + else this[key] = value; +}; + +module.exports = function (obj) { + var flattened = {}; + forEach(obj, process, flattened); + return flattened; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/for-each.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/for-each.js new file mode 100644 index 00000000..d282956d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/for-each.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")("forEach"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/get-property-names.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/get-property-names.js new file mode 100644 index 00000000..7dfef279 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/get-property-names.js @@ -0,0 +1,17 @@ +"use strict"; + +var uniq = require("../array/#/uniq") + , value = require("./valid-value") + , push = Array.prototype.push + , getOwnPropertyNames = Object.getOwnPropertyNames + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (obj) { + var keys; + obj = Object(value(obj)); + keys = getOwnPropertyNames(obj); + while ((obj = getPrototypeOf(obj))) { + push.apply(keys, getOwnPropertyNames(obj)); + } + return uniq.call(keys); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/index.js new file mode 100644 index 00000000..13cfb95b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/index.js @@ -0,0 +1,70 @@ +"use strict"; + +module.exports = { + assign: require("./assign"), + assignDeep: require("./assign-deep"), + clear: require("./clear"), + compact: require("./compact"), + compare: require("./compare"), + copy: require("./copy"), + copyDeep: require("./copy-deep"), + count: require("./count"), + create: require("./create"), + ensureArray: require("./ensure-array"), + ensureFiniteNumber: require("./ensure-finite-number"), + ensureInteger: require("./ensure-integer"), + ensureNaturalNumber: require("./ensure-natural-number"), + ensureNaturalNumberValue: require("./ensure-natural-number-value"), + ensurePlainFunction: require("./ensure-plain-function"), + ensurePlainObject: require("./ensure-plain-object"), + ensurePromise: require("./ensure-promise"), + ensureThenable: require("./ensure-thenable"), + entries: require("./entries"), + eq: require("./eq"), + every: require("./every"), + filter: require("./filter"), + find: require("./find"), + findKey: require("./find-key"), + firstKey: require("./first-key"), + flatten: require("./flatten"), + forEach: require("./for-each"), + getPropertyNames: require("./get-property-names"), + is: require("./is"), + isArrayLike: require("./is-array-like"), + isCallable: require("./is-callable"), + isCopy: require("./is-copy"), + isCopyDeep: require("./is-copy-deep"), + isEmpty: require("./is-empty"), + isFiniteNumber: require("./is-finite-number"), + isInteger: require("./is-integer"), + isNaturalNumber: require("./is-natural-number"), + isNaturalNumberValue: require("./is-natural-number-value"), + isNumberValue: require("./is-number-value"), + isObject: require("./is-object"), + isPlainFunction: require("./is-plain-function"), + isPlainObject: require("./is-plain-object"), + isPromise: require("./is-promise"), + isThenable: require("./is-thenable"), + isValue: require("./is-value"), + keyOf: require("./key-of"), + keys: require("./keys"), + map: require("./map"), + mapKeys: require("./map-keys"), + normalizeOptions: require("./normalize-options"), + mixin: require("./mixin"), + mixinPrototypes: require("./mixin-prototypes"), + primitiveSet: require("./primitive-set"), + safeTraverse: require("./safe-traverse"), + serialize: require("./serialize"), + setPrototypeOf: require("./set-prototype-of"), + some: require("./some"), + toArray: require("./to-array"), + unserialize: require("./unserialize"), + validateArrayLike: require("./validate-array-like"), + validateArrayLikeObject: require("./validate-array-like-object"), + validCallable: require("./valid-callable"), + validObject: require("./valid-object"), + validateStringifiable: require("./validate-stringifiable"), + validateStringifiableValue: require("./validate-stringifiable-value"), + validValue: require("./valid-value") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-array-like.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-array-like.js new file mode 100644 index 00000000..fcb9115d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-array-like.js @@ -0,0 +1,17 @@ +"use strict"; + +var isFunction = require("../function/is-function") + , isObject = require("./is-object") + , isValue = require("./is-value"); + +module.exports = function (value) { + return ( + (isValue(value) && + typeof value.length === "number" && + // Just checking ((typeof x === 'object') && (typeof x !== 'function')) + // won't work right for some cases, e.g.: + // type of instance of NodeList in Safari is a 'function' + ((isObject(value) && !isFunction(value)) || typeof value === "string")) || + false + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-callable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-callable.js new file mode 100644 index 00000000..c55915bc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-callable.js @@ -0,0 +1,7 @@ +// Deprecated + +"use strict"; + +module.exports = function (obj) { + return typeof obj === "function"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-copy-deep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-copy-deep.js new file mode 100644 index 00000000..a1206aea --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-copy-deep.js @@ -0,0 +1,59 @@ +"use strict"; + +var eq = require("./eq") + , isPlainObject = require("./is-plain-object") + , value = require("./valid-value"); + +var isArray = Array.isArray + , keys = Object.keys + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable + , objHasOwnProperty = Object.prototype.hasOwnProperty + , eqArr + , eqVal + , eqObj; + +eqArr = function (arr1, arr2, recMap) { + var i, length = arr1.length; + if (length !== arr2.length) return false; + for (i = 0; i < length; ++i) { + if (objHasOwnProperty.call(arr1, i) !== objHasOwnProperty.call(arr2, i)) return false; + if (!eqVal(arr1[i], arr2[i], recMap)) return false; + } + return true; +}; + +eqObj = function (obj1, obj2, recMap) { + var k1 = keys(obj1), k2 = keys(obj2); + if (k1.length !== k2.length) return false; + return k1.every(function (key) { + if (!objPropertyIsEnumerable.call(obj2, key)) return false; + return eqVal(obj1[key], obj2[key], recMap); + }); +}; + +eqVal = function (val1, val2, recMap) { + var i, eqX, c1, c2; + if (eq(val1, val2)) return true; + if (isPlainObject(val1)) { + if (!isPlainObject(val2)) return false; + eqX = eqObj; + } else if (isArray(val1) && isArray(val2)) { + eqX = eqArr; + } else { + return false; + } + c1 = recMap[0]; + c2 = recMap[1]; + i = c1.indexOf(val1); + if (i === -1) { + i = c1.push(val1) - 1; + c2[i] = []; + } else if (c2[i].indexOf(val2) !== -1) return true; + c2[i].push(val2); + return eqX(val1, val2, recMap); +}; + +module.exports = function (val1, val2) { + if (eq(value(val1), value(val2))) return true; + return eqVal(Object(val1), Object(val2), [[], []]); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-copy.js new file mode 100644 index 00000000..8c6ae5e2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-copy.js @@ -0,0 +1,23 @@ +"use strict"; + +var eq = require("./eq") + , value = require("./valid-value") + , keys = Object.keys + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (val1, val2) { + var k1, k2; + + if (eq(value(val1), value(val2))) return true; + + val1 = Object(val1); + val2 = Object(val2); + + k1 = keys(val1); + k2 = keys(val2); + if (k1.length !== k2.length) return false; + return k1.every(function (key) { + if (!objPropertyIsEnumerable.call(val2, key)) return false; + return eq(val1[key], val2[key]); + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-empty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-empty.js new file mode 100644 index 00000000..dbc52d0c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-empty.js @@ -0,0 +1,14 @@ +"use strict"; + +var value = require("./valid-value") + , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (obj) { + var i; + value(obj); + for (i in obj) { + // Jslint: ignore + if (objPropertyIsEnumerable.call(obj, i)) return false; + } + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-finite-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-finite-number.js new file mode 100644 index 00000000..78ed6692 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-finite-number.js @@ -0,0 +1,7 @@ +"use strict"; + +var isNumber = require("./is-number-value"); + +module.exports = function (value) { + return isNumber(value) && isFinite(value); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-integer.js new file mode 100644 index 00000000..1745b829 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-integer.js @@ -0,0 +1,10 @@ +"use strict"; + +var isInteger = require("../number/is-integer") + , isValue = require("./is-value"); + +module.exports = function (arg) { + if (!isValue(arg)) return false; + arg = Number(arg); + return isInteger(arg); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-natural-number-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-natural-number-value.js new file mode 100644 index 00000000..c7445218 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-natural-number-value.js @@ -0,0 +1,9 @@ +"use strict"; + +var isNaturalNumber = require("./is-natural-number") + , isValue = require("./is-value"); + +module.exports = function (arg) { + if (!isValue(arg)) return false; + return isNaturalNumber(arg); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-natural-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-natural-number.js new file mode 100644 index 00000000..37d74586 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-natural-number.js @@ -0,0 +1,7 @@ +"use strict"; + +var isNatural = require("../number/is-natural"); + +module.exports = function (arg) { + return isNatural(Number(arg)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-number-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-number-value.js new file mode 100644 index 00000000..e9152768 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-number-value.js @@ -0,0 +1,12 @@ +"use strict"; + +var isValue = require("./is-value"); + +module.exports = function (value) { + if (!isValue(value)) return false; + try { + return !isNaN(value); + } catch (e) { + return false; + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-object.js new file mode 100644 index 00000000..846ae217 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-object.js @@ -0,0 +1,9 @@ +"use strict"; + +var isValue = require("./is-value"); + +var map = { function: true, object: true }; + +module.exports = function (value) { + return (isValue(value) && map[typeof value]) || false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-plain-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-plain-function.js new file mode 100644 index 00000000..a2f32348 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-plain-function.js @@ -0,0 +1,11 @@ +"use strict"; + +var isClassStr = RegExp.prototype.test.bind(/^\s*class[\s{/}]/) + , fnToString = Function.prototype.toString; + +module.exports = function (fn) { + if (typeof fn !== "function") return false; + if (typeof fn.call !== "function") return false; + if (typeof fn.apply !== "function") return false; + return !isClassStr(fnToString.call(fn)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-plain-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-plain-object.js new file mode 100644 index 00000000..ff153289 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-plain-object.js @@ -0,0 +1,20 @@ +"use strict"; + +var getPrototypeOf = Object.getPrototypeOf + , prototype = Object.prototype + , objToString = prototype.toString + , id = Object().toString(); + +module.exports = function (value) { + var proto, valueConstructor; + if (!value || typeof value !== "object" || objToString.call(value) !== id) { + return false; + } + proto = getPrototypeOf(value); + if (proto === null) { + valueConstructor = value.constructor; + if (typeof valueConstructor !== "function") return true; + return valueConstructor.prototype !== value; + } + return proto === prototype || getPrototypeOf(proto) === null; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-promise.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-promise.js new file mode 100644 index 00000000..33d6df13 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-promise.js @@ -0,0 +1,4 @@ +"use strict"; + +// In next major this check will also confirm on promise constructor +module.exports = require("./is-thenable"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-thenable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-thenable.js new file mode 100644 index 00000000..a37bffb6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-thenable.js @@ -0,0 +1,8 @@ +"use strict"; + +var isCallable = require("./is-callable") + , isObject = require("./is-object"); + +module.exports = function (value) { + return isObject(value) && isCallable(value.then); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-value.js new file mode 100644 index 00000000..82af8f33 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is-value.js @@ -0,0 +1,7 @@ +"use strict"; + +var _undefined = require("../function/noop")(); // Support ES3 engines + +module.exports = function (val) { + return (val !== _undefined) && (val !== null); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is.js new file mode 100644 index 00000000..54baadec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/is.js @@ -0,0 +1,10 @@ +// Implementation credits go to: +// http://wiki.ecmascript.org/doku.php?id=harmony:egal + +"use strict"; + +var numIsNaN = require("../number/is-nan"); + +module.exports = function (val1, val2) { + return val1 === val2 ? val1 !== 0 || 1 / val1 === 1 / val2 : numIsNaN(val1) && numIsNaN(val2); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/key-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/key-of.js new file mode 100644 index 00000000..dc640e4d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/key-of.js @@ -0,0 +1,17 @@ +"use strict"; + +var eq = require("./eq") + , some = require("./some"); + +module.exports = function (obj, searchValue) { + var result; + return some(obj, function (value, name) { + if (eq(value, searchValue)) { + result = name; + return true; + } + return false; + }) + ? result + : null; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/implement.js new file mode 100644 index 00000000..72ecfbdf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Object, "keys", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/index.js new file mode 100644 index 00000000..d1942279 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Object.keys : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/is-implemented.js new file mode 100644 index 00000000..2dfcf1b9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/is-implemented.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function () { + try { + Object.keys("primitive"); + return true; + } catch (e) { + return false; + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/shim.js new file mode 100644 index 00000000..a8908d5c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/keys/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +var isValue = require("../is-value"); + +var keys = Object.keys; + +module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/map-keys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/map-keys.js new file mode 100644 index 00000000..72dada07 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/map-keys.js @@ -0,0 +1,18 @@ +"use strict"; + +var callable = require("./valid-callable") + , forEach = require("./for-each") + , call = Function.prototype.call; + +module.exports = function (obj, cb /*, thisArg*/) { + var result = {}, thisArg = arguments[2]; + callable(cb); + forEach( + obj, + function (value, key, targetObj, index) { + result[call.call(cb, thisArg, key, value, this, index)] = value; + }, + obj + ); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/map.js new file mode 100644 index 00000000..7b718db1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/map.js @@ -0,0 +1,14 @@ +"use strict"; + +var callable = require("./valid-callable") + , forEach = require("./for-each") + , call = Function.prototype.call; + +module.exports = function (obj, cb /*, thisArg*/) { + var result = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, targetObj, index) { + result[key] = call.call(cb, thisArg, value, key, targetObj, index); + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/mixin-prototypes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/mixin-prototypes.js new file mode 100644 index 00000000..81e27c75 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/mixin-prototypes.js @@ -0,0 +1,25 @@ +"use strict"; + +var value = require("./valid-value") + , mixin = require("./mixin"); + +var getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (target, source) { + target = Object(value(target)); + source = Object(value(source)); + if (target === source) return target; + + var sources = []; + while (source && !isPrototypeOf.call(source, target)) { + sources.unshift(source); + source = getPrototypeOf(source); + } + + var error; + sources.forEach(function (sourceProto) { + try { mixin(target, sourceProto); } catch (mixinError) { error = mixinError; } + }); + if (error) throw error; + return target; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/mixin.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/mixin.js new file mode 100644 index 00000000..4da7cd51 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/mixin.js @@ -0,0 +1,31 @@ +"use strict"; + +var value = require("./valid-value") + + , defineProperty = Object.defineProperty + , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor + , getOwnPropertyNames = Object.getOwnPropertyNames + , getOwnPropertySymbols = Object.getOwnPropertySymbols; + +module.exports = function (target, source) { + var error, sourceObject = Object(value(source)); + target = Object(value(target)); + getOwnPropertyNames(sourceObject).forEach(function (name) { + try { + defineProperty(target, name, getOwnPropertyDescriptor(source, name)); + } catch (e) { + error = e; +} + }); + if (typeof getOwnPropertySymbols === "function") { + getOwnPropertySymbols(sourceObject).forEach(function (symbol) { + try { + defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol)); + } catch (e) { + error = e; +} + }); + } + if (error !== undefined) throw error; + return target; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/normalize-options.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/normalize-options.js new file mode 100644 index 00000000..6c394fe9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/normalize-options.js @@ -0,0 +1,20 @@ +"use strict"; + +var isValue = require("./is-value"); + +var forEach = Array.prototype.forEach, create = Object.create; + +var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; +}; + +// eslint-disable-next-line no-unused-vars +module.exports = function (opts1 /*, …options*/) { + var result = create(null); + forEach.call(arguments, function (options) { + if (!isValue(options)) return; + process(Object(options), result); + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/primitive-set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/primitive-set.js new file mode 100644 index 00000000..235eaa7f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/primitive-set.js @@ -0,0 +1,12 @@ +"use strict"; + +var forEach = Array.prototype.forEach, create = Object.create; + +// eslint-disable-next-line no-unused-vars +module.exports = function (arg /*, …args*/) { + var set = create(null); + forEach.call(arguments, function (name) { + set[name] = true; + }); + return set; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/safe-traverse.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/safe-traverse.js new file mode 100644 index 00000000..7b72d555 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/safe-traverse.js @@ -0,0 +1,16 @@ +"use strict"; + +var value = require("./valid-value") + , isValue = require("./is-value"); + +module.exports = function (obj /*, …names*/) { + var length, current = 1; + value(obj); + length = arguments.length - 1; + if (!length) return obj; + while (current < length) { + obj = obj[arguments[current++]]; + if (!isValue(obj)) return undefined; + } + return obj[arguments[current]]; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/serialize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/serialize.js new file mode 100644 index 00000000..4be9aeb1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/serialize.js @@ -0,0 +1,41 @@ +"use strict"; + +var toArray = require("./to-array") + , isDate = require("../date/is-date") + , isValue = require("../object/is-value") + , isRegExp = require("../reg-exp/is-reg-exp"); + +var isArray = Array.isArray + , stringify = JSON.stringify + , objHasOwnProperty = Object.prototype.hasOwnProperty; +var keyValueToString = function (value, key) { + return stringify(key) + ":" + exports(value); +}; + +var sparseMap = function (arr) { + var i, length = arr.length, result = new Array(length); + for (i = 0; i < length; ++i) { + if (!objHasOwnProperty.call(arr, i)) continue; + result[i] = exports(arr[i]); + } + return result; +}; + +module.exports = exports = function (obj) { + if (!isValue(obj)) return String(obj); + switch (typeof obj) { + case "string": + return stringify(obj); + case "number": + case "boolean": + case "function": + return String(obj); + case "object": + if (isArray(obj)) return "[" + sparseMap(obj) + "]"; + if (isRegExp(obj)) return String(obj); + if (isDate(obj)) return "new Date(" + obj.valueOf() + ")"; + return "{" + toArray(obj, keyValueToString) + "}"; + default: + throw new TypeError("Serialization of " + String(obj) + "is unsupported"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/implement.js new file mode 100644 index 00000000..1b91aeba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +var shim; + +if (!require("./is-implemented")() && (shim = require("./shim"))) { + Object.defineProperty(Object, "setPrototypeOf", + { value: shim, configurable: true, enumerable: false, writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/index.js new file mode 100644 index 00000000..e035173f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? Object.setPrototypeOf + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/is-implemented.js new file mode 100644 index 00000000..1a00627b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {}; + +module.exports = function (/* CustomCreate*/) { + var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create; + if (typeof setPrototypeOf !== "function") return false; + return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/shim.js new file mode 100644 index 00000000..bc217844 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/set-prototype-of/shim.js @@ -0,0 +1,86 @@ +/* eslint no-proto: "off" */ + +// Big thanks to @WebReflection for sorting this out +// https://gist.github.com/WebReflection/5593554 + +"use strict"; + +var isObject = require("../is-object") + , value = require("../valid-value") + , objIsPrototypeOf = Object.prototype.isPrototypeOf + , defineProperty = Object.defineProperty + , nullDesc = { + configurable: true, + enumerable: false, + writable: true, + value: undefined +} + , validate; + +validate = function (obj, prototype) { + value(obj); + if (prototype === null || isObject(prototype)) return obj; + throw new TypeError("Prototype must be null or an object"); +}; + +module.exports = (function (status) { + var fn, set; + if (!status) return null; + if (status.level === 2) { + if (status.set) { + set = status.set; + fn = function (obj, prototype) { + set.call(validate(obj, prototype), prototype); + return obj; + }; + } else { + fn = function (obj, prototype) { + validate(obj, prototype).__proto__ = prototype; + return obj; + }; + } + } else { + fn = function self(obj, prototype) { + var isNullBase; + validate(obj, prototype); + isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj); + if (isNullBase) delete self.nullPolyfill.__proto__; + if (prototype === null) prototype = self.nullPolyfill; + obj.__proto__ = prototype; + if (isNullBase) defineProperty(self.nullPolyfill, "__proto__", nullDesc); + return obj; + }; + } + return Object.defineProperty(fn, "level", { + configurable: false, + enumerable: false, + writable: false, + value: status.level + }); +}( + (function () { + var tmpObj1 = Object.create(null) + , tmpObj2 = {} + , set + , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__"); + + if (desc) { + try { + set = desc.set; // Opera crashes at this point + set.call(tmpObj1, tmpObj2); + } catch (ignore) {} + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { set: set, level: 2 }; + } + + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 2 }; + + tmpObj1 = {}; + tmpObj1.__proto__ = tmpObj2; + if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 1 }; + + return false; + })() +)); + +require("../create"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/some.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/some.js new file mode 100644 index 00000000..c919466b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/some.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./_iterate")("some", false); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/to-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/to-array.js new file mode 100644 index 00000000..6ed50a8e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/to-array.js @@ -0,0 +1,24 @@ +"use strict"; + +var callable = require("./valid-callable") + , isValue = require("./is-value") + , forEach = require("./for-each") + , call = Function.prototype.call + , defaultCb = function (value, key) { + return [key, value]; +}; + +module.exports = function (obj /*, cb, thisArg, compareFn*/) { + var a = [], cb = arguments[1], thisArg = arguments[2]; + cb = isValue(cb) ? callable(cb) : defaultCb; + + forEach( + obj, + function (value, key, targetObj, index) { + a.push(call.call(cb, thisArg, value, key, this, index)); + }, + obj, + arguments[3] + ); + return a; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/unserialize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/unserialize.js new file mode 100644 index 00000000..75745143 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/unserialize.js @@ -0,0 +1,8 @@ +"use strict"; + +var value = require("./valid-value"); + +module.exports = exports = function (code) { + // eslint-disable-next-line no-new-func + return new Function("return " + value(code))(); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-callable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-callable.js new file mode 100644 index 00000000..a97fb3ea --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-callable.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (fn) { + if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); + return fn; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-object.js new file mode 100644 index 00000000..74b5e5f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-object.js @@ -0,0 +1,8 @@ +"use strict"; + +var isObject = require("./is-object"); + +module.exports = function (value) { + if (!isObject(value)) throw new TypeError(value + " is not an Object"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-value.js new file mode 100644 index 00000000..d0ced8a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/valid-value.js @@ -0,0 +1,8 @@ +"use strict"; + +var isValue = require("./is-value"); + +module.exports = function (value) { + if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-array-like-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-array-like-object.js new file mode 100644 index 00000000..d7c45b36 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-array-like-object.js @@ -0,0 +1,9 @@ +"use strict"; + +var isArrayLike = require("./is-array-like") + , isObject = require("./is-object"); + +module.exports = function (obj) { + if (isObject(obj) && isArrayLike(obj)) return obj; + throw new TypeError(obj + " is not array-like object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-array-like.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-array-like.js new file mode 100644 index 00000000..07aa7949 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-array-like.js @@ -0,0 +1,8 @@ +"use strict"; + +var isArrayLike = require("./is-array-like"); + +module.exports = function (obj) { + if (isArrayLike(obj)) return obj; + throw new TypeError(obj + " is not array-like value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-stringifiable-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-stringifiable-value.js new file mode 100644 index 00000000..5f470428 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-stringifiable-value.js @@ -0,0 +1,8 @@ +"use strict"; + +var ensureValue = require("./valid-value") + , stringifiable = require("./validate-stringifiable"); + +module.exports = function (value) { + return stringifiable(ensureValue(value)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-stringifiable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-stringifiable.js new file mode 100644 index 00000000..2b1f1271 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/object/validate-stringifiable.js @@ -0,0 +1,12 @@ +"use strict"; + +var isCallable = require("./is-callable"); + +module.exports = function (stringifiable) { + try { + if (stringifiable && isCallable(stringifiable.toString)) return stringifiable.toString(); + return String(stringifiable); + } catch (e) { + throw new TypeError("Passed argument cannot be stringifed"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/optional-chaining.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/optional-chaining.js new file mode 100644 index 00000000..f1811279 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/optional-chaining.js @@ -0,0 +1,12 @@ +"use strict"; + +var isValue = require("./object/is-value"); + +var slice = Array.prototype.slice; + +// eslint-disable-next-line no-unused-vars +module.exports = function (value, propertyName1 /*, …propertyNamen*/) { + var propertyNames = slice.call(arguments, 1), index = 0, length = propertyNames.length; + while (isValue(value) && index < length) value = value[propertyNames[index++]]; + return index === length ? value : undefined; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/package.json new file mode 100644 index 00000000..87899637 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/package.json @@ -0,0 +1,132 @@ +{ + "_from": "es5-ext@~0.10.14", + "_id": "es5-ext@0.10.50", + "_inBundle": false, + "_integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", + "_location": "/node-red-contrib-johnny-five/es5-ext", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es5-ext@~0.10.14", + "name": "es5-ext", + "escapedName": "es5-ext", + "rawSpec": "~0.10.14", + "saveSpec": null, + "fetchSpec": "~0.10.14" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/d", + "/node-red-contrib-johnny-five/es6-iterator", + "/node-red-contrib-johnny-five/es6-map", + "/node-red-contrib-johnny-five/es6-set", + "/node-red-contrib-johnny-five/es6-symbol", + "/node-red-contrib-johnny-five/event-emitter" + ], + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", + "_shasum": "6d0e23a0abdb27018e5ac4fd09b412bc5517a778", + "_spec": "es5-ext@~0.10.14", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/es6-map", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es5-ext/issues" + }, + "bundleDependencies": false, + "dependencies": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "^1.0.0" + }, + "deprecated": false, + "description": "ECMAScript extensions and shims", + "devDependencies": { + "eslint": "^5.16.0", + "eslint-config-medikoo-es5": "^2.0.0", + "git-list-updated": "^1.1.2", + "husky": "^2.1.0", + "lint-staged": "^8.1.5", + "plain-promise": "^0.1.1", + "prettier-elastic": "^1.17.0", + "tad": "^2.0.1" + }, + "eslintConfig": { + "extends": "medikoo-es5", + "root": true, + "rules": { + "no-extend-native": "off" + }, + "overrides": [ + { + "files": "global.js", + "globals": { + "__global__": true + }, + "rules": { + "strict": "off" + } + } + ] + }, + "homepage": "https://github.com/medikoo/es5-ext#readme", + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "keywords": [ + "ecmascript", + "ecmascript5", + "ecmascript6", + "es5", + "es6", + "extensions", + "ext", + "addons", + "extras", + "harmony", + "javascript", + "polyfill", + "shim", + "util", + "utils", + "utilities" + ], + "license": "ISC", + "lint-staged": { + "*.js": [ + "eslint" + ], + "*.{css,html,js,json,md,yaml,yml}": [ + "prettier -c" + ] + }, + "name": "es5-ext", + "prettier": { + "printWidth": 100, + "tabWidth": 4, + "overrides": [ + { + "files": "*.md", + "options": { + "tabWidth": 2 + } + } + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es5-ext.git" + }, + "scripts": { + "lint": "eslint --ignore-path=.gitignore .", + "lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'", + "prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c", + "prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "0.10.50" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/as-callback.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/as-callback.js new file mode 100644 index 00000000..5b61d1ba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/as-callback.js @@ -0,0 +1,19 @@ +"use strict"; + +var ensurePlainFunction = require("../../object/ensure-plain-function") + , ensureThenable = require("../../object/ensure-thenable") + , microtaskDelay = require("../../function/#/microtask-delay"); + +module.exports = function (callback) { + ensureThenable(this); + ensurePlainFunction(callback); + // Rely on microtaskDelay to escape eventual error swallowing + this.then( + microtaskDelay.call(function (value) { + callback(null, value); + }), + microtaskDelay.call(function (reason) { + callback(reason); + }) + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/implement.js new file mode 100644 index 00000000..77592b3a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/implement.js @@ -0,0 +1,10 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(Promise.prototype, "finally", { + value: require("./shim"), + configurable: true, + enumerable: false, + writable: true + }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/index.js new file mode 100644 index 00000000..f6bb447f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./is-implemented")() ? Promise.prototype.finally : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/is-implemented.js new file mode 100644 index 00000000..0534ce6b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + if (typeof Promise !== "function") return false; + if (typeof Promise.prototype.finally !== "function") return false; + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/shim.js new file mode 100644 index 00000000..f29f5b31 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/finally/shim.js @@ -0,0 +1,24 @@ +"use strict"; + +var ensurePlainFunction = require("../../../object/ensure-plain-function") + , isThenable = require("../../../object/is-thenable") + , ensureThenable = require("../../../object/ensure-thenable"); + +var resolveCallback = function (callback, next) { + var callbackResult = callback(); + if (!isThenable(callbackResult)) return next(); + return callbackResult.then(next); +}; + +module.exports = function (callback) { + ensureThenable(this); + ensurePlainFunction(callback); + return this.then( + function (result) { + return resolveCallback(callback, function () { return result; }); + }, + function (error) { + return resolveCallback(callback, function () { throw error; }); + } + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/index.js new file mode 100644 index 00000000..46018030 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/#/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = { asCallback: require("./as-callback"), finally: require("./finally") }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/.eslintrc.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/.eslintrc.json new file mode 100644 index 00000000..fd5e0e9d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "globals": { "Promise": true } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/index.js new file mode 100644 index 00000000..6232b418 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "lazy": require("./lazy") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/lazy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/lazy.js new file mode 100644 index 00000000..9611ef1d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/promise/lazy.js @@ -0,0 +1,38 @@ +"use strict"; + +var isFunction = require("../function/is-function"); + +module.exports = function (executor) { + var Constructor; + if (isFunction(this)) { + Constructor = this; + } else if (typeof Promise === "function") { + Constructor = Promise; + } else { + throw new TypeError("Could not resolve Promise constuctor"); + } + + var lazyThen; + var promise = new Constructor(function (resolve, reject) { + lazyThen = function (onSuccess, onFailure) { + if (!hasOwnProperty.call(this, "then")) { + // Sanity check + throw new Error("Unexpected (inherited) lazy then invocation"); + } + + try { + executor(resolve, reject); + } catch (reason) { + reject(reason); + } + delete this.then; + return this.then(onSuccess, onFailure); + }; + }); + + return Object.defineProperty(promise, "then", { + configurable: true, + writable: true, + value: lazyThen + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/index.js new file mode 100644 index 00000000..9b098e0e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/index.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = { + isSticky: require("./is-sticky"), + isUnicode: require("./is-unicode"), + match: require("./match"), + replace: require("./replace"), + search: require("./search"), + split: require("./split") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/is-sticky.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/is-sticky.js new file mode 100644 index 00000000..2d4bb2a6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/is-sticky.js @@ -0,0 +1,9 @@ +"use strict"; + +var validRegExp = require("../valid-reg-exp") + + , re = /\/[a-xz]*y[a-xz]*$/; + +module.exports = function () { + return Boolean(String(validRegExp(this)).match(re)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/is-unicode.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/is-unicode.js new file mode 100644 index 00000000..4c1ad9e2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/is-unicode.js @@ -0,0 +1,9 @@ +"use strict"; + +var validRegExp = require("../valid-reg-exp") + + , re = /\/[a-xz]*u[a-xz]*$/; + +module.exports = function () { + return Boolean(String(validRegExp(this)).match(re)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/implement.js new file mode 100644 index 00000000..ba89bcec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "match", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/index.js new file mode 100644 index 00000000..b74d2f29 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? RegExp.prototype.match + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/is-implemented.js new file mode 100644 index 00000000..a5065fc7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /foo/; + +module.exports = function () { + if (typeof re.match !== "function") return false; + return re.match("barfoobar") && !re.match("elo"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/shim.js new file mode 100644 index 00000000..29558218 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/match/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string) { + validRegExp(this); + return String(string).match(this); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/implement.js new file mode 100644 index 00000000..0db82917 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "replace", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/index.js new file mode 100644 index 00000000..41ff4ba0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? RegExp.prototype.replace + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js new file mode 100644 index 00000000..0a2e7c2f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /foo/; + +module.exports = function () { + if (typeof re.replace !== "function") return false; + return re.replace("foobar", "mar") === "marbar"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/shim.js new file mode 100644 index 00000000..66f5d5b7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/replace/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string, replaceValue) { + validRegExp(this); + return String(string).replace(this, replaceValue); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/implement.js new file mode 100644 index 00000000..34452615 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "search", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/index.js new file mode 100644 index 00000000..a17213e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? RegExp.prototype.search + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/is-implemented.js new file mode 100644 index 00000000..7f38669f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /foo/; + +module.exports = function () { + if (typeof re.search !== "function") return false; + return re.search("barfoo") === 3; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/shim.js new file mode 100644 index 00000000..c97a7873 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/search/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string) { + validRegExp(this); + return String(string).search(this); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/implement.js new file mode 100644 index 00000000..d94acdd8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "split", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/index.js new file mode 100644 index 00000000..7942f452 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? RegExp.prototype.split + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/is-implemented.js new file mode 100644 index 00000000..90fca0cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var re = /\|/; + +module.exports = function () { + if (typeof re.split !== "function") return false; + return re.split("bar|foo")[1] === "foo"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/shim.js new file mode 100644 index 00000000..c9c73cce --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/split/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var validRegExp = require("../../valid-reg-exp"); + +module.exports = function (string) { + validRegExp(this); + return String(string).split(this); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/sticky/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/sticky/implement.js new file mode 100644 index 00000000..f636890f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/sticky/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +var isSticky = require("../is-sticky"); + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "sticky", { configurable: true, + enumerable: false, +get: isSticky }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js new file mode 100644 index 00000000..a1ade111 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return "sticky" in dummyRegExp; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/unicode/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/unicode/implement.js new file mode 100644 index 00000000..a5fb2036 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/unicode/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +var isUnicode = require("../is-unicode"); + +if (!require("./is-implemented")()) { + Object.defineProperty(RegExp.prototype, "unicode", { configurable: true, + enumerable: false, +get: isUnicode }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js new file mode 100644 index 00000000..48605d72 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return "unicode" in dummyRegExp; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/escape.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/escape.js new file mode 100644 index 00000000..964e3c61 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/escape.js @@ -0,0 +1,11 @@ +// Thanks to Andrew Clover: +// http://stackoverflow.com/questions/3561493 +// /is-there-a-regexp-escape-function-in-javascript + +"use strict"; + +var re = /[-/\\^$*+?.()|[\]{}]/g; + +module.exports = function (str) { + return String(str).replace(re, "\\$&"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/index.js new file mode 100644 index 00000000..f023fe03 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/index.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "escape": require("./escape"), + "isRegExp": require("./is-reg-exp"), + "validRegExp": require("./valid-reg-exp") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/is-reg-exp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/is-reg-exp.js new file mode 100644 index 00000000..b966b0f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/is-reg-exp.js @@ -0,0 +1,7 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(/a/); + +module.exports = function (value) { + return (value && (value instanceof RegExp || objToString.call(value) === id)) || false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/valid-reg-exp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/valid-reg-exp.js new file mode 100644 index 00000000..a05927a7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/reg-exp/valid-reg-exp.js @@ -0,0 +1,8 @@ +"use strict"; + +var isRegExp = require("./is-reg-exp"); + +module.exports = function (value) { + if (!isRegExp(value)) throw new TypeError(value + " is not a RegExp object"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/safe-to-string.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/safe-to-string.js new file mode 100644 index 00000000..f49a238a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/safe-to-string.js @@ -0,0 +1,12 @@ +"use strict"; + +var isCallable = require("./object/is-callable"); + +module.exports = function (value) { + try { + if (value && isCallable(value.toString)) return value.toString(); + return String(value); + } catch (e) { + return ""; + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/implement.js new file mode 100644 index 00000000..ab85d7c7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/implement.js @@ -0,0 +1,6 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, require("es6-symbol").iterator, + { value: require("./shim"), configurable: true, enumerable: false, writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/index.js new file mode 100644 index 00000000..b2bd1e86 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype[require("es6-symbol").iterator] : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..bb8a8d6e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/is-implemented.js @@ -0,0 +1,16 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function () { + var str = "🙈f", iterator, result; + if (typeof str[iteratorSymbol] !== "function") return false; + iterator = str[iteratorSymbol](); + if (!iterator) return false; + if (typeof iterator.next !== "function") return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== "🙈") return false; + if (result.done !== false) return false; + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/shim.js new file mode 100644 index 00000000..1eafee27 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/@@iterator/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +var StringIterator = require("es6-iterator/string") + , value = require("../../../object/valid-value"); + +module.exports = function () { + return new StringIterator(value(this)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/at.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/at.js new file mode 100644 index 00000000..a8c29179 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/at.js @@ -0,0 +1,35 @@ +// Based on: https://github.com/mathiasbynens/String.prototype.at +// Thanks @mathiasbynens ! + +"use strict"; + +var toInteger = require("../../number/to-integer") + , validValue = require("../../object/valid-value"); + +module.exports = function (pos) { + var str = String(validValue(this)), size = str.length, cuFirst, cuSecond, nextPos, len; + pos = toInteger(pos); + + // Account for out-of-bounds indices + // The odd lower bound is because the ToInteger operation is + // going to round `n` to `0` for `-1 < n <= 0`. + if (pos <= -1 || pos >= size) return ""; + + // Second half of `ToInteger` + // eslint-disable-next-line no-bitwise + pos |= 0; + // Get the first code unit and code unit value + cuFirst = str.charCodeAt(pos); + nextPos = pos + 1; + len = 1; + if ( + // Check if it’s the start of a surrogate pair + cuFirst >= 0xd800 && + cuFirst <= 0xdbff && // High surrogate + size > nextPos // There is a next code unit + ) { + cuSecond = str.charCodeAt(nextPos); + if (cuSecond >= 0xdc00 && cuSecond <= 0xdfff) len = 2; // Low surrogate + } + return str.slice(pos, pos + len); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/camel-to-hyphen.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/camel-to-hyphen.js new file mode 100644 index 00000000..002dfd0b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/camel-to-hyphen.js @@ -0,0 +1,10 @@ +"use strict"; + +var replace = String.prototype.replace + , re = /([A-Z])/g; + +module.exports = function () { + var str = replace.call(this, re, "-$1").toLowerCase(); + if (str[0] === "-") str = str.slice(1); + return str; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/capitalize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/capitalize.js new file mode 100644 index 00000000..fc92a9fb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/capitalize.js @@ -0,0 +1,8 @@ +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function () { + var str = String(value(this)); + return str.charAt(0).toUpperCase() + str.slice(1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/case-insensitive-compare.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/case-insensitive-compare.js new file mode 100644 index 00000000..5d961a5e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/case-insensitive-compare.js @@ -0,0 +1,7 @@ +"use strict"; + +var toLowerCase = String.prototype.toLowerCase; + +module.exports = function (other) { + return toLowerCase.call(this).localeCompare(toLowerCase.call(String(other))); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/implement.js new file mode 100644 index 00000000..f1dc80a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "codePointAt", + { value: require("./shim"), +configurable: true, +enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/index.js new file mode 100644 index 00000000..33d45c9f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype.codePointAt + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/is-implemented.js new file mode 100644 index 00000000..7da785f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "abc\uD834\uDF06def"; + +module.exports = function () { + if (typeof str.codePointAt !== "function") return false; + return str.codePointAt(3) === 0x1D306; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/shim.js new file mode 100644 index 00000000..0f331c3f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/code-point-at/shim.js @@ -0,0 +1,26 @@ +// Based on: https://github.com/mathiasbynens/String.prototype.codePointAt +// Thanks @mathiasbynens ! + +"use strict"; + +var toInteger = require("../../../number/to-integer") + , validValue = require("../../../object/valid-value"); + +module.exports = function (pos) { + var str = String(validValue(this)), length = str.length, first, second; + pos = toInteger(pos); + + // Account for out-of-bounds indices: + if (pos < 0 || pos >= length) return undefined; + + // Get the first code unit + first = str.charCodeAt(pos); + if (first >= 0xd800 && first <= 0xdbff && length > pos + 1) { + second = str.charCodeAt(pos + 1); + if (second >= 0xdc00 && second <= 0xdfff) { + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; + } + } + return first; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/implement.js new file mode 100644 index 00000000..395acea2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "contains", + { value: require("./shim"), +configurable: true, +enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/index.js new file mode 100644 index 00000000..4f6a0714 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype.contains + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/is-implemented.js new file mode 100644 index 00000000..c270bb1a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.contains !== "function") return false; + return (str.contains("dwa") === true) && (str.contains("foo") === false); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/shim.js new file mode 100644 index 00000000..a7219f2e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/contains/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +var indexOf = String.prototype.indexOf; + +module.exports = function (searchString/*, position*/) { + return indexOf.call(this, searchString, arguments[1]) > -1; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/count.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/count.js new file mode 100644 index 00000000..76070136 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/count.js @@ -0,0 +1,15 @@ +"use strict"; + +var ensureString = require("../../object/validate-stringifiable-value"); + +module.exports = function (search) { + var string = ensureString(this), count = 0, index = 0; + + search = ensureString(search); + if (!search) throw new TypeError("Search string cannot be empty"); + while ((index = string.indexOf(search, index)) !== -1) { + ++count; + index += search.length; + } + return count; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/implement.js new file mode 100644 index 00000000..19e5b86b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "endsWith", + { value: require("./shim"), +configurable: true, +enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/index.js new file mode 100644 index 00000000..952ed0ce --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype.endsWith + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/is-implemented.js new file mode 100644 index 00000000..fce38eb8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.endsWith !== "function") return false; + return (str.endsWith("trzy") === true) && (str.endsWith("raz") === false); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/shim.js new file mode 100644 index 00000000..c5371aa9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/ends-with/shim.js @@ -0,0 +1,18 @@ +"use strict"; + +var toInteger = require("../../../number/to-integer") + , value = require("../../../object/valid-value") + , isValue = require("../../../object/is-value") + , min = Math.min + , max = Math.max; + +module.exports = function (searchString /*, endPosition*/) { + var self, start, endPos; + self = String(value(this)); + searchString = String(searchString); + endPos = arguments[1]; + start = + (isValue(endPos) ? min(max(toInteger(endPos), 0), self.length) : self.length) - + searchString.length; + return start < 0 ? false : self.indexOf(searchString, start) === start; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/hyphen-to-camel.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/hyphen-to-camel.js new file mode 100644 index 00000000..20a5105c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/hyphen-to-camel.js @@ -0,0 +1,10 @@ +"use strict"; + +var replace = String.prototype.replace, re = /-([a-z0-9])/g; +var toUpperCase = function (ignored, a) { + return a.toUpperCase(); +}; + +module.exports = function () { + return replace.call(this, re, toUpperCase); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/indent.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/indent.js new file mode 100644 index 00000000..df8869db --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/indent.js @@ -0,0 +1,12 @@ +"use strict"; + +var isValue = require("../../object/is-value") + , repeat = require("./repeat") + , replace = String.prototype.replace + , re = /(\r\n|[\n\r\u2028\u2029])([\u0000-\u0009\u000b-\uffff]+)/g; + +module.exports = function (indent /*, count*/) { + var count = arguments[1]; + indent = repeat.call(String(indent), isValue(count) ? count : 1); + return indent + replace.call(this, re, "$1" + indent + "$2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/index.js new file mode 100644 index 00000000..23444897 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/index.js @@ -0,0 +1,23 @@ +"use strict"; + +module.exports = { + "@@iterator": require("./@@iterator"), + "at": require("./at"), + "count": require("./count"), + "camelToHyphen": require("./camel-to-hyphen"), + "capitalize": require("./capitalize"), + "caseInsensitiveCompare": require("./case-insensitive-compare"), + "codePointAt": require("./code-point-at"), + "contains": require("./contains"), + "hyphenToCamel": require("./hyphen-to-camel"), + "endsWith": require("./ends-with"), + "indent": require("./indent"), + "last": require("./last"), + "normalize": require("./normalize"), + "pad": require("./pad"), + "plainReplace": require("./plain-replace"), + "plainReplaceAll": require("./plain-replace-all"), + "repeat": require("./repeat"), + "startsWith": require("./starts-with"), + "uncapitalize": require("./uncapitalize") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/last.js new file mode 100644 index 00000000..f5c957fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/last.js @@ -0,0 +1,8 @@ +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function () { + var self = String(value(this)), length = self.length; + return length ? self[length - 1] : null; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/_data.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/_data.js new file mode 100644 index 00000000..356d5a6a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/_data.js @@ -0,0 +1,7203 @@ +/* eslint max-lines: "off", no-sparse-arrays: "off", comma-style: "off" */ + +"use strict"; + +module.exports = { + 0: { + 60: [, , { 824: 8814 }], + 61: [, , { 824: 8800 }], + 62: [, , { 824: 8815 }], + 65: [ + , + , + { + 768: 192, + 769: 193, + 770: 194, + 771: 195, + 772: 256, + 774: 258, + 775: 550, + 776: 196, + 777: 7842, + 778: 197, + 780: 461, + 783: 512, + 785: 514, + 803: 7840, + 805: 7680, + 808: 260 + } + ], + 66: [, , { 775: 7682, 803: 7684, 817: 7686 }], + 67: [, , { 769: 262, 770: 264, 775: 266, 780: 268, 807: 199 }], + 68: [ + , + , + { 775: 7690, 780: 270, 803: 7692, 807: 7696, 813: 7698, 817: 7694 } + ], + 69: [ + , + , + { + 768: 200, + 769: 201, + 770: 202, + 771: 7868, + 772: 274, + 774: 276, + 775: 278, + 776: 203, + 777: 7866, + 780: 282, + 783: 516, + 785: 518, + 803: 7864, + 807: 552, + 808: 280, + 813: 7704, + 816: 7706 + } + ], + 70: [, , { 775: 7710 }], + 71: [ + , + , + { 769: 500, 770: 284, 772: 7712, 774: 286, 775: 288, 780: 486, 807: 290 } + ], + 72: [ + , + , + { + 770: 292, + 775: 7714, + 776: 7718, + 780: 542, + 803: 7716, + 807: 7720, + 814: 7722 + } + ], + 73: [ + , + , + { + 768: 204, + 769: 205, + 770: 206, + 771: 296, + 772: 298, + 774: 300, + 775: 304, + 776: 207, + 777: 7880, + 780: 463, + 783: 520, + 785: 522, + 803: 7882, + 808: 302, + 816: 7724 + } + ], + 74: [, , { 770: 308 }], + 75: [, , { 769: 7728, 780: 488, 803: 7730, 807: 310, 817: 7732 }], + 76: [, , { 769: 313, 780: 317, 803: 7734, 807: 315, 813: 7740, 817: 7738 }], + 77: [, , { 769: 7742, 775: 7744, 803: 7746 }], + 78: [ + , + , + { + 768: 504, + 769: 323, + 771: 209, + 775: 7748, + 780: 327, + 803: 7750, + 807: 325, + 813: 7754, + 817: 7752 + } + ], + 79: [ + , + , + { + 768: 210, + 769: 211, + 770: 212, + 771: 213, + 772: 332, + 774: 334, + 775: 558, + 776: 214, + 777: 7886, + 779: 336, + 780: 465, + 783: 524, + 785: 526, + 795: 416, + 803: 7884, + 808: 490 + } + ], + 80: [, , { 769: 7764, 775: 7766 }], + 82: [ + , + , + { + 769: 340, + 775: 7768, + 780: 344, + 783: 528, + 785: 530, + 803: 7770, + 807: 342, + 817: 7774 + } + ], + 83: [ + , + , + { 769: 346, 770: 348, 775: 7776, 780: 352, 803: 7778, 806: 536, 807: 350 } + ], + 84: [ + , + , + { + 775: 7786, + 780: 356, + 803: 7788, + 806: 538, + 807: 354, + 813: 7792, + 817: 7790 + } + ], + 85: [ + , + , + { + 768: 217, + 769: 218, + 770: 219, + 771: 360, + 772: 362, + 774: 364, + 776: 220, + 777: 7910, + 778: 366, + 779: 368, + 780: 467, + 783: 532, + 785: 534, + 795: 431, + 803: 7908, + 804: 7794, + 808: 370, + 813: 7798, + 816: 7796 + } + ], + 86: [, , { 771: 7804, 803: 7806 }], + 87: [ + , + , + { 768: 7808, 769: 7810, 770: 372, 775: 7814, 776: 7812, 803: 7816 } + ], + 88: [, , { 775: 7818, 776: 7820 }], + 89: [ + , + , + { + 768: 7922, + 769: 221, + 770: 374, + 771: 7928, + 772: 562, + 775: 7822, + 776: 376, + 777: 7926, + 803: 7924 + } + ], + 90: [, , { 769: 377, 770: 7824, 775: 379, 780: 381, 803: 7826, 817: 7828 }], + 97: [ + , + , + { + 768: 224, + 769: 225, + 770: 226, + 771: 227, + 772: 257, + 774: 259, + 775: 551, + 776: 228, + 777: 7843, + 778: 229, + 780: 462, + 783: 513, + 785: 515, + 803: 7841, + 805: 7681, + 808: 261 + } + ], + 98: [, , { 775: 7683, 803: 7685, 817: 7687 }], + 99: [, , { 769: 263, 770: 265, 775: 267, 780: 269, 807: 231 }], + 100: [ + , + , + { 775: 7691, 780: 271, 803: 7693, 807: 7697, 813: 7699, 817: 7695 } + ], + 101: [ + , + , + { + 768: 232, + 769: 233, + 770: 234, + 771: 7869, + 772: 275, + 774: 277, + 775: 279, + 776: 235, + 777: 7867, + 780: 283, + 783: 517, + 785: 519, + 803: 7865, + 807: 553, + 808: 281, + 813: 7705, + 816: 7707 + } + ], + 102: [, , { 775: 7711 }], + 103: [ + , + , + { 769: 501, 770: 285, 772: 7713, 774: 287, 775: 289, 780: 487, 807: 291 } + ], + 104: [ + , + , + { + 770: 293, + 775: 7715, + 776: 7719, + 780: 543, + 803: 7717, + 807: 7721, + 814: 7723, + 817: 7830 + } + ], + 105: [ + , + , + { + 768: 236, + 769: 237, + 770: 238, + 771: 297, + 772: 299, + 774: 301, + 776: 239, + 777: 7881, + 780: 464, + 783: 521, + 785: 523, + 803: 7883, + 808: 303, + 816: 7725 + } + ], + 106: [, , { 770: 309, 780: 496 }], + 107: [, , { 769: 7729, 780: 489, 803: 7731, 807: 311, 817: 7733 }], + 108: [ + , + , + { 769: 314, 780: 318, 803: 7735, 807: 316, 813: 7741, 817: 7739 } + ], + 109: [, , { 769: 7743, 775: 7745, 803: 7747 }], + 110: [ + , + , + { + 768: 505, + 769: 324, + 771: 241, + 775: 7749, + 780: 328, + 803: 7751, + 807: 326, + 813: 7755, + 817: 7753 + } + ], + 111: [ + , + , + { + 768: 242, + 769: 243, + 770: 244, + 771: 245, + 772: 333, + 774: 335, + 775: 559, + 776: 246, + 777: 7887, + 779: 337, + 780: 466, + 783: 525, + 785: 527, + 795: 417, + 803: 7885, + 808: 491 + } + ], + 112: [, , { 769: 7765, 775: 7767 }], + 114: [ + , + , + { + 769: 341, + 775: 7769, + 780: 345, + 783: 529, + 785: 531, + 803: 7771, + 807: 343, + 817: 7775 + } + ], + 115: [ + , + , + { 769: 347, 770: 349, 775: 7777, 780: 353, 803: 7779, 806: 537, 807: 351 } + ], + 116: [ + , + , + { + 775: 7787, + 776: 7831, + 780: 357, + 803: 7789, + 806: 539, + 807: 355, + 813: 7793, + 817: 7791 + } + ], + 117: [ + , + , + { + 768: 249, + 769: 250, + 770: 251, + 771: 361, + 772: 363, + 774: 365, + 776: 252, + 777: 7911, + 778: 367, + 779: 369, + 780: 468, + 783: 533, + 785: 535, + 795: 432, + 803: 7909, + 804: 7795, + 808: 371, + 813: 7799, + 816: 7797 + } + ], + 118: [, , { 771: 7805, 803: 7807 }], + 119: [ + , + , + { + 768: 7809, + 769: 7811, + 770: 373, + 775: 7815, + 776: 7813, + 778: 7832, + 803: 7817 + } + ], + 120: [, , { 775: 7819, 776: 7821 }], + 121: [ + , + , + { + 768: 7923, + 769: 253, + 770: 375, + 771: 7929, + 772: 563, + 775: 7823, + 776: 255, + 777: 7927, + 778: 7833, + 803: 7925 + } + ], + 122: [ + , + , + { 769: 378, 770: 7825, 775: 380, 780: 382, 803: 7827, 817: 7829 } + ], + 160: [[32], 256], + 168: [[32, 776], 256, { 768: 8173, 769: 901, 834: 8129 }], + 170: [[97], 256], + 175: [[32, 772], 256], + 178: [[50], 256], + 179: [[51], 256], + 180: [[32, 769], 256], + 181: [[956], 256], + 184: [[32, 807], 256], + 185: [[49], 256], + 186: [[111], 256], + 188: [[49, 8260, 52], 256], + 189: [[49, 8260, 50], 256], + 190: [[51, 8260, 52], 256], + 192: [[65, 768]], + 193: [[65, 769]], + 194: [[65, 770], , { 768: 7846, 769: 7844, 771: 7850, 777: 7848 }], + 195: [[65, 771]], + 196: [[65, 776], , { 772: 478 }], + 197: [[65, 778], , { 769: 506 }], + 198: [, , { 769: 508, 772: 482 }], + 199: [[67, 807], , { 769: 7688 }], + 200: [[69, 768]], + 201: [[69, 769]], + 202: [[69, 770], , { 768: 7872, 769: 7870, 771: 7876, 777: 7874 }], + 203: [[69, 776]], + 204: [[73, 768]], + 205: [[73, 769]], + 206: [[73, 770]], + 207: [[73, 776], , { 769: 7726 }], + 209: [[78, 771]], + 210: [[79, 768]], + 211: [[79, 769]], + 212: [[79, 770], , { 768: 7890, 769: 7888, 771: 7894, 777: 7892 }], + 213: [[79, 771], , { 769: 7756, 772: 556, 776: 7758 }], + 214: [[79, 776], , { 772: 554 }], + 216: [, , { 769: 510 }], + 217: [[85, 768]], + 218: [[85, 769]], + 219: [[85, 770]], + 220: [[85, 776], , { 768: 475, 769: 471, 772: 469, 780: 473 }], + 221: [[89, 769]], + 224: [[97, 768]], + 225: [[97, 769]], + 226: [[97, 770], , { 768: 7847, 769: 7845, 771: 7851, 777: 7849 }], + 227: [[97, 771]], + 228: [[97, 776], , { 772: 479 }], + 229: [[97, 778], , { 769: 507 }], + 230: [, , { 769: 509, 772: 483 }], + 231: [[99, 807], , { 769: 7689 }], + 232: [[101, 768]], + 233: [[101, 769]], + 234: [[101, 770], , { 768: 7873, 769: 7871, 771: 7877, 777: 7875 }], + 235: [[101, 776]], + 236: [[105, 768]], + 237: [[105, 769]], + 238: [[105, 770]], + 239: [[105, 776], , { 769: 7727 }], + 241: [[110, 771]], + 242: [[111, 768]], + 243: [[111, 769]], + 244: [[111, 770], , { 768: 7891, 769: 7889, 771: 7895, 777: 7893 }], + 245: [[111, 771], , { 769: 7757, 772: 557, 776: 7759 }], + 246: [[111, 776], , { 772: 555 }], + 248: [, , { 769: 511 }], + 249: [[117, 768]], + 250: [[117, 769]], + 251: [[117, 770]], + 252: [[117, 776], , { 768: 476, 769: 472, 772: 470, 780: 474 }], + 253: [[121, 769]], + 255: [[121, 776]] + }, + 256: { + 256: [[65, 772]], + 257: [[97, 772]], + 258: [[65, 774], , { 768: 7856, 769: 7854, 771: 7860, 777: 7858 }], + 259: [[97, 774], , { 768: 7857, 769: 7855, 771: 7861, 777: 7859 }], + 260: [[65, 808]], + 261: [[97, 808]], + 262: [[67, 769]], + 263: [[99, 769]], + 264: [[67, 770]], + 265: [[99, 770]], + 266: [[67, 775]], + 267: [[99, 775]], + 268: [[67, 780]], + 269: [[99, 780]], + 270: [[68, 780]], + 271: [[100, 780]], + 274: [[69, 772], , { 768: 7700, 769: 7702 }], + 275: [[101, 772], , { 768: 7701, 769: 7703 }], + 276: [[69, 774]], + 277: [[101, 774]], + 278: [[69, 775]], + 279: [[101, 775]], + 280: [[69, 808]], + 281: [[101, 808]], + 282: [[69, 780]], + 283: [[101, 780]], + 284: [[71, 770]], + 285: [[103, 770]], + 286: [[71, 774]], + 287: [[103, 774]], + 288: [[71, 775]], + 289: [[103, 775]], + 290: [[71, 807]], + 291: [[103, 807]], + 292: [[72, 770]], + 293: [[104, 770]], + 296: [[73, 771]], + 297: [[105, 771]], + 298: [[73, 772]], + 299: [[105, 772]], + 300: [[73, 774]], + 301: [[105, 774]], + 302: [[73, 808]], + 303: [[105, 808]], + 304: [[73, 775]], + 306: [[73, 74], 256], + 307: [[105, 106], 256], + 308: [[74, 770]], + 309: [[106, 770]], + 310: [[75, 807]], + 311: [[107, 807]], + 313: [[76, 769]], + 314: [[108, 769]], + 315: [[76, 807]], + 316: [[108, 807]], + 317: [[76, 780]], + 318: [[108, 780]], + 319: [[76, 183], 256], + 320: [[108, 183], 256], + 323: [[78, 769]], + 324: [[110, 769]], + 325: [[78, 807]], + 326: [[110, 807]], + 327: [[78, 780]], + 328: [[110, 780]], + 329: [[700, 110], 256], + 332: [[79, 772], , { 768: 7760, 769: 7762 }], + 333: [[111, 772], , { 768: 7761, 769: 7763 }], + 334: [[79, 774]], + 335: [[111, 774]], + 336: [[79, 779]], + 337: [[111, 779]], + 340: [[82, 769]], + 341: [[114, 769]], + 342: [[82, 807]], + 343: [[114, 807]], + 344: [[82, 780]], + 345: [[114, 780]], + 346: [[83, 769], , { 775: 7780 }], + 347: [[115, 769], , { 775: 7781 }], + 348: [[83, 770]], + 349: [[115, 770]], + 350: [[83, 807]], + 351: [[115, 807]], + 352: [[83, 780], , { 775: 7782 }], + 353: [[115, 780], , { 775: 7783 }], + 354: [[84, 807]], + 355: [[116, 807]], + 356: [[84, 780]], + 357: [[116, 780]], + 360: [[85, 771], , { 769: 7800 }], + 361: [[117, 771], , { 769: 7801 }], + 362: [[85, 772], , { 776: 7802 }], + 363: [[117, 772], , { 776: 7803 }], + 364: [[85, 774]], + 365: [[117, 774]], + 366: [[85, 778]], + 367: [[117, 778]], + 368: [[85, 779]], + 369: [[117, 779]], + 370: [[85, 808]], + 371: [[117, 808]], + 372: [[87, 770]], + 373: [[119, 770]], + 374: [[89, 770]], + 375: [[121, 770]], + 376: [[89, 776]], + 377: [[90, 769]], + 378: [[122, 769]], + 379: [[90, 775]], + 380: [[122, 775]], + 381: [[90, 780]], + 382: [[122, 780]], + 383: [[115], 256, { 775: 7835 }], + 416: [ + [79, 795], + , + { 768: 7900, 769: 7898, 771: 7904, 777: 7902, 803: 7906 } + ], + 417: [ + [111, 795], + , + { 768: 7901, 769: 7899, 771: 7905, 777: 7903, 803: 7907 } + ], + 431: [ + [85, 795], + , + { 768: 7914, 769: 7912, 771: 7918, 777: 7916, 803: 7920 } + ], + 432: [ + [117, 795], + , + { 768: 7915, 769: 7913, 771: 7919, 777: 7917, 803: 7921 } + ], + 439: [, , { 780: 494 }], + 452: [[68, 381], 256], + 453: [[68, 382], 256], + 454: [[100, 382], 256], + 455: [[76, 74], 256], + 456: [[76, 106], 256], + 457: [[108, 106], 256], + 458: [[78, 74], 256], + 459: [[78, 106], 256], + 460: [[110, 106], 256], + 461: [[65, 780]], + 462: [[97, 780]], + 463: [[73, 780]], + 464: [[105, 780]], + 465: [[79, 780]], + 466: [[111, 780]], + 467: [[85, 780]], + 468: [[117, 780]], + 469: [[220, 772]], + 470: [[252, 772]], + 471: [[220, 769]], + 472: [[252, 769]], + 473: [[220, 780]], + 474: [[252, 780]], + 475: [[220, 768]], + 476: [[252, 768]], + 478: [[196, 772]], + 479: [[228, 772]], + 480: [[550, 772]], + 481: [[551, 772]], + 482: [[198, 772]], + 483: [[230, 772]], + 486: [[71, 780]], + 487: [[103, 780]], + 488: [[75, 780]], + 489: [[107, 780]], + 490: [[79, 808], , { 772: 492 }], + 491: [[111, 808], , { 772: 493 }], + 492: [[490, 772]], + 493: [[491, 772]], + 494: [[439, 780]], + 495: [[658, 780]], + 496: [[106, 780]], + 497: [[68, 90], 256], + 498: [[68, 122], 256], + 499: [[100, 122], 256], + 500: [[71, 769]], + 501: [[103, 769]], + 504: [[78, 768]], + 505: [[110, 768]], + 506: [[197, 769]], + 507: [[229, 769]], + 508: [[198, 769]], + 509: [[230, 769]], + 510: [[216, 769]], + 511: [[248, 769]], + 66045: [, 220] + }, + 512: { + 512: [[65, 783]], + 513: [[97, 783]], + 514: [[65, 785]], + 515: [[97, 785]], + 516: [[69, 783]], + 517: [[101, 783]], + 518: [[69, 785]], + 519: [[101, 785]], + 520: [[73, 783]], + 521: [[105, 783]], + 522: [[73, 785]], + 523: [[105, 785]], + 524: [[79, 783]], + 525: [[111, 783]], + 526: [[79, 785]], + 527: [[111, 785]], + 528: [[82, 783]], + 529: [[114, 783]], + 530: [[82, 785]], + 531: [[114, 785]], + 532: [[85, 783]], + 533: [[117, 783]], + 534: [[85, 785]], + 535: [[117, 785]], + 536: [[83, 806]], + 537: [[115, 806]], + 538: [[84, 806]], + 539: [[116, 806]], + 542: [[72, 780]], + 543: [[104, 780]], + 550: [[65, 775], , { 772: 480 }], + 551: [[97, 775], , { 772: 481 }], + 552: [[69, 807], , { 774: 7708 }], + 553: [[101, 807], , { 774: 7709 }], + 554: [[214, 772]], + 555: [[246, 772]], + 556: [[213, 772]], + 557: [[245, 772]], + 558: [[79, 775], , { 772: 560 }], + 559: [[111, 775], , { 772: 561 }], + 560: [[558, 772]], + 561: [[559, 772]], + 562: [[89, 772]], + 563: [[121, 772]], + 658: [, , { 780: 495 }], + 688: [[104], 256], + 689: [[614], 256], + 690: [[106], 256], + 691: [[114], 256], + 692: [[633], 256], + 693: [[635], 256], + 694: [[641], 256], + 695: [[119], 256], + 696: [[121], 256], + 728: [[32, 774], 256], + 729: [[32, 775], 256], + 730: [[32, 778], 256], + 731: [[32, 808], 256], + 732: [[32, 771], 256], + 733: [[32, 779], 256], + 736: [[611], 256], + 737: [[108], 256], + 738: [[115], 256], + 739: [[120], 256], + 740: [[661], 256] + }, + 768: { + 768: [, 230], + 769: [, 230], + 770: [, 230], + 771: [, 230], + 772: [, 230], + 773: [, 230], + 774: [, 230], + 775: [, 230], + 776: [, 230, { 769: 836 }], + 777: [, 230], + 778: [, 230], + 779: [, 230], + 780: [, 230], + 781: [, 230], + 782: [, 230], + 783: [, 230], + 784: [, 230], + 785: [, 230], + 786: [, 230], + 787: [, 230], + 788: [, 230], + 789: [, 232], + 790: [, 220], + 791: [, 220], + 792: [, 220], + 793: [, 220], + 794: [, 232], + 795: [, 216], + 796: [, 220], + 797: [, 220], + 798: [, 220], + 799: [, 220], + 800: [, 220], + 801: [, 202], + 802: [, 202], + 803: [, 220], + 804: [, 220], + 805: [, 220], + 806: [, 220], + 807: [, 202], + 808: [, 202], + 809: [, 220], + 810: [, 220], + 811: [, 220], + 812: [, 220], + 813: [, 220], + 814: [, 220], + 815: [, 220], + 816: [, 220], + 817: [, 220], + 818: [, 220], + 819: [, 220], + 820: [, 1], + 821: [, 1], + 822: [, 1], + 823: [, 1], + 824: [, 1], + 825: [, 220], + 826: [, 220], + 827: [, 220], + 828: [, 220], + 829: [, 230], + 830: [, 230], + 831: [, 230], + 832: [[768], 230], + 833: [[769], 230], + 834: [, 230], + 835: [[787], 230], + 836: [[776, 769], 230], + 837: [, 240], + 838: [, 230], + 839: [, 220], + 840: [, 220], + 841: [, 220], + 842: [, 230], + 843: [, 230], + 844: [, 230], + 845: [, 220], + 846: [, 220], + 848: [, 230], + 849: [, 230], + 850: [, 230], + 851: [, 220], + 852: [, 220], + 853: [, 220], + 854: [, 220], + 855: [, 230], + 856: [, 232], + 857: [, 220], + 858: [, 220], + 859: [, 230], + 860: [, 233], + 861: [, 234], + 862: [, 234], + 863: [, 233], + 864: [, 234], + 865: [, 234], + 866: [, 233], + 867: [, 230], + 868: [, 230], + 869: [, 230], + 870: [, 230], + 871: [, 230], + 872: [, 230], + 873: [, 230], + 874: [, 230], + 875: [, 230], + 876: [, 230], + 877: [, 230], + 878: [, 230], + 879: [, 230], + 884: [[697]], + 890: [[32, 837], 256], + 894: [[59]], + 900: [[32, 769], 256], + 901: [[168, 769]], + 902: [[913, 769]], + 903: [[183]], + 904: [[917, 769]], + 905: [[919, 769]], + 906: [[921, 769]], + 908: [[927, 769]], + 910: [[933, 769]], + 911: [[937, 769]], + 912: [[970, 769]], + 913: [ + , + , + { + 768: 8122, + 769: 902, + 772: 8121, + 774: 8120, + 787: 7944, + 788: 7945, + 837: 8124 + } + ], + 917: [, , { 768: 8136, 769: 904, 787: 7960, 788: 7961 }], + 919: [, , { 768: 8138, 769: 905, 787: 7976, 788: 7977, 837: 8140 }], + 921: [ + , + , + { + 768: 8154, + 769: 906, + 772: 8153, + 774: 8152, + 776: 938, + 787: 7992, + 788: 7993 + } + ], + 927: [, , { 768: 8184, 769: 908, 787: 8008, 788: 8009 }], + 929: [, , { 788: 8172 }], + 933: [ + , + , + { 768: 8170, 769: 910, 772: 8169, 774: 8168, 776: 939, 788: 8025 } + ], + 937: [, , { 768: 8186, 769: 911, 787: 8040, 788: 8041, 837: 8188 }], + 938: [[921, 776]], + 939: [[933, 776]], + 940: [[945, 769], , { 837: 8116 }], + 941: [[949, 769]], + 942: [[951, 769], , { 837: 8132 }], + 943: [[953, 769]], + 944: [[971, 769]], + 945: [ + , + , + { + 768: 8048, + 769: 940, + 772: 8113, + 774: 8112, + 787: 7936, + 788: 7937, + 834: 8118, + 837: 8115 + } + ], + 949: [, , { 768: 8050, 769: 941, 787: 7952, 788: 7953 }], + 951: [ + , + , + { 768: 8052, 769: 942, 787: 7968, 788: 7969, 834: 8134, 837: 8131 } + ], + 953: [ + , + , + { + 768: 8054, + 769: 943, + 772: 8145, + 774: 8144, + 776: 970, + 787: 7984, + 788: 7985, + 834: 8150 + } + ], + 959: [, , { 768: 8056, 769: 972, 787: 8000, 788: 8001 }], + 961: [, , { 787: 8164, 788: 8165 }], + 965: [ + , + , + { + 768: 8058, + 769: 973, + 772: 8161, + 774: 8160, + 776: 971, + 787: 8016, + 788: 8017, + 834: 8166 + } + ], + 969: [ + , + , + { 768: 8060, 769: 974, 787: 8032, 788: 8033, 834: 8182, 837: 8179 } + ], + 970: [[953, 776], , { 768: 8146, 769: 912, 834: 8151 }], + 971: [[965, 776], , { 768: 8162, 769: 944, 834: 8167 }], + 972: [[959, 769]], + 973: [[965, 769]], + 974: [[969, 769], , { 837: 8180 }], + 976: [[946], 256], + 977: [[952], 256], + 978: [[933], 256, { 769: 979, 776: 980 }], + 979: [[978, 769]], + 980: [[978, 776]], + 981: [[966], 256], + 982: [[960], 256], + 1008: [[954], 256], + 1009: [[961], 256], + 1010: [[962], 256], + 1012: [[920], 256], + 1013: [[949], 256], + 1017: [[931], 256] + }, + 1024: { + 1024: [[1045, 768]], + 1025: [[1045, 776]], + 1027: [[1043, 769]], + 1030: [, , { 776: 1031 }], + 1031: [[1030, 776]], + 1036: [[1050, 769]], + 1037: [[1048, 768]], + 1038: [[1059, 774]], + 1040: [, , { 774: 1232, 776: 1234 }], + 1043: [, , { 769: 1027 }], + 1045: [, , { 768: 1024, 774: 1238, 776: 1025 }], + 1046: [, , { 774: 1217, 776: 1244 }], + 1047: [, , { 776: 1246 }], + 1048: [, , { 768: 1037, 772: 1250, 774: 1049, 776: 1252 }], + 1049: [[1048, 774]], + 1050: [, , { 769: 1036 }], + 1054: [, , { 776: 1254 }], + 1059: [, , { 772: 1262, 774: 1038, 776: 1264, 779: 1266 }], + 1063: [, , { 776: 1268 }], + 1067: [, , { 776: 1272 }], + 1069: [, , { 776: 1260 }], + 1072: [, , { 774: 1233, 776: 1235 }], + 1075: [, , { 769: 1107 }], + 1077: [, , { 768: 1104, 774: 1239, 776: 1105 }], + 1078: [, , { 774: 1218, 776: 1245 }], + 1079: [, , { 776: 1247 }], + 1080: [, , { 768: 1117, 772: 1251, 774: 1081, 776: 1253 }], + 1081: [[1080, 774]], + 1082: [, , { 769: 1116 }], + 1086: [, , { 776: 1255 }], + 1091: [, , { 772: 1263, 774: 1118, 776: 1265, 779: 1267 }], + 1095: [, , { 776: 1269 }], + 1099: [, , { 776: 1273 }], + 1101: [, , { 776: 1261 }], + 1104: [[1077, 768]], + 1105: [[1077, 776]], + 1107: [[1075, 769]], + 1110: [, , { 776: 1111 }], + 1111: [[1110, 776]], + 1116: [[1082, 769]], + 1117: [[1080, 768]], + 1118: [[1091, 774]], + 1140: [, , { 783: 1142 }], + 1141: [, , { 783: 1143 }], + 1142: [[1140, 783]], + 1143: [[1141, 783]], + 1155: [, 230], + 1156: [, 230], + 1157: [, 230], + 1158: [, 230], + 1159: [, 230], + 1217: [[1046, 774]], + 1218: [[1078, 774]], + 1232: [[1040, 774]], + 1233: [[1072, 774]], + 1234: [[1040, 776]], + 1235: [[1072, 776]], + 1238: [[1045, 774]], + 1239: [[1077, 774]], + 1240: [, , { 776: 1242 }], + 1241: [, , { 776: 1243 }], + 1242: [[1240, 776]], + 1243: [[1241, 776]], + 1244: [[1046, 776]], + 1245: [[1078, 776]], + 1246: [[1047, 776]], + 1247: [[1079, 776]], + 1250: [[1048, 772]], + 1251: [[1080, 772]], + 1252: [[1048, 776]], + 1253: [[1080, 776]], + 1254: [[1054, 776]], + 1255: [[1086, 776]], + 1256: [, , { 776: 1258 }], + 1257: [, , { 776: 1259 }], + 1258: [[1256, 776]], + 1259: [[1257, 776]], + 1260: [[1069, 776]], + 1261: [[1101, 776]], + 1262: [[1059, 772]], + 1263: [[1091, 772]], + 1264: [[1059, 776]], + 1265: [[1091, 776]], + 1266: [[1059, 779]], + 1267: [[1091, 779]], + 1268: [[1063, 776]], + 1269: [[1095, 776]], + 1272: [[1067, 776]], + 1273: [[1099, 776]] + }, + 1280: { + 1415: [[1381, 1410], 256], + 1425: [, 220], + 1426: [, 230], + 1427: [, 230], + 1428: [, 230], + 1429: [, 230], + 1430: [, 220], + 1431: [, 230], + 1432: [, 230], + 1433: [, 230], + 1434: [, 222], + 1435: [, 220], + 1436: [, 230], + 1437: [, 230], + 1438: [, 230], + 1439: [, 230], + 1440: [, 230], + 1441: [, 230], + 1442: [, 220], + 1443: [, 220], + 1444: [, 220], + 1445: [, 220], + 1446: [, 220], + 1447: [, 220], + 1448: [, 230], + 1449: [, 230], + 1450: [, 220], + 1451: [, 230], + 1452: [, 230], + 1453: [, 222], + 1454: [, 228], + 1455: [, 230], + 1456: [, 10], + 1457: [, 11], + 1458: [, 12], + 1459: [, 13], + 1460: [, 14], + 1461: [, 15], + 1462: [, 16], + 1463: [, 17], + 1464: [, 18], + 1465: [, 19], + 1466: [, 19], + 1467: [, 20], + 1468: [, 21], + 1469: [, 22], + 1471: [, 23], + 1473: [, 24], + 1474: [, 25], + 1476: [, 230], + 1477: [, 220], + 1479: [, 18] + }, + 1536: { + 1552: [, 230], + 1553: [, 230], + 1554: [, 230], + 1555: [, 230], + 1556: [, 230], + 1557: [, 230], + 1558: [, 230], + 1559: [, 230], + 1560: [, 30], + 1561: [, 31], + 1562: [, 32], + 1570: [[1575, 1619]], + 1571: [[1575, 1620]], + 1572: [[1608, 1620]], + 1573: [[1575, 1621]], + 1574: [[1610, 1620]], + 1575: [, , { 1619: 1570, 1620: 1571, 1621: 1573 }], + 1608: [, , { 1620: 1572 }], + 1610: [, , { 1620: 1574 }], + 1611: [, 27], + 1612: [, 28], + 1613: [, 29], + 1614: [, 30], + 1615: [, 31], + 1616: [, 32], + 1617: [, 33], + 1618: [, 34], + 1619: [, 230], + 1620: [, 230], + 1621: [, 220], + 1622: [, 220], + 1623: [, 230], + 1624: [, 230], + 1625: [, 230], + 1626: [, 230], + 1627: [, 230], + 1628: [, 220], + 1629: [, 230], + 1630: [, 230], + 1631: [, 220], + 1648: [, 35], + 1653: [[1575, 1652], 256], + 1654: [[1608, 1652], 256], + 1655: [[1735, 1652], 256], + 1656: [[1610, 1652], 256], + 1728: [[1749, 1620]], + 1729: [, , { 1620: 1730 }], + 1730: [[1729, 1620]], + 1746: [, , { 1620: 1747 }], + 1747: [[1746, 1620]], + 1749: [, , { 1620: 1728 }], + 1750: [, 230], + 1751: [, 230], + 1752: [, 230], + 1753: [, 230], + 1754: [, 230], + 1755: [, 230], + 1756: [, 230], + 1759: [, 230], + 1760: [, 230], + 1761: [, 230], + 1762: [, 230], + 1763: [, 220], + 1764: [, 230], + 1767: [, 230], + 1768: [, 230], + 1770: [, 220], + 1771: [, 230], + 1772: [, 230], + 1773: [, 220] + }, + 1792: { + 1809: [, 36], + 1840: [, 230], + 1841: [, 220], + 1842: [, 230], + 1843: [, 230], + 1844: [, 220], + 1845: [, 230], + 1846: [, 230], + 1847: [, 220], + 1848: [, 220], + 1849: [, 220], + 1850: [, 230], + 1851: [, 220], + 1852: [, 220], + 1853: [, 230], + 1854: [, 220], + 1855: [, 230], + 1856: [, 230], + 1857: [, 230], + 1858: [, 220], + 1859: [, 230], + 1860: [, 220], + 1861: [, 230], + 1862: [, 220], + 1863: [, 230], + 1864: [, 220], + 1865: [, 230], + 1866: [, 230], + 2027: [, 230], + 2028: [, 230], + 2029: [, 230], + 2030: [, 230], + 2031: [, 230], + 2032: [, 230], + 2033: [, 230], + 2034: [, 220], + 2035: [, 230] + }, + 2048: { + 2070: [, 230], + 2071: [, 230], + 2072: [, 230], + 2073: [, 230], + 2075: [, 230], + 2076: [, 230], + 2077: [, 230], + 2078: [, 230], + 2079: [, 230], + 2080: [, 230], + 2081: [, 230], + 2082: [, 230], + 2083: [, 230], + 2085: [, 230], + 2086: [, 230], + 2087: [, 230], + 2089: [, 230], + 2090: [, 230], + 2091: [, 230], + 2092: [, 230], + 2093: [, 230], + 2137: [, 220], + 2138: [, 220], + 2139: [, 220], + 2276: [, 230], + 2277: [, 230], + 2278: [, 220], + 2279: [, 230], + 2280: [, 230], + 2281: [, 220], + 2282: [, 230], + 2283: [, 230], + 2284: [, 230], + 2285: [, 220], + 2286: [, 220], + 2287: [, 220], + 2288: [, 27], + 2289: [, 28], + 2290: [, 29], + 2291: [, 230], + 2292: [, 230], + 2293: [, 230], + 2294: [, 220], + 2295: [, 230], + 2296: [, 230], + 2297: [, 220], + 2298: [, 220], + 2299: [, 230], + 2300: [, 230], + 2301: [, 230], + 2302: [, 230] + }, + 2304: { + 2344: [, , { 2364: 2345 }], + 2345: [[2344, 2364]], + 2352: [, , { 2364: 2353 }], + 2353: [[2352, 2364]], + 2355: [, , { 2364: 2356 }], + 2356: [[2355, 2364]], + 2364: [, 7], + 2381: [, 9], + 2385: [, 230], + 2386: [, 220], + 2387: [, 230], + 2388: [, 230], + 2392: [[2325, 2364], 512], + 2393: [[2326, 2364], 512], + 2394: [[2327, 2364], 512], + 2395: [[2332, 2364], 512], + 2396: [[2337, 2364], 512], + 2397: [[2338, 2364], 512], + 2398: [[2347, 2364], 512], + 2399: [[2351, 2364], 512], + 2492: [, 7], + 2503: [, , { 2494: 2507, 2519: 2508 }], + 2507: [[2503, 2494]], + 2508: [[2503, 2519]], + 2509: [, 9], + 2524: [[2465, 2492], 512], + 2525: [[2466, 2492], 512], + 2527: [[2479, 2492], 512] + }, + 2560: { + 2611: [[2610, 2620], 512], + 2614: [[2616, 2620], 512], + 2620: [, 7], + 2637: [, 9], + 2649: [[2582, 2620], 512], + 2650: [[2583, 2620], 512], + 2651: [[2588, 2620], 512], + 2654: [[2603, 2620], 512], + 2748: [, 7], + 2765: [, 9], + 68109: [, 220], + 68111: [, 230], + 68152: [, 230], + 68153: [, 1], + 68154: [, 220], + 68159: [, 9] + }, + 2816: { + 2876: [, 7], + 2887: [, , { 2878: 2891, 2902: 2888, 2903: 2892 }], + 2888: [[2887, 2902]], + 2891: [[2887, 2878]], + 2892: [[2887, 2903]], + 2893: [, 9], + 2908: [[2849, 2876], 512], + 2909: [[2850, 2876], 512], + 2962: [, , { 3031: 2964 }], + 2964: [[2962, 3031]], + 3014: [, , { 3006: 3018, 3031: 3020 }], + 3015: [, , { 3006: 3019 }], + 3018: [[3014, 3006]], + 3019: [[3015, 3006]], + 3020: [[3014, 3031]], + 3021: [, 9] + }, + 3072: { + 3142: [, , { 3158: 3144 }], + 3144: [[3142, 3158]], + 3149: [, 9], + 3157: [, 84], + 3158: [, 91], + 3260: [, 7], + 3263: [, , { 3285: 3264 }], + 3264: [[3263, 3285]], + 3270: [, , { 3266: 3274, 3285: 3271, 3286: 3272 }], + 3271: [[3270, 3285]], + 3272: [[3270, 3286]], + 3274: [[3270, 3266], , { 3285: 3275 }], + 3275: [[3274, 3285]], + 3277: [, 9] + }, + 3328: { + 3398: [, , { 3390: 3402, 3415: 3404 }], + 3399: [, , { 3390: 3403 }], + 3402: [[3398, 3390]], + 3403: [[3399, 3390]], + 3404: [[3398, 3415]], + 3405: [, 9], + 3530: [, 9], + 3545: [, , { 3530: 3546, 3535: 3548, 3551: 3550 }], + 3546: [[3545, 3530]], + 3548: [[3545, 3535], , { 3530: 3549 }], + 3549: [[3548, 3530]], + 3550: [[3545, 3551]] + }, + 3584: { + 3635: [[3661, 3634], 256], + 3640: [, 103], + 3641: [, 103], + 3642: [, 9], + 3656: [, 107], + 3657: [, 107], + 3658: [, 107], + 3659: [, 107], + 3763: [[3789, 3762], 256], + 3768: [, 118], + 3769: [, 118], + 3784: [, 122], + 3785: [, 122], + 3786: [, 122], + 3787: [, 122], + 3804: [[3755, 3737], 256], + 3805: [[3755, 3745], 256] + }, + 3840: { + 3852: [[3851], 256], + 3864: [, 220], + 3865: [, 220], + 3893: [, 220], + 3895: [, 220], + 3897: [, 216], + 3907: [[3906, 4023], 512], + 3917: [[3916, 4023], 512], + 3922: [[3921, 4023], 512], + 3927: [[3926, 4023], 512], + 3932: [[3931, 4023], 512], + 3945: [[3904, 4021], 512], + 3953: [, 129], + 3954: [, 130], + 3955: [[3953, 3954], 512], + 3956: [, 132], + 3957: [[3953, 3956], 512], + 3958: [[4018, 3968], 512], + 3959: [[4018, 3969], 256], + 3960: [[4019, 3968], 512], + 3961: [[4019, 3969], 256], + 3962: [, 130], + 3963: [, 130], + 3964: [, 130], + 3965: [, 130], + 3968: [, 130], + 3969: [[3953, 3968], 512], + 3970: [, 230], + 3971: [, 230], + 3972: [, 9], + 3974: [, 230], + 3975: [, 230], + 3987: [[3986, 4023], 512], + 3997: [[3996, 4023], 512], + 4002: [[4001, 4023], 512], + 4007: [[4006, 4023], 512], + 4012: [[4011, 4023], 512], + 4025: [[3984, 4021], 512], + 4038: [, 220] + }, + 4096: { + 4133: [, , { 4142: 4134 }], + 4134: [[4133, 4142]], + 4151: [, 7], + 4153: [, 9], + 4154: [, 9], + 4237: [, 220], + 4348: [[4316], 256], + 69702: [, 9], + 69785: [, , { 69818: 69786 }], + 69786: [[69785, 69818]], + 69787: [, , { 69818: 69788 }], + 69788: [[69787, 69818]], + 69797: [, , { 69818: 69803 }], + 69803: [[69797, 69818]], + 69817: [, 9], + 69818: [, 7] + }, + 4352: { + 69888: [, 230], + 69889: [, 230], + 69890: [, 230], + 69934: [[69937, 69927]], + 69935: [[69938, 69927]], + 69937: [, , { 69927: 69934 }], + 69938: [, , { 69927: 69935 }], + 69939: [, 9], + 69940: [, 9], + 70080: [, 9] + }, + 4864: { 4957: [, 230], 4958: [, 230], 4959: [, 230] }, + 5632: { 71350: [, 9], 71351: [, 7] }, + 5888: { 5908: [, 9], 5940: [, 9], 6098: [, 9], 6109: [, 230] }, + 6144: { 6313: [, 228] }, + 6400: { 6457: [, 222], 6458: [, 230], 6459: [, 220] }, + 6656: { + 6679: [, 230], + 6680: [, 220], + 6752: [, 9], + 6773: [, 230], + 6774: [, 230], + 6775: [, 230], + 6776: [, 230], + 6777: [, 230], + 6778: [, 230], + 6779: [, 230], + 6780: [, 230], + 6783: [, 220] + }, + 6912: { + 6917: [, , { 6965: 6918 }], + 6918: [[6917, 6965]], + 6919: [, , { 6965: 6920 }], + 6920: [[6919, 6965]], + 6921: [, , { 6965: 6922 }], + 6922: [[6921, 6965]], + 6923: [, , { 6965: 6924 }], + 6924: [[6923, 6965]], + 6925: [, , { 6965: 6926 }], + 6926: [[6925, 6965]], + 6929: [, , { 6965: 6930 }], + 6930: [[6929, 6965]], + 6964: [, 7], + 6970: [, , { 6965: 6971 }], + 6971: [[6970, 6965]], + 6972: [, , { 6965: 6973 }], + 6973: [[6972, 6965]], + 6974: [, , { 6965: 6976 }], + 6975: [, , { 6965: 6977 }], + 6976: [[6974, 6965]], + 6977: [[6975, 6965]], + 6978: [, , { 6965: 6979 }], + 6979: [[6978, 6965]], + 6980: [, 9], + 7019: [, 230], + 7020: [, 220], + 7021: [, 230], + 7022: [, 230], + 7023: [, 230], + 7024: [, 230], + 7025: [, 230], + 7026: [, 230], + 7027: [, 230], + 7082: [, 9], + 7083: [, 9], + 7142: [, 7], + 7154: [, 9], + 7155: [, 9] + }, + 7168: { + 7223: [, 7], + 7376: [, 230], + 7377: [, 230], + 7378: [, 230], + 7380: [, 1], + 7381: [, 220], + 7382: [, 220], + 7383: [, 220], + 7384: [, 220], + 7385: [, 220], + 7386: [, 230], + 7387: [, 230], + 7388: [, 220], + 7389: [, 220], + 7390: [, 220], + 7391: [, 220], + 7392: [, 230], + 7394: [, 1], + 7395: [, 1], + 7396: [, 1], + 7397: [, 1], + 7398: [, 1], + 7399: [, 1], + 7400: [, 1], + 7405: [, 220], + 7412: [, 230] + }, + 7424: { + 7468: [[65], 256], + 7469: [[198], 256], + 7470: [[66], 256], + 7472: [[68], 256], + 7473: [[69], 256], + 7474: [[398], 256], + 7475: [[71], 256], + 7476: [[72], 256], + 7477: [[73], 256], + 7478: [[74], 256], + 7479: [[75], 256], + 7480: [[76], 256], + 7481: [[77], 256], + 7482: [[78], 256], + 7484: [[79], 256], + 7485: [[546], 256], + 7486: [[80], 256], + 7487: [[82], 256], + 7488: [[84], 256], + 7489: [[85], 256], + 7490: [[87], 256], + 7491: [[97], 256], + 7492: [[592], 256], + 7493: [[593], 256], + 7494: [[7426], 256], + 7495: [[98], 256], + 7496: [[100], 256], + 7497: [[101], 256], + 7498: [[601], 256], + 7499: [[603], 256], + 7500: [[604], 256], + 7501: [[103], 256], + 7503: [[107], 256], + 7504: [[109], 256], + 7505: [[331], 256], + 7506: [[111], 256], + 7507: [[596], 256], + 7508: [[7446], 256], + 7509: [[7447], 256], + 7510: [[112], 256], + 7511: [[116], 256], + 7512: [[117], 256], + 7513: [[7453], 256], + 7514: [[623], 256], + 7515: [[118], 256], + 7516: [[7461], 256], + 7517: [[946], 256], + 7518: [[947], 256], + 7519: [[948], 256], + 7520: [[966], 256], + 7521: [[967], 256], + 7522: [[105], 256], + 7523: [[114], 256], + 7524: [[117], 256], + 7525: [[118], 256], + 7526: [[946], 256], + 7527: [[947], 256], + 7528: [[961], 256], + 7529: [[966], 256], + 7530: [[967], 256], + 7544: [[1085], 256], + 7579: [[594], 256], + 7580: [[99], 256], + 7581: [[597], 256], + 7582: [[240], 256], + 7583: [[604], 256], + 7584: [[102], 256], + 7585: [[607], 256], + 7586: [[609], 256], + 7587: [[613], 256], + 7588: [[616], 256], + 7589: [[617], 256], + 7590: [[618], 256], + 7591: [[7547], 256], + 7592: [[669], 256], + 7593: [[621], 256], + 7594: [[7557], 256], + 7595: [[671], 256], + 7596: [[625], 256], + 7597: [[624], 256], + 7598: [[626], 256], + 7599: [[627], 256], + 7600: [[628], 256], + 7601: [[629], 256], + 7602: [[632], 256], + 7603: [[642], 256], + 7604: [[643], 256], + 7605: [[427], 256], + 7606: [[649], 256], + 7607: [[650], 256], + 7608: [[7452], 256], + 7609: [[651], 256], + 7610: [[652], 256], + 7611: [[122], 256], + 7612: [[656], 256], + 7613: [[657], 256], + 7614: [[658], 256], + 7615: [[952], 256], + 7616: [, 230], + 7617: [, 230], + 7618: [, 220], + 7619: [, 230], + 7620: [, 230], + 7621: [, 230], + 7622: [, 230], + 7623: [, 230], + 7624: [, 230], + 7625: [, 230], + 7626: [, 220], + 7627: [, 230], + 7628: [, 230], + 7629: [, 234], + 7630: [, 214], + 7631: [, 220], + 7632: [, 202], + 7633: [, 230], + 7634: [, 230], + 7635: [, 230], + 7636: [, 230], + 7637: [, 230], + 7638: [, 230], + 7639: [, 230], + 7640: [, 230], + 7641: [, 230], + 7642: [, 230], + 7643: [, 230], + 7644: [, 230], + 7645: [, 230], + 7646: [, 230], + 7647: [, 230], + 7648: [, 230], + 7649: [, 230], + 7650: [, 230], + 7651: [, 230], + 7652: [, 230], + 7653: [, 230], + 7654: [, 230], + 7676: [, 233], + 7677: [, 220], + 7678: [, 230], + 7679: [, 220] + }, + 7680: { + 7680: [[65, 805]], + 7681: [[97, 805]], + 7682: [[66, 775]], + 7683: [[98, 775]], + 7684: [[66, 803]], + 7685: [[98, 803]], + 7686: [[66, 817]], + 7687: [[98, 817]], + 7688: [[199, 769]], + 7689: [[231, 769]], + 7690: [[68, 775]], + 7691: [[100, 775]], + 7692: [[68, 803]], + 7693: [[100, 803]], + 7694: [[68, 817]], + 7695: [[100, 817]], + 7696: [[68, 807]], + 7697: [[100, 807]], + 7698: [[68, 813]], + 7699: [[100, 813]], + 7700: [[274, 768]], + 7701: [[275, 768]], + 7702: [[274, 769]], + 7703: [[275, 769]], + 7704: [[69, 813]], + 7705: [[101, 813]], + 7706: [[69, 816]], + 7707: [[101, 816]], + 7708: [[552, 774]], + 7709: [[553, 774]], + 7710: [[70, 775]], + 7711: [[102, 775]], + 7712: [[71, 772]], + 7713: [[103, 772]], + 7714: [[72, 775]], + 7715: [[104, 775]], + 7716: [[72, 803]], + 7717: [[104, 803]], + 7718: [[72, 776]], + 7719: [[104, 776]], + 7720: [[72, 807]], + 7721: [[104, 807]], + 7722: [[72, 814]], + 7723: [[104, 814]], + 7724: [[73, 816]], + 7725: [[105, 816]], + 7726: [[207, 769]], + 7727: [[239, 769]], + 7728: [[75, 769]], + 7729: [[107, 769]], + 7730: [[75, 803]], + 7731: [[107, 803]], + 7732: [[75, 817]], + 7733: [[107, 817]], + 7734: [[76, 803], , { 772: 7736 }], + 7735: [[108, 803], , { 772: 7737 }], + 7736: [[7734, 772]], + 7737: [[7735, 772]], + 7738: [[76, 817]], + 7739: [[108, 817]], + 7740: [[76, 813]], + 7741: [[108, 813]], + 7742: [[77, 769]], + 7743: [[109, 769]], + 7744: [[77, 775]], + 7745: [[109, 775]], + 7746: [[77, 803]], + 7747: [[109, 803]], + 7748: [[78, 775]], + 7749: [[110, 775]], + 7750: [[78, 803]], + 7751: [[110, 803]], + 7752: [[78, 817]], + 7753: [[110, 817]], + 7754: [[78, 813]], + 7755: [[110, 813]], + 7756: [[213, 769]], + 7757: [[245, 769]], + 7758: [[213, 776]], + 7759: [[245, 776]], + 7760: [[332, 768]], + 7761: [[333, 768]], + 7762: [[332, 769]], + 7763: [[333, 769]], + 7764: [[80, 769]], + 7765: [[112, 769]], + 7766: [[80, 775]], + 7767: [[112, 775]], + 7768: [[82, 775]], + 7769: [[114, 775]], + 7770: [[82, 803], , { 772: 7772 }], + 7771: [[114, 803], , { 772: 7773 }], + 7772: [[7770, 772]], + 7773: [[7771, 772]], + 7774: [[82, 817]], + 7775: [[114, 817]], + 7776: [[83, 775]], + 7777: [[115, 775]], + 7778: [[83, 803], , { 775: 7784 }], + 7779: [[115, 803], , { 775: 7785 }], + 7780: [[346, 775]], + 7781: [[347, 775]], + 7782: [[352, 775]], + 7783: [[353, 775]], + 7784: [[7778, 775]], + 7785: [[7779, 775]], + 7786: [[84, 775]], + 7787: [[116, 775]], + 7788: [[84, 803]], + 7789: [[116, 803]], + 7790: [[84, 817]], + 7791: [[116, 817]], + 7792: [[84, 813]], + 7793: [[116, 813]], + 7794: [[85, 804]], + 7795: [[117, 804]], + 7796: [[85, 816]], + 7797: [[117, 816]], + 7798: [[85, 813]], + 7799: [[117, 813]], + 7800: [[360, 769]], + 7801: [[361, 769]], + 7802: [[362, 776]], + 7803: [[363, 776]], + 7804: [[86, 771]], + 7805: [[118, 771]], + 7806: [[86, 803]], + 7807: [[118, 803]], + 7808: [[87, 768]], + 7809: [[119, 768]], + 7810: [[87, 769]], + 7811: [[119, 769]], + 7812: [[87, 776]], + 7813: [[119, 776]], + 7814: [[87, 775]], + 7815: [[119, 775]], + 7816: [[87, 803]], + 7817: [[119, 803]], + 7818: [[88, 775]], + 7819: [[120, 775]], + 7820: [[88, 776]], + 7821: [[120, 776]], + 7822: [[89, 775]], + 7823: [[121, 775]], + 7824: [[90, 770]], + 7825: [[122, 770]], + 7826: [[90, 803]], + 7827: [[122, 803]], + 7828: [[90, 817]], + 7829: [[122, 817]], + 7830: [[104, 817]], + 7831: [[116, 776]], + 7832: [[119, 778]], + 7833: [[121, 778]], + 7834: [[97, 702], 256], + 7835: [[383, 775]], + 7840: [[65, 803], , { 770: 7852, 774: 7862 }], + 7841: [[97, 803], , { 770: 7853, 774: 7863 }], + 7842: [[65, 777]], + 7843: [[97, 777]], + 7844: [[194, 769]], + 7845: [[226, 769]], + 7846: [[194, 768]], + 7847: [[226, 768]], + 7848: [[194, 777]], + 7849: [[226, 777]], + 7850: [[194, 771]], + 7851: [[226, 771]], + 7852: [[7840, 770]], + 7853: [[7841, 770]], + 7854: [[258, 769]], + 7855: [[259, 769]], + 7856: [[258, 768]], + 7857: [[259, 768]], + 7858: [[258, 777]], + 7859: [[259, 777]], + 7860: [[258, 771]], + 7861: [[259, 771]], + 7862: [[7840, 774]], + 7863: [[7841, 774]], + 7864: [[69, 803], , { 770: 7878 }], + 7865: [[101, 803], , { 770: 7879 }], + 7866: [[69, 777]], + 7867: [[101, 777]], + 7868: [[69, 771]], + 7869: [[101, 771]], + 7870: [[202, 769]], + 7871: [[234, 769]], + 7872: [[202, 768]], + 7873: [[234, 768]], + 7874: [[202, 777]], + 7875: [[234, 777]], + 7876: [[202, 771]], + 7877: [[234, 771]], + 7878: [[7864, 770]], + 7879: [[7865, 770]], + 7880: [[73, 777]], + 7881: [[105, 777]], + 7882: [[73, 803]], + 7883: [[105, 803]], + 7884: [[79, 803], , { 770: 7896 }], + 7885: [[111, 803], , { 770: 7897 }], + 7886: [[79, 777]], + 7887: [[111, 777]], + 7888: [[212, 769]], + 7889: [[244, 769]], + 7890: [[212, 768]], + 7891: [[244, 768]], + 7892: [[212, 777]], + 7893: [[244, 777]], + 7894: [[212, 771]], + 7895: [[244, 771]], + 7896: [[7884, 770]], + 7897: [[7885, 770]], + 7898: [[416, 769]], + 7899: [[417, 769]], + 7900: [[416, 768]], + 7901: [[417, 768]], + 7902: [[416, 777]], + 7903: [[417, 777]], + 7904: [[416, 771]], + 7905: [[417, 771]], + 7906: [[416, 803]], + 7907: [[417, 803]], + 7908: [[85, 803]], + 7909: [[117, 803]], + 7910: [[85, 777]], + 7911: [[117, 777]], + 7912: [[431, 769]], + 7913: [[432, 769]], + 7914: [[431, 768]], + 7915: [[432, 768]], + 7916: [[431, 777]], + 7917: [[432, 777]], + 7918: [[431, 771]], + 7919: [[432, 771]], + 7920: [[431, 803]], + 7921: [[432, 803]], + 7922: [[89, 768]], + 7923: [[121, 768]], + 7924: [[89, 803]], + 7925: [[121, 803]], + 7926: [[89, 777]], + 7927: [[121, 777]], + 7928: [[89, 771]], + 7929: [[121, 771]] + }, + 7936: { + 7936: [[945, 787], , { 768: 7938, 769: 7940, 834: 7942, 837: 8064 }], + 7937: [[945, 788], , { 768: 7939, 769: 7941, 834: 7943, 837: 8065 }], + 7938: [[7936, 768], , { 837: 8066 }], + 7939: [[7937, 768], , { 837: 8067 }], + 7940: [[7936, 769], , { 837: 8068 }], + 7941: [[7937, 769], , { 837: 8069 }], + 7942: [[7936, 834], , { 837: 8070 }], + 7943: [[7937, 834], , { 837: 8071 }], + 7944: [[913, 787], , { 768: 7946, 769: 7948, 834: 7950, 837: 8072 }], + 7945: [[913, 788], , { 768: 7947, 769: 7949, 834: 7951, 837: 8073 }], + 7946: [[7944, 768], , { 837: 8074 }], + 7947: [[7945, 768], , { 837: 8075 }], + 7948: [[7944, 769], , { 837: 8076 }], + 7949: [[7945, 769], , { 837: 8077 }], + 7950: [[7944, 834], , { 837: 8078 }], + 7951: [[7945, 834], , { 837: 8079 }], + 7952: [[949, 787], , { 768: 7954, 769: 7956 }], + 7953: [[949, 788], , { 768: 7955, 769: 7957 }], + 7954: [[7952, 768]], + 7955: [[7953, 768]], + 7956: [[7952, 769]], + 7957: [[7953, 769]], + 7960: [[917, 787], , { 768: 7962, 769: 7964 }], + 7961: [[917, 788], , { 768: 7963, 769: 7965 }], + 7962: [[7960, 768]], + 7963: [[7961, 768]], + 7964: [[7960, 769]], + 7965: [[7961, 769]], + 7968: [[951, 787], , { 768: 7970, 769: 7972, 834: 7974, 837: 8080 }], + 7969: [[951, 788], , { 768: 7971, 769: 7973, 834: 7975, 837: 8081 }], + 7970: [[7968, 768], , { 837: 8082 }], + 7971: [[7969, 768], , { 837: 8083 }], + 7972: [[7968, 769], , { 837: 8084 }], + 7973: [[7969, 769], , { 837: 8085 }], + 7974: [[7968, 834], , { 837: 8086 }], + 7975: [[7969, 834], , { 837: 8087 }], + 7976: [[919, 787], , { 768: 7978, 769: 7980, 834: 7982, 837: 8088 }], + 7977: [[919, 788], , { 768: 7979, 769: 7981, 834: 7983, 837: 8089 }], + 7978: [[7976, 768], , { 837: 8090 }], + 7979: [[7977, 768], , { 837: 8091 }], + 7980: [[7976, 769], , { 837: 8092 }], + 7981: [[7977, 769], , { 837: 8093 }], + 7982: [[7976, 834], , { 837: 8094 }], + 7983: [[7977, 834], , { 837: 8095 }], + 7984: [[953, 787], , { 768: 7986, 769: 7988, 834: 7990 }], + 7985: [[953, 788], , { 768: 7987, 769: 7989, 834: 7991 }], + 7986: [[7984, 768]], + 7987: [[7985, 768]], + 7988: [[7984, 769]], + 7989: [[7985, 769]], + 7990: [[7984, 834]], + 7991: [[7985, 834]], + 7992: [[921, 787], , { 768: 7994, 769: 7996, 834: 7998 }], + 7993: [[921, 788], , { 768: 7995, 769: 7997, 834: 7999 }], + 7994: [[7992, 768]], + 7995: [[7993, 768]], + 7996: [[7992, 769]], + 7997: [[7993, 769]], + 7998: [[7992, 834]], + 7999: [[7993, 834]], + 8000: [[959, 787], , { 768: 8002, 769: 8004 }], + 8001: [[959, 788], , { 768: 8003, 769: 8005 }], + 8002: [[8000, 768]], + 8003: [[8001, 768]], + 8004: [[8000, 769]], + 8005: [[8001, 769]], + 8008: [[927, 787], , { 768: 8010, 769: 8012 }], + 8009: [[927, 788], , { 768: 8011, 769: 8013 }], + 8010: [[8008, 768]], + 8011: [[8009, 768]], + 8012: [[8008, 769]], + 8013: [[8009, 769]], + 8016: [[965, 787], , { 768: 8018, 769: 8020, 834: 8022 }], + 8017: [[965, 788], , { 768: 8019, 769: 8021, 834: 8023 }], + 8018: [[8016, 768]], + 8019: [[8017, 768]], + 8020: [[8016, 769]], + 8021: [[8017, 769]], + 8022: [[8016, 834]], + 8023: [[8017, 834]], + 8025: [[933, 788], , { 768: 8027, 769: 8029, 834: 8031 }], + 8027: [[8025, 768]], + 8029: [[8025, 769]], + 8031: [[8025, 834]], + 8032: [[969, 787], , { 768: 8034, 769: 8036, 834: 8038, 837: 8096 }], + 8033: [[969, 788], , { 768: 8035, 769: 8037, 834: 8039, 837: 8097 }], + 8034: [[8032, 768], , { 837: 8098 }], + 8035: [[8033, 768], , { 837: 8099 }], + 8036: [[8032, 769], , { 837: 8100 }], + 8037: [[8033, 769], , { 837: 8101 }], + 8038: [[8032, 834], , { 837: 8102 }], + 8039: [[8033, 834], , { 837: 8103 }], + 8040: [[937, 787], , { 768: 8042, 769: 8044, 834: 8046, 837: 8104 }], + 8041: [[937, 788], , { 768: 8043, 769: 8045, 834: 8047, 837: 8105 }], + 8042: [[8040, 768], , { 837: 8106 }], + 8043: [[8041, 768], , { 837: 8107 }], + 8044: [[8040, 769], , { 837: 8108 }], + 8045: [[8041, 769], , { 837: 8109 }], + 8046: [[8040, 834], , { 837: 8110 }], + 8047: [[8041, 834], , { 837: 8111 }], + 8048: [[945, 768], , { 837: 8114 }], + 8049: [[940]], + 8050: [[949, 768]], + 8051: [[941]], + 8052: [[951, 768], , { 837: 8130 }], + 8053: [[942]], + 8054: [[953, 768]], + 8055: [[943]], + 8056: [[959, 768]], + 8057: [[972]], + 8058: [[965, 768]], + 8059: [[973]], + 8060: [[969, 768], , { 837: 8178 }], + 8061: [[974]], + 8064: [[7936, 837]], + 8065: [[7937, 837]], + 8066: [[7938, 837]], + 8067: [[7939, 837]], + 8068: [[7940, 837]], + 8069: [[7941, 837]], + 8070: [[7942, 837]], + 8071: [[7943, 837]], + 8072: [[7944, 837]], + 8073: [[7945, 837]], + 8074: [[7946, 837]], + 8075: [[7947, 837]], + 8076: [[7948, 837]], + 8077: [[7949, 837]], + 8078: [[7950, 837]], + 8079: [[7951, 837]], + 8080: [[7968, 837]], + 8081: [[7969, 837]], + 8082: [[7970, 837]], + 8083: [[7971, 837]], + 8084: [[7972, 837]], + 8085: [[7973, 837]], + 8086: [[7974, 837]], + 8087: [[7975, 837]], + 8088: [[7976, 837]], + 8089: [[7977, 837]], + 8090: [[7978, 837]], + 8091: [[7979, 837]], + 8092: [[7980, 837]], + 8093: [[7981, 837]], + 8094: [[7982, 837]], + 8095: [[7983, 837]], + 8096: [[8032, 837]], + 8097: [[8033, 837]], + 8098: [[8034, 837]], + 8099: [[8035, 837]], + 8100: [[8036, 837]], + 8101: [[8037, 837]], + 8102: [[8038, 837]], + 8103: [[8039, 837]], + 8104: [[8040, 837]], + 8105: [[8041, 837]], + 8106: [[8042, 837]], + 8107: [[8043, 837]], + 8108: [[8044, 837]], + 8109: [[8045, 837]], + 8110: [[8046, 837]], + 8111: [[8047, 837]], + 8112: [[945, 774]], + 8113: [[945, 772]], + 8114: [[8048, 837]], + 8115: [[945, 837]], + 8116: [[940, 837]], + 8118: [[945, 834], , { 837: 8119 }], + 8119: [[8118, 837]], + 8120: [[913, 774]], + 8121: [[913, 772]], + 8122: [[913, 768]], + 8123: [[902]], + 8124: [[913, 837]], + 8125: [[32, 787], 256], + 8126: [[953]], + 8127: [[32, 787], 256, { 768: 8141, 769: 8142, 834: 8143 }], + 8128: [[32, 834], 256], + 8129: [[168, 834]], + 8130: [[8052, 837]], + 8131: [[951, 837]], + 8132: [[942, 837]], + 8134: [[951, 834], , { 837: 8135 }], + 8135: [[8134, 837]], + 8136: [[917, 768]], + 8137: [[904]], + 8138: [[919, 768]], + 8139: [[905]], + 8140: [[919, 837]], + 8141: [[8127, 768]], + 8142: [[8127, 769]], + 8143: [[8127, 834]], + 8144: [[953, 774]], + 8145: [[953, 772]], + 8146: [[970, 768]], + 8147: [[912]], + 8150: [[953, 834]], + 8151: [[970, 834]], + 8152: [[921, 774]], + 8153: [[921, 772]], + 8154: [[921, 768]], + 8155: [[906]], + 8157: [[8190, 768]], + 8158: [[8190, 769]], + 8159: [[8190, 834]], + 8160: [[965, 774]], + 8161: [[965, 772]], + 8162: [[971, 768]], + 8163: [[944]], + 8164: [[961, 787]], + 8165: [[961, 788]], + 8166: [[965, 834]], + 8167: [[971, 834]], + 8168: [[933, 774]], + 8169: [[933, 772]], + 8170: [[933, 768]], + 8171: [[910]], + 8172: [[929, 788]], + 8173: [[168, 768]], + 8174: [[901]], + 8175: [[96]], + 8178: [[8060, 837]], + 8179: [[969, 837]], + 8180: [[974, 837]], + 8182: [[969, 834], , { 837: 8183 }], + 8183: [[8182, 837]], + 8184: [[927, 768]], + 8185: [[908]], + 8186: [[937, 768]], + 8187: [[911]], + 8188: [[937, 837]], + 8189: [[180]], + 8190: [[32, 788], 256, { 768: 8157, 769: 8158, 834: 8159 }] + }, + 8192: { + 8192: [[8194]], + 8193: [[8195]], + 8194: [[32], 256], + 8195: [[32], 256], + 8196: [[32], 256], + 8197: [[32], 256], + 8198: [[32], 256], + 8199: [[32], 256], + 8200: [[32], 256], + 8201: [[32], 256], + 8202: [[32], 256], + 8209: [[8208], 256], + 8215: [[32, 819], 256], + 8228: [[46], 256], + 8229: [[46, 46], 256], + 8230: [[46, 46, 46], 256], + 8239: [[32], 256], + 8243: [[8242, 8242], 256], + 8244: [[8242, 8242, 8242], 256], + 8246: [[8245, 8245], 256], + 8247: [[8245, 8245, 8245], 256], + 8252: [[33, 33], 256], + 8254: [[32, 773], 256], + 8263: [[63, 63], 256], + 8264: [[63, 33], 256], + 8265: [[33, 63], 256], + 8279: [[8242, 8242, 8242, 8242], 256], + 8287: [[32], 256], + 8304: [[48], 256], + 8305: [[105], 256], + 8308: [[52], 256], + 8309: [[53], 256], + 8310: [[54], 256], + 8311: [[55], 256], + 8312: [[56], 256], + 8313: [[57], 256], + 8314: [[43], 256], + 8315: [[8722], 256], + 8316: [[61], 256], + 8317: [[40], 256], + 8318: [[41], 256], + 8319: [[110], 256], + 8320: [[48], 256], + 8321: [[49], 256], + 8322: [[50], 256], + 8323: [[51], 256], + 8324: [[52], 256], + 8325: [[53], 256], + 8326: [[54], 256], + 8327: [[55], 256], + 8328: [[56], 256], + 8329: [[57], 256], + 8330: [[43], 256], + 8331: [[8722], 256], + 8332: [[61], 256], + 8333: [[40], 256], + 8334: [[41], 256], + 8336: [[97], 256], + 8337: [[101], 256], + 8338: [[111], 256], + 8339: [[120], 256], + 8340: [[601], 256], + 8341: [[104], 256], + 8342: [[107], 256], + 8343: [[108], 256], + 8344: [[109], 256], + 8345: [[110], 256], + 8346: [[112], 256], + 8347: [[115], 256], + 8348: [[116], 256], + 8360: [[82, 115], 256], + 8400: [, 230], + 8401: [, 230], + 8402: [, 1], + 8403: [, 1], + 8404: [, 230], + 8405: [, 230], + 8406: [, 230], + 8407: [, 230], + 8408: [, 1], + 8409: [, 1], + 8410: [, 1], + 8411: [, 230], + 8412: [, 230], + 8417: [, 230], + 8421: [, 1], + 8422: [, 1], + 8423: [, 230], + 8424: [, 220], + 8425: [, 230], + 8426: [, 1], + 8427: [, 1], + 8428: [, 220], + 8429: [, 220], + 8430: [, 220], + 8431: [, 220], + 8432: [, 230] + }, + 8448: { + 8448: [[97, 47, 99], 256], + 8449: [[97, 47, 115], 256], + 8450: [[67], 256], + 8451: [[176, 67], 256], + 8453: [[99, 47, 111], 256], + 8454: [[99, 47, 117], 256], + 8455: [[400], 256], + 8457: [[176, 70], 256], + 8458: [[103], 256], + 8459: [[72], 256], + 8460: [[72], 256], + 8461: [[72], 256], + 8462: [[104], 256], + 8463: [[295], 256], + 8464: [[73], 256], + 8465: [[73], 256], + 8466: [[76], 256], + 8467: [[108], 256], + 8469: [[78], 256], + 8470: [[78, 111], 256], + 8473: [[80], 256], + 8474: [[81], 256], + 8475: [[82], 256], + 8476: [[82], 256], + 8477: [[82], 256], + 8480: [[83, 77], 256], + 8481: [[84, 69, 76], 256], + 8482: [[84, 77], 256], + 8484: [[90], 256], + 8486: [[937]], + 8488: [[90], 256], + 8490: [[75]], + 8491: [[197]], + 8492: [[66], 256], + 8493: [[67], 256], + 8495: [[101], 256], + 8496: [[69], 256], + 8497: [[70], 256], + 8499: [[77], 256], + 8500: [[111], 256], + 8501: [[1488], 256], + 8502: [[1489], 256], + 8503: [[1490], 256], + 8504: [[1491], 256], + 8505: [[105], 256], + 8507: [[70, 65, 88], 256], + 8508: [[960], 256], + 8509: [[947], 256], + 8510: [[915], 256], + 8511: [[928], 256], + 8512: [[8721], 256], + 8517: [[68], 256], + 8518: [[100], 256], + 8519: [[101], 256], + 8520: [[105], 256], + 8521: [[106], 256], + 8528: [[49, 8260, 55], 256], + 8529: [[49, 8260, 57], 256], + 8530: [[49, 8260, 49, 48], 256], + 8531: [[49, 8260, 51], 256], + 8532: [[50, 8260, 51], 256], + 8533: [[49, 8260, 53], 256], + 8534: [[50, 8260, 53], 256], + 8535: [[51, 8260, 53], 256], + 8536: [[52, 8260, 53], 256], + 8537: [[49, 8260, 54], 256], + 8538: [[53, 8260, 54], 256], + 8539: [[49, 8260, 56], 256], + 8540: [[51, 8260, 56], 256], + 8541: [[53, 8260, 56], 256], + 8542: [[55, 8260, 56], 256], + 8543: [[49, 8260], 256], + 8544: [[73], 256], + 8545: [[73, 73], 256], + 8546: [[73, 73, 73], 256], + 8547: [[73, 86], 256], + 8548: [[86], 256], + 8549: [[86, 73], 256], + 8550: [[86, 73, 73], 256], + 8551: [[86, 73, 73, 73], 256], + 8552: [[73, 88], 256], + 8553: [[88], 256], + 8554: [[88, 73], 256], + 8555: [[88, 73, 73], 256], + 8556: [[76], 256], + 8557: [[67], 256], + 8558: [[68], 256], + 8559: [[77], 256], + 8560: [[105], 256], + 8561: [[105, 105], 256], + 8562: [[105, 105, 105], 256], + 8563: [[105, 118], 256], + 8564: [[118], 256], + 8565: [[118, 105], 256], + 8566: [[118, 105, 105], 256], + 8567: [[118, 105, 105, 105], 256], + 8568: [[105, 120], 256], + 8569: [[120], 256], + 8570: [[120, 105], 256], + 8571: [[120, 105, 105], 256], + 8572: [[108], 256], + 8573: [[99], 256], + 8574: [[100], 256], + 8575: [[109], 256], + 8585: [[48, 8260, 51], 256], + 8592: [, , { 824: 8602 }], + 8594: [, , { 824: 8603 }], + 8596: [, , { 824: 8622 }], + 8602: [[8592, 824]], + 8603: [[8594, 824]], + 8622: [[8596, 824]], + 8653: [[8656, 824]], + 8654: [[8660, 824]], + 8655: [[8658, 824]], + 8656: [, , { 824: 8653 }], + 8658: [, , { 824: 8655 }], + 8660: [, , { 824: 8654 }] + }, + 8704: { + 8707: [, , { 824: 8708 }], + 8708: [[8707, 824]], + 8712: [, , { 824: 8713 }], + 8713: [[8712, 824]], + 8715: [, , { 824: 8716 }], + 8716: [[8715, 824]], + 8739: [, , { 824: 8740 }], + 8740: [[8739, 824]], + 8741: [, , { 824: 8742 }], + 8742: [[8741, 824]], + 8748: [[8747, 8747], 256], + 8749: [[8747, 8747, 8747], 256], + 8751: [[8750, 8750], 256], + 8752: [[8750, 8750, 8750], 256], + 8764: [, , { 824: 8769 }], + 8769: [[8764, 824]], + 8771: [, , { 824: 8772 }], + 8772: [[8771, 824]], + 8773: [, , { 824: 8775 }], + 8775: [[8773, 824]], + 8776: [, , { 824: 8777 }], + 8777: [[8776, 824]], + 8781: [, , { 824: 8813 }], + 8800: [[61, 824]], + 8801: [, , { 824: 8802 }], + 8802: [[8801, 824]], + 8804: [, , { 824: 8816 }], + 8805: [, , { 824: 8817 }], + 8813: [[8781, 824]], + 8814: [[60, 824]], + 8815: [[62, 824]], + 8816: [[8804, 824]], + 8817: [[8805, 824]], + 8818: [, , { 824: 8820 }], + 8819: [, , { 824: 8821 }], + 8820: [[8818, 824]], + 8821: [[8819, 824]], + 8822: [, , { 824: 8824 }], + 8823: [, , { 824: 8825 }], + 8824: [[8822, 824]], + 8825: [[8823, 824]], + 8826: [, , { 824: 8832 }], + 8827: [, , { 824: 8833 }], + 8828: [, , { 824: 8928 }], + 8829: [, , { 824: 8929 }], + 8832: [[8826, 824]], + 8833: [[8827, 824]], + 8834: [, , { 824: 8836 }], + 8835: [, , { 824: 8837 }], + 8836: [[8834, 824]], + 8837: [[8835, 824]], + 8838: [, , { 824: 8840 }], + 8839: [, , { 824: 8841 }], + 8840: [[8838, 824]], + 8841: [[8839, 824]], + 8849: [, , { 824: 8930 }], + 8850: [, , { 824: 8931 }], + 8866: [, , { 824: 8876 }], + 8872: [, , { 824: 8877 }], + 8873: [, , { 824: 8878 }], + 8875: [, , { 824: 8879 }], + 8876: [[8866, 824]], + 8877: [[8872, 824]], + 8878: [[8873, 824]], + 8879: [[8875, 824]], + 8882: [, , { 824: 8938 }], + 8883: [, , { 824: 8939 }], + 8884: [, , { 824: 8940 }], + 8885: [, , { 824: 8941 }], + 8928: [[8828, 824]], + 8929: [[8829, 824]], + 8930: [[8849, 824]], + 8931: [[8850, 824]], + 8938: [[8882, 824]], + 8939: [[8883, 824]], + 8940: [[8884, 824]], + 8941: [[8885, 824]] + }, + 8960: { 9001: [[12296]], 9002: [[12297]] }, + 9216: { + 9312: [[49], 256], + 9313: [[50], 256], + 9314: [[51], 256], + 9315: [[52], 256], + 9316: [[53], 256], + 9317: [[54], 256], + 9318: [[55], 256], + 9319: [[56], 256], + 9320: [[57], 256], + 9321: [[49, 48], 256], + 9322: [[49, 49], 256], + 9323: [[49, 50], 256], + 9324: [[49, 51], 256], + 9325: [[49, 52], 256], + 9326: [[49, 53], 256], + 9327: [[49, 54], 256], + 9328: [[49, 55], 256], + 9329: [[49, 56], 256], + 9330: [[49, 57], 256], + 9331: [[50, 48], 256], + 9332: [[40, 49, 41], 256], + 9333: [[40, 50, 41], 256], + 9334: [[40, 51, 41], 256], + 9335: [[40, 52, 41], 256], + 9336: [[40, 53, 41], 256], + 9337: [[40, 54, 41], 256], + 9338: [[40, 55, 41], 256], + 9339: [[40, 56, 41], 256], + 9340: [[40, 57, 41], 256], + 9341: [[40, 49, 48, 41], 256], + 9342: [[40, 49, 49, 41], 256], + 9343: [[40, 49, 50, 41], 256], + 9344: [[40, 49, 51, 41], 256], + 9345: [[40, 49, 52, 41], 256], + 9346: [[40, 49, 53, 41], 256], + 9347: [[40, 49, 54, 41], 256], + 9348: [[40, 49, 55, 41], 256], + 9349: [[40, 49, 56, 41], 256], + 9350: [[40, 49, 57, 41], 256], + 9351: [[40, 50, 48, 41], 256], + 9352: [[49, 46], 256], + 9353: [[50, 46], 256], + 9354: [[51, 46], 256], + 9355: [[52, 46], 256], + 9356: [[53, 46], 256], + 9357: [[54, 46], 256], + 9358: [[55, 46], 256], + 9359: [[56, 46], 256], + 9360: [[57, 46], 256], + 9361: [[49, 48, 46], 256], + 9362: [[49, 49, 46], 256], + 9363: [[49, 50, 46], 256], + 9364: [[49, 51, 46], 256], + 9365: [[49, 52, 46], 256], + 9366: [[49, 53, 46], 256], + 9367: [[49, 54, 46], 256], + 9368: [[49, 55, 46], 256], + 9369: [[49, 56, 46], 256], + 9370: [[49, 57, 46], 256], + 9371: [[50, 48, 46], 256], + 9372: [[40, 97, 41], 256], + 9373: [[40, 98, 41], 256], + 9374: [[40, 99, 41], 256], + 9375: [[40, 100, 41], 256], + 9376: [[40, 101, 41], 256], + 9377: [[40, 102, 41], 256], + 9378: [[40, 103, 41], 256], + 9379: [[40, 104, 41], 256], + 9380: [[40, 105, 41], 256], + 9381: [[40, 106, 41], 256], + 9382: [[40, 107, 41], 256], + 9383: [[40, 108, 41], 256], + 9384: [[40, 109, 41], 256], + 9385: [[40, 110, 41], 256], + 9386: [[40, 111, 41], 256], + 9387: [[40, 112, 41], 256], + 9388: [[40, 113, 41], 256], + 9389: [[40, 114, 41], 256], + 9390: [[40, 115, 41], 256], + 9391: [[40, 116, 41], 256], + 9392: [[40, 117, 41], 256], + 9393: [[40, 118, 41], 256], + 9394: [[40, 119, 41], 256], + 9395: [[40, 120, 41], 256], + 9396: [[40, 121, 41], 256], + 9397: [[40, 122, 41], 256], + 9398: [[65], 256], + 9399: [[66], 256], + 9400: [[67], 256], + 9401: [[68], 256], + 9402: [[69], 256], + 9403: [[70], 256], + 9404: [[71], 256], + 9405: [[72], 256], + 9406: [[73], 256], + 9407: [[74], 256], + 9408: [[75], 256], + 9409: [[76], 256], + 9410: [[77], 256], + 9411: [[78], 256], + 9412: [[79], 256], + 9413: [[80], 256], + 9414: [[81], 256], + 9415: [[82], 256], + 9416: [[83], 256], + 9417: [[84], 256], + 9418: [[85], 256], + 9419: [[86], 256], + 9420: [[87], 256], + 9421: [[88], 256], + 9422: [[89], 256], + 9423: [[90], 256], + 9424: [[97], 256], + 9425: [[98], 256], + 9426: [[99], 256], + 9427: [[100], 256], + 9428: [[101], 256], + 9429: [[102], 256], + 9430: [[103], 256], + 9431: [[104], 256], + 9432: [[105], 256], + 9433: [[106], 256], + 9434: [[107], 256], + 9435: [[108], 256], + 9436: [[109], 256], + 9437: [[110], 256], + 9438: [[111], 256], + 9439: [[112], 256], + 9440: [[113], 256], + 9441: [[114], 256], + 9442: [[115], 256], + 9443: [[116], 256], + 9444: [[117], 256], + 9445: [[118], 256], + 9446: [[119], 256], + 9447: [[120], 256], + 9448: [[121], 256], + 9449: [[122], 256], + 9450: [[48], 256] + }, + 10752: { + 10764: [[8747, 8747, 8747, 8747], 256], + 10868: [[58, 58, 61], 256], + 10869: [[61, 61], 256], + 10870: [[61, 61, 61], 256], + 10972: [[10973, 824], 512] + }, + 11264: { + 11388: [[106], 256], + 11389: [[86], 256], + 11503: [, 230], + 11504: [, 230], + 11505: [, 230] + }, + 11520: { + 11631: [[11617], 256], + 11647: [, 9], + 11744: [, 230], + 11745: [, 230], + 11746: [, 230], + 11747: [, 230], + 11748: [, 230], + 11749: [, 230], + 11750: [, 230], + 11751: [, 230], + 11752: [, 230], + 11753: [, 230], + 11754: [, 230], + 11755: [, 230], + 11756: [, 230], + 11757: [, 230], + 11758: [, 230], + 11759: [, 230], + 11760: [, 230], + 11761: [, 230], + 11762: [, 230], + 11763: [, 230], + 11764: [, 230], + 11765: [, 230], + 11766: [, 230], + 11767: [, 230], + 11768: [, 230], + 11769: [, 230], + 11770: [, 230], + 11771: [, 230], + 11772: [, 230], + 11773: [, 230], + 11774: [, 230], + 11775: [, 230] + }, + 11776: { 11935: [[27597], 256], 12019: [[40863], 256] }, + 12032: { + 12032: [[19968], 256], + 12033: [[20008], 256], + 12034: [[20022], 256], + 12035: [[20031], 256], + 12036: [[20057], 256], + 12037: [[20101], 256], + 12038: [[20108], 256], + 12039: [[20128], 256], + 12040: [[20154], 256], + 12041: [[20799], 256], + 12042: [[20837], 256], + 12043: [[20843], 256], + 12044: [[20866], 256], + 12045: [[20886], 256], + 12046: [[20907], 256], + 12047: [[20960], 256], + 12048: [[20981], 256], + 12049: [[20992], 256], + 12050: [[21147], 256], + 12051: [[21241], 256], + 12052: [[21269], 256], + 12053: [[21274], 256], + 12054: [[21304], 256], + 12055: [[21313], 256], + 12056: [[21340], 256], + 12057: [[21353], 256], + 12058: [[21378], 256], + 12059: [[21430], 256], + 12060: [[21448], 256], + 12061: [[21475], 256], + 12062: [[22231], 256], + 12063: [[22303], 256], + 12064: [[22763], 256], + 12065: [[22786], 256], + 12066: [[22794], 256], + 12067: [[22805], 256], + 12068: [[22823], 256], + 12069: [[22899], 256], + 12070: [[23376], 256], + 12071: [[23424], 256], + 12072: [[23544], 256], + 12073: [[23567], 256], + 12074: [[23586], 256], + 12075: [[23608], 256], + 12076: [[23662], 256], + 12077: [[23665], 256], + 12078: [[24027], 256], + 12079: [[24037], 256], + 12080: [[24049], 256], + 12081: [[24062], 256], + 12082: [[24178], 256], + 12083: [[24186], 256], + 12084: [[24191], 256], + 12085: [[24308], 256], + 12086: [[24318], 256], + 12087: [[24331], 256], + 12088: [[24339], 256], + 12089: [[24400], 256], + 12090: [[24417], 256], + 12091: [[24435], 256], + 12092: [[24515], 256], + 12093: [[25096], 256], + 12094: [[25142], 256], + 12095: [[25163], 256], + 12096: [[25903], 256], + 12097: [[25908], 256], + 12098: [[25991], 256], + 12099: [[26007], 256], + 12100: [[26020], 256], + 12101: [[26041], 256], + 12102: [[26080], 256], + 12103: [[26085], 256], + 12104: [[26352], 256], + 12105: [[26376], 256], + 12106: [[26408], 256], + 12107: [[27424], 256], + 12108: [[27490], 256], + 12109: [[27513], 256], + 12110: [[27571], 256], + 12111: [[27595], 256], + 12112: [[27604], 256], + 12113: [[27611], 256], + 12114: [[27663], 256], + 12115: [[27668], 256], + 12116: [[27700], 256], + 12117: [[28779], 256], + 12118: [[29226], 256], + 12119: [[29238], 256], + 12120: [[29243], 256], + 12121: [[29247], 256], + 12122: [[29255], 256], + 12123: [[29273], 256], + 12124: [[29275], 256], + 12125: [[29356], 256], + 12126: [[29572], 256], + 12127: [[29577], 256], + 12128: [[29916], 256], + 12129: [[29926], 256], + 12130: [[29976], 256], + 12131: [[29983], 256], + 12132: [[29992], 256], + 12133: [[30000], 256], + 12134: [[30091], 256], + 12135: [[30098], 256], + 12136: [[30326], 256], + 12137: [[30333], 256], + 12138: [[30382], 256], + 12139: [[30399], 256], + 12140: [[30446], 256], + 12141: [[30683], 256], + 12142: [[30690], 256], + 12143: [[30707], 256], + 12144: [[31034], 256], + 12145: [[31160], 256], + 12146: [[31166], 256], + 12147: [[31348], 256], + 12148: [[31435], 256], + 12149: [[31481], 256], + 12150: [[31859], 256], + 12151: [[31992], 256], + 12152: [[32566], 256], + 12153: [[32593], 256], + 12154: [[32650], 256], + 12155: [[32701], 256], + 12156: [[32769], 256], + 12157: [[32780], 256], + 12158: [[32786], 256], + 12159: [[32819], 256], + 12160: [[32895], 256], + 12161: [[32905], 256], + 12162: [[33251], 256], + 12163: [[33258], 256], + 12164: [[33267], 256], + 12165: [[33276], 256], + 12166: [[33292], 256], + 12167: [[33307], 256], + 12168: [[33311], 256], + 12169: [[33390], 256], + 12170: [[33394], 256], + 12171: [[33400], 256], + 12172: [[34381], 256], + 12173: [[34411], 256], + 12174: [[34880], 256], + 12175: [[34892], 256], + 12176: [[34915], 256], + 12177: [[35198], 256], + 12178: [[35211], 256], + 12179: [[35282], 256], + 12180: [[35328], 256], + 12181: [[35895], 256], + 12182: [[35910], 256], + 12183: [[35925], 256], + 12184: [[35960], 256], + 12185: [[35997], 256], + 12186: [[36196], 256], + 12187: [[36208], 256], + 12188: [[36275], 256], + 12189: [[36523], 256], + 12190: [[36554], 256], + 12191: [[36763], 256], + 12192: [[36784], 256], + 12193: [[36789], 256], + 12194: [[37009], 256], + 12195: [[37193], 256], + 12196: [[37318], 256], + 12197: [[37324], 256], + 12198: [[37329], 256], + 12199: [[38263], 256], + 12200: [[38272], 256], + 12201: [[38428], 256], + 12202: [[38582], 256], + 12203: [[38585], 256], + 12204: [[38632], 256], + 12205: [[38737], 256], + 12206: [[38750], 256], + 12207: [[38754], 256], + 12208: [[38761], 256], + 12209: [[38859], 256], + 12210: [[38893], 256], + 12211: [[38899], 256], + 12212: [[38913], 256], + 12213: [[39080], 256], + 12214: [[39131], 256], + 12215: [[39135], 256], + 12216: [[39318], 256], + 12217: [[39321], 256], + 12218: [[39340], 256], + 12219: [[39592], 256], + 12220: [[39640], 256], + 12221: [[39647], 256], + 12222: [[39717], 256], + 12223: [[39727], 256], + 12224: [[39730], 256], + 12225: [[39740], 256], + 12226: [[39770], 256], + 12227: [[40165], 256], + 12228: [[40565], 256], + 12229: [[40575], 256], + 12230: [[40613], 256], + 12231: [[40635], 256], + 12232: [[40643], 256], + 12233: [[40653], 256], + 12234: [[40657], 256], + 12235: [[40697], 256], + 12236: [[40701], 256], + 12237: [[40718], 256], + 12238: [[40723], 256], + 12239: [[40736], 256], + 12240: [[40763], 256], + 12241: [[40778], 256], + 12242: [[40786], 256], + 12243: [[40845], 256], + 12244: [[40860], 256], + 12245: [[40864], 256] + }, + 12288: { + 12288: [[32], 256], + 12330: [, 218], + 12331: [, 228], + 12332: [, 232], + 12333: [, 222], + 12334: [, 224], + 12335: [, 224], + 12342: [[12306], 256], + 12344: [[21313], 256], + 12345: [[21316], 256], + 12346: [[21317], 256], + 12358: [, , { 12441: 12436 }], + 12363: [, , { 12441: 12364 }], + 12364: [[12363, 12441]], + 12365: [, , { 12441: 12366 }], + 12366: [[12365, 12441]], + 12367: [, , { 12441: 12368 }], + 12368: [[12367, 12441]], + 12369: [, , { 12441: 12370 }], + 12370: [[12369, 12441]], + 12371: [, , { 12441: 12372 }], + 12372: [[12371, 12441]], + 12373: [, , { 12441: 12374 }], + 12374: [[12373, 12441]], + 12375: [, , { 12441: 12376 }], + 12376: [[12375, 12441]], + 12377: [, , { 12441: 12378 }], + 12378: [[12377, 12441]], + 12379: [, , { 12441: 12380 }], + 12380: [[12379, 12441]], + 12381: [, , { 12441: 12382 }], + 12382: [[12381, 12441]], + 12383: [, , { 12441: 12384 }], + 12384: [[12383, 12441]], + 12385: [, , { 12441: 12386 }], + 12386: [[12385, 12441]], + 12388: [, , { 12441: 12389 }], + 12389: [[12388, 12441]], + 12390: [, , { 12441: 12391 }], + 12391: [[12390, 12441]], + 12392: [, , { 12441: 12393 }], + 12393: [[12392, 12441]], + 12399: [, , { 12441: 12400, 12442: 12401 }], + 12400: [[12399, 12441]], + 12401: [[12399, 12442]], + 12402: [, , { 12441: 12403, 12442: 12404 }], + 12403: [[12402, 12441]], + 12404: [[12402, 12442]], + 12405: [, , { 12441: 12406, 12442: 12407 }], + 12406: [[12405, 12441]], + 12407: [[12405, 12442]], + 12408: [, , { 12441: 12409, 12442: 12410 }], + 12409: [[12408, 12441]], + 12410: [[12408, 12442]], + 12411: [, , { 12441: 12412, 12442: 12413 }], + 12412: [[12411, 12441]], + 12413: [[12411, 12442]], + 12436: [[12358, 12441]], + 12441: [, 8], + 12442: [, 8], + 12443: [[32, 12441], 256], + 12444: [[32, 12442], 256], + 12445: [, , { 12441: 12446 }], + 12446: [[12445, 12441]], + 12447: [[12424, 12426], 256], + 12454: [, , { 12441: 12532 }], + 12459: [, , { 12441: 12460 }], + 12460: [[12459, 12441]], + 12461: [, , { 12441: 12462 }], + 12462: [[12461, 12441]], + 12463: [, , { 12441: 12464 }], + 12464: [[12463, 12441]], + 12465: [, , { 12441: 12466 }], + 12466: [[12465, 12441]], + 12467: [, , { 12441: 12468 }], + 12468: [[12467, 12441]], + 12469: [, , { 12441: 12470 }], + 12470: [[12469, 12441]], + 12471: [, , { 12441: 12472 }], + 12472: [[12471, 12441]], + 12473: [, , { 12441: 12474 }], + 12474: [[12473, 12441]], + 12475: [, , { 12441: 12476 }], + 12476: [[12475, 12441]], + 12477: [, , { 12441: 12478 }], + 12478: [[12477, 12441]], + 12479: [, , { 12441: 12480 }], + 12480: [[12479, 12441]], + 12481: [, , { 12441: 12482 }], + 12482: [[12481, 12441]], + 12484: [, , { 12441: 12485 }], + 12485: [[12484, 12441]], + 12486: [, , { 12441: 12487 }], + 12487: [[12486, 12441]], + 12488: [, , { 12441: 12489 }], + 12489: [[12488, 12441]], + 12495: [, , { 12441: 12496, 12442: 12497 }], + 12496: [[12495, 12441]], + 12497: [[12495, 12442]], + 12498: [, , { 12441: 12499, 12442: 12500 }], + 12499: [[12498, 12441]], + 12500: [[12498, 12442]], + 12501: [, , { 12441: 12502, 12442: 12503 }], + 12502: [[12501, 12441]], + 12503: [[12501, 12442]], + 12504: [, , { 12441: 12505, 12442: 12506 }], + 12505: [[12504, 12441]], + 12506: [[12504, 12442]], + 12507: [, , { 12441: 12508, 12442: 12509 }], + 12508: [[12507, 12441]], + 12509: [[12507, 12442]], + 12527: [, , { 12441: 12535 }], + 12528: [, , { 12441: 12536 }], + 12529: [, , { 12441: 12537 }], + 12530: [, , { 12441: 12538 }], + 12532: [[12454, 12441]], + 12535: [[12527, 12441]], + 12536: [[12528, 12441]], + 12537: [[12529, 12441]], + 12538: [[12530, 12441]], + 12541: [, , { 12441: 12542 }], + 12542: [[12541, 12441]], + 12543: [[12467, 12488], 256] + }, + 12544: { + 12593: [[4352], 256], + 12594: [[4353], 256], + 12595: [[4522], 256], + 12596: [[4354], 256], + 12597: [[4524], 256], + 12598: [[4525], 256], + 12599: [[4355], 256], + 12600: [[4356], 256], + 12601: [[4357], 256], + 12602: [[4528], 256], + 12603: [[4529], 256], + 12604: [[4530], 256], + 12605: [[4531], 256], + 12606: [[4532], 256], + 12607: [[4533], 256], + 12608: [[4378], 256], + 12609: [[4358], 256], + 12610: [[4359], 256], + 12611: [[4360], 256], + 12612: [[4385], 256], + 12613: [[4361], 256], + 12614: [[4362], 256], + 12615: [[4363], 256], + 12616: [[4364], 256], + 12617: [[4365], 256], + 12618: [[4366], 256], + 12619: [[4367], 256], + 12620: [[4368], 256], + 12621: [[4369], 256], + 12622: [[4370], 256], + 12623: [[4449], 256], + 12624: [[4450], 256], + 12625: [[4451], 256], + 12626: [[4452], 256], + 12627: [[4453], 256], + 12628: [[4454], 256], + 12629: [[4455], 256], + 12630: [[4456], 256], + 12631: [[4457], 256], + 12632: [[4458], 256], + 12633: [[4459], 256], + 12634: [[4460], 256], + 12635: [[4461], 256], + 12636: [[4462], 256], + 12637: [[4463], 256], + 12638: [[4464], 256], + 12639: [[4465], 256], + 12640: [[4466], 256], + 12641: [[4467], 256], + 12642: [[4468], 256], + 12643: [[4469], 256], + 12644: [[4448], 256], + 12645: [[4372], 256], + 12646: [[4373], 256], + 12647: [[4551], 256], + 12648: [[4552], 256], + 12649: [[4556], 256], + 12650: [[4558], 256], + 12651: [[4563], 256], + 12652: [[4567], 256], + 12653: [[4569], 256], + 12654: [[4380], 256], + 12655: [[4573], 256], + 12656: [[4575], 256], + 12657: [[4381], 256], + 12658: [[4382], 256], + 12659: [[4384], 256], + 12660: [[4386], 256], + 12661: [[4387], 256], + 12662: [[4391], 256], + 12663: [[4393], 256], + 12664: [[4395], 256], + 12665: [[4396], 256], + 12666: [[4397], 256], + 12667: [[4398], 256], + 12668: [[4399], 256], + 12669: [[4402], 256], + 12670: [[4406], 256], + 12671: [[4416], 256], + 12672: [[4423], 256], + 12673: [[4428], 256], + 12674: [[4593], 256], + 12675: [[4594], 256], + 12676: [[4439], 256], + 12677: [[4440], 256], + 12678: [[4441], 256], + 12679: [[4484], 256], + 12680: [[4485], 256], + 12681: [[4488], 256], + 12682: [[4497], 256], + 12683: [[4498], 256], + 12684: [[4500], 256], + 12685: [[4510], 256], + 12686: [[4513], 256], + 12690: [[19968], 256], + 12691: [[20108], 256], + 12692: [[19977], 256], + 12693: [[22235], 256], + 12694: [[19978], 256], + 12695: [[20013], 256], + 12696: [[19979], 256], + 12697: [[30002], 256], + 12698: [[20057], 256], + 12699: [[19993], 256], + 12700: [[19969], 256], + 12701: [[22825], 256], + 12702: [[22320], 256], + 12703: [[20154], 256] + }, + 12800: { + 12800: [[40, 4352, 41], 256], + 12801: [[40, 4354, 41], 256], + 12802: [[40, 4355, 41], 256], + 12803: [[40, 4357, 41], 256], + 12804: [[40, 4358, 41], 256], + 12805: [[40, 4359, 41], 256], + 12806: [[40, 4361, 41], 256], + 12807: [[40, 4363, 41], 256], + 12808: [[40, 4364, 41], 256], + 12809: [[40, 4366, 41], 256], + 12810: [[40, 4367, 41], 256], + 12811: [[40, 4368, 41], 256], + 12812: [[40, 4369, 41], 256], + 12813: [[40, 4370, 41], 256], + 12814: [[40, 4352, 4449, 41], 256], + 12815: [[40, 4354, 4449, 41], 256], + 12816: [[40, 4355, 4449, 41], 256], + 12817: [[40, 4357, 4449, 41], 256], + 12818: [[40, 4358, 4449, 41], 256], + 12819: [[40, 4359, 4449, 41], 256], + 12820: [[40, 4361, 4449, 41], 256], + 12821: [[40, 4363, 4449, 41], 256], + 12822: [[40, 4364, 4449, 41], 256], + 12823: [[40, 4366, 4449, 41], 256], + 12824: [[40, 4367, 4449, 41], 256], + 12825: [[40, 4368, 4449, 41], 256], + 12826: [[40, 4369, 4449, 41], 256], + 12827: [[40, 4370, 4449, 41], 256], + 12828: [[40, 4364, 4462, 41], 256], + 12829: [[40, 4363, 4457, 4364, 4453, 4523, 41], 256], + 12830: [[40, 4363, 4457, 4370, 4462, 41], 256], + 12832: [[40, 19968, 41], 256], + 12833: [[40, 20108, 41], 256], + 12834: [[40, 19977, 41], 256], + 12835: [[40, 22235, 41], 256], + 12836: [[40, 20116, 41], 256], + 12837: [[40, 20845, 41], 256], + 12838: [[40, 19971, 41], 256], + 12839: [[40, 20843, 41], 256], + 12840: [[40, 20061, 41], 256], + 12841: [[40, 21313, 41], 256], + 12842: [[40, 26376, 41], 256], + 12843: [[40, 28779, 41], 256], + 12844: [[40, 27700, 41], 256], + 12845: [[40, 26408, 41], 256], + 12846: [[40, 37329, 41], 256], + 12847: [[40, 22303, 41], 256], + 12848: [[40, 26085, 41], 256], + 12849: [[40, 26666, 41], 256], + 12850: [[40, 26377, 41], 256], + 12851: [[40, 31038, 41], 256], + 12852: [[40, 21517, 41], 256], + 12853: [[40, 29305, 41], 256], + 12854: [[40, 36001, 41], 256], + 12855: [[40, 31069, 41], 256], + 12856: [[40, 21172, 41], 256], + 12857: [[40, 20195, 41], 256], + 12858: [[40, 21628, 41], 256], + 12859: [[40, 23398, 41], 256], + 12860: [[40, 30435, 41], 256], + 12861: [[40, 20225, 41], 256], + 12862: [[40, 36039, 41], 256], + 12863: [[40, 21332, 41], 256], + 12864: [[40, 31085, 41], 256], + 12865: [[40, 20241, 41], 256], + 12866: [[40, 33258, 41], 256], + 12867: [[40, 33267, 41], 256], + 12868: [[21839], 256], + 12869: [[24188], 256], + 12870: [[25991], 256], + 12871: [[31631], 256], + 12880: [[80, 84, 69], 256], + 12881: [[50, 49], 256], + 12882: [[50, 50], 256], + 12883: [[50, 51], 256], + 12884: [[50, 52], 256], + 12885: [[50, 53], 256], + 12886: [[50, 54], 256], + 12887: [[50, 55], 256], + 12888: [[50, 56], 256], + 12889: [[50, 57], 256], + 12890: [[51, 48], 256], + 12891: [[51, 49], 256], + 12892: [[51, 50], 256], + 12893: [[51, 51], 256], + 12894: [[51, 52], 256], + 12895: [[51, 53], 256], + 12896: [[4352], 256], + 12897: [[4354], 256], + 12898: [[4355], 256], + 12899: [[4357], 256], + 12900: [[4358], 256], + 12901: [[4359], 256], + 12902: [[4361], 256], + 12903: [[4363], 256], + 12904: [[4364], 256], + 12905: [[4366], 256], + 12906: [[4367], 256], + 12907: [[4368], 256], + 12908: [[4369], 256], + 12909: [[4370], 256], + 12910: [[4352, 4449], 256], + 12911: [[4354, 4449], 256], + 12912: [[4355, 4449], 256], + 12913: [[4357, 4449], 256], + 12914: [[4358, 4449], 256], + 12915: [[4359, 4449], 256], + 12916: [[4361, 4449], 256], + 12917: [[4363, 4449], 256], + 12918: [[4364, 4449], 256], + 12919: [[4366, 4449], 256], + 12920: [[4367, 4449], 256], + 12921: [[4368, 4449], 256], + 12922: [[4369, 4449], 256], + 12923: [[4370, 4449], 256], + 12924: [[4366, 4449, 4535, 4352, 4457], 256], + 12925: [[4364, 4462, 4363, 4468], 256], + 12926: [[4363, 4462], 256], + 12928: [[19968], 256], + 12929: [[20108], 256], + 12930: [[19977], 256], + 12931: [[22235], 256], + 12932: [[20116], 256], + 12933: [[20845], 256], + 12934: [[19971], 256], + 12935: [[20843], 256], + 12936: [[20061], 256], + 12937: [[21313], 256], + 12938: [[26376], 256], + 12939: [[28779], 256], + 12940: [[27700], 256], + 12941: [[26408], 256], + 12942: [[37329], 256], + 12943: [[22303], 256], + 12944: [[26085], 256], + 12945: [[26666], 256], + 12946: [[26377], 256], + 12947: [[31038], 256], + 12948: [[21517], 256], + 12949: [[29305], 256], + 12950: [[36001], 256], + 12951: [[31069], 256], + 12952: [[21172], 256], + 12953: [[31192], 256], + 12954: [[30007], 256], + 12955: [[22899], 256], + 12956: [[36969], 256], + 12957: [[20778], 256], + 12958: [[21360], 256], + 12959: [[27880], 256], + 12960: [[38917], 256], + 12961: [[20241], 256], + 12962: [[20889], 256], + 12963: [[27491], 256], + 12964: [[19978], 256], + 12965: [[20013], 256], + 12966: [[19979], 256], + 12967: [[24038], 256], + 12968: [[21491], 256], + 12969: [[21307], 256], + 12970: [[23447], 256], + 12971: [[23398], 256], + 12972: [[30435], 256], + 12973: [[20225], 256], + 12974: [[36039], 256], + 12975: [[21332], 256], + 12976: [[22812], 256], + 12977: [[51, 54], 256], + 12978: [[51, 55], 256], + 12979: [[51, 56], 256], + 12980: [[51, 57], 256], + 12981: [[52, 48], 256], + 12982: [[52, 49], 256], + 12983: [[52, 50], 256], + 12984: [[52, 51], 256], + 12985: [[52, 52], 256], + 12986: [[52, 53], 256], + 12987: [[52, 54], 256], + 12988: [[52, 55], 256], + 12989: [[52, 56], 256], + 12990: [[52, 57], 256], + 12991: [[53, 48], 256], + 12992: [[49, 26376], 256], + 12993: [[50, 26376], 256], + 12994: [[51, 26376], 256], + 12995: [[52, 26376], 256], + 12996: [[53, 26376], 256], + 12997: [[54, 26376], 256], + 12998: [[55, 26376], 256], + 12999: [[56, 26376], 256], + 13000: [[57, 26376], 256], + 13001: [[49, 48, 26376], 256], + 13002: [[49, 49, 26376], 256], + 13003: [[49, 50, 26376], 256], + 13004: [[72, 103], 256], + 13005: [[101, 114, 103], 256], + 13006: [[101, 86], 256], + 13007: [[76, 84, 68], 256], + 13008: [[12450], 256], + 13009: [[12452], 256], + 13010: [[12454], 256], + 13011: [[12456], 256], + 13012: [[12458], 256], + 13013: [[12459], 256], + 13014: [[12461], 256], + 13015: [[12463], 256], + 13016: [[12465], 256], + 13017: [[12467], 256], + 13018: [[12469], 256], + 13019: [[12471], 256], + 13020: [[12473], 256], + 13021: [[12475], 256], + 13022: [[12477], 256], + 13023: [[12479], 256], + 13024: [[12481], 256], + 13025: [[12484], 256], + 13026: [[12486], 256], + 13027: [[12488], 256], + 13028: [[12490], 256], + 13029: [[12491], 256], + 13030: [[12492], 256], + 13031: [[12493], 256], + 13032: [[12494], 256], + 13033: [[12495], 256], + 13034: [[12498], 256], + 13035: [[12501], 256], + 13036: [[12504], 256], + 13037: [[12507], 256], + 13038: [[12510], 256], + 13039: [[12511], 256], + 13040: [[12512], 256], + 13041: [[12513], 256], + 13042: [[12514], 256], + 13043: [[12516], 256], + 13044: [[12518], 256], + 13045: [[12520], 256], + 13046: [[12521], 256], + 13047: [[12522], 256], + 13048: [[12523], 256], + 13049: [[12524], 256], + 13050: [[12525], 256], + 13051: [[12527], 256], + 13052: [[12528], 256], + 13053: [[12529], 256], + 13054: [[12530], 256] + }, + 13056: { + 13056: [[12450, 12497, 12540, 12488], 256], + 13057: [[12450, 12523, 12501, 12449], 256], + 13058: [[12450, 12531, 12506, 12450], 256], + 13059: [[12450, 12540, 12523], 256], + 13060: [[12452, 12491, 12531, 12464], 256], + 13061: [[12452, 12531, 12481], 256], + 13062: [[12454, 12457, 12531], 256], + 13063: [[12456, 12473, 12463, 12540, 12489], 256], + 13064: [[12456, 12540, 12459, 12540], 256], + 13065: [[12458, 12531, 12473], 256], + 13066: [[12458, 12540, 12512], 256], + 13067: [[12459, 12452, 12522], 256], + 13068: [[12459, 12521, 12483, 12488], 256], + 13069: [[12459, 12525, 12522, 12540], 256], + 13070: [[12460, 12525, 12531], 256], + 13071: [[12460, 12531, 12510], 256], + 13072: [[12462, 12460], 256], + 13073: [[12462, 12491, 12540], 256], + 13074: [[12461, 12517, 12522, 12540], 256], + 13075: [[12462, 12523, 12480, 12540], 256], + 13076: [[12461, 12525], 256], + 13077: [[12461, 12525, 12464, 12521, 12512], 256], + 13078: [[12461, 12525, 12513, 12540, 12488, 12523], 256], + 13079: [[12461, 12525, 12527, 12483, 12488], 256], + 13080: [[12464, 12521, 12512], 256], + 13081: [[12464, 12521, 12512, 12488, 12531], 256], + 13082: [[12463, 12523, 12476, 12452, 12525], 256], + 13083: [[12463, 12525, 12540, 12493], 256], + 13084: [[12465, 12540, 12473], 256], + 13085: [[12467, 12523, 12490], 256], + 13086: [[12467, 12540, 12509], 256], + 13087: [[12469, 12452, 12463, 12523], 256], + 13088: [[12469, 12531, 12481, 12540, 12512], 256], + 13089: [[12471, 12522, 12531, 12464], 256], + 13090: [[12475, 12531, 12481], 256], + 13091: [[12475, 12531, 12488], 256], + 13092: [[12480, 12540, 12473], 256], + 13093: [[12487, 12471], 256], + 13094: [[12489, 12523], 256], + 13095: [[12488, 12531], 256], + 13096: [[12490, 12494], 256], + 13097: [[12494, 12483, 12488], 256], + 13098: [[12495, 12452, 12484], 256], + 13099: [[12497, 12540, 12475, 12531, 12488], 256], + 13100: [[12497, 12540, 12484], 256], + 13101: [[12496, 12540, 12524, 12523], 256], + 13102: [[12500, 12450, 12473, 12488, 12523], 256], + 13103: [[12500, 12463, 12523], 256], + 13104: [[12500, 12467], 256], + 13105: [[12499, 12523], 256], + 13106: [[12501, 12449, 12521, 12483, 12489], 256], + 13107: [[12501, 12451, 12540, 12488], 256], + 13108: [[12502, 12483, 12471, 12455, 12523], 256], + 13109: [[12501, 12521, 12531], 256], + 13110: [[12504, 12463, 12479, 12540, 12523], 256], + 13111: [[12506, 12477], 256], + 13112: [[12506, 12491, 12498], 256], + 13113: [[12504, 12523, 12484], 256], + 13114: [[12506, 12531, 12473], 256], + 13115: [[12506, 12540, 12472], 256], + 13116: [[12505, 12540, 12479], 256], + 13117: [[12509, 12452, 12531, 12488], 256], + 13118: [[12508, 12523, 12488], 256], + 13119: [[12507, 12531], 256], + 13120: [[12509, 12531, 12489], 256], + 13121: [[12507, 12540, 12523], 256], + 13122: [[12507, 12540, 12531], 256], + 13123: [[12510, 12452, 12463, 12525], 256], + 13124: [[12510, 12452, 12523], 256], + 13125: [[12510, 12483, 12495], 256], + 13126: [[12510, 12523, 12463], 256], + 13127: [[12510, 12531, 12471, 12519, 12531], 256], + 13128: [[12511, 12463, 12525, 12531], 256], + 13129: [[12511, 12522], 256], + 13130: [[12511, 12522, 12496, 12540, 12523], 256], + 13131: [[12513, 12460], 256], + 13132: [[12513, 12460, 12488, 12531], 256], + 13133: [[12513, 12540, 12488, 12523], 256], + 13134: [[12516, 12540, 12489], 256], + 13135: [[12516, 12540, 12523], 256], + 13136: [[12518, 12450, 12531], 256], + 13137: [[12522, 12483, 12488, 12523], 256], + 13138: [[12522, 12521], 256], + 13139: [[12523, 12500, 12540], 256], + 13140: [[12523, 12540, 12502, 12523], 256], + 13141: [[12524, 12512], 256], + 13142: [[12524, 12531, 12488, 12466, 12531], 256], + 13143: [[12527, 12483, 12488], 256], + 13144: [[48, 28857], 256], + 13145: [[49, 28857], 256], + 13146: [[50, 28857], 256], + 13147: [[51, 28857], 256], + 13148: [[52, 28857], 256], + 13149: [[53, 28857], 256], + 13150: [[54, 28857], 256], + 13151: [[55, 28857], 256], + 13152: [[56, 28857], 256], + 13153: [[57, 28857], 256], + 13154: [[49, 48, 28857], 256], + 13155: [[49, 49, 28857], 256], + 13156: [[49, 50, 28857], 256], + 13157: [[49, 51, 28857], 256], + 13158: [[49, 52, 28857], 256], + 13159: [[49, 53, 28857], 256], + 13160: [[49, 54, 28857], 256], + 13161: [[49, 55, 28857], 256], + 13162: [[49, 56, 28857], 256], + 13163: [[49, 57, 28857], 256], + 13164: [[50, 48, 28857], 256], + 13165: [[50, 49, 28857], 256], + 13166: [[50, 50, 28857], 256], + 13167: [[50, 51, 28857], 256], + 13168: [[50, 52, 28857], 256], + 13169: [[104, 80, 97], 256], + 13170: [[100, 97], 256], + 13171: [[65, 85], 256], + 13172: [[98, 97, 114], 256], + 13173: [[111, 86], 256], + 13174: [[112, 99], 256], + 13175: [[100, 109], 256], + 13176: [[100, 109, 178], 256], + 13177: [[100, 109, 179], 256], + 13178: [[73, 85], 256], + 13179: [[24179, 25104], 256], + 13180: [[26157, 21644], 256], + 13181: [[22823, 27491], 256], + 13182: [[26126, 27835], 256], + 13183: [[26666, 24335, 20250, 31038], 256], + 13184: [[112, 65], 256], + 13185: [[110, 65], 256], + 13186: [[956, 65], 256], + 13187: [[109, 65], 256], + 13188: [[107, 65], 256], + 13189: [[75, 66], 256], + 13190: [[77, 66], 256], + 13191: [[71, 66], 256], + 13192: [[99, 97, 108], 256], + 13193: [[107, 99, 97, 108], 256], + 13194: [[112, 70], 256], + 13195: [[110, 70], 256], + 13196: [[956, 70], 256], + 13197: [[956, 103], 256], + 13198: [[109, 103], 256], + 13199: [[107, 103], 256], + 13200: [[72, 122], 256], + 13201: [[107, 72, 122], 256], + 13202: [[77, 72, 122], 256], + 13203: [[71, 72, 122], 256], + 13204: [[84, 72, 122], 256], + 13205: [[956, 8467], 256], + 13206: [[109, 8467], 256], + 13207: [[100, 8467], 256], + 13208: [[107, 8467], 256], + 13209: [[102, 109], 256], + 13210: [[110, 109], 256], + 13211: [[956, 109], 256], + 13212: [[109, 109], 256], + 13213: [[99, 109], 256], + 13214: [[107, 109], 256], + 13215: [[109, 109, 178], 256], + 13216: [[99, 109, 178], 256], + 13217: [[109, 178], 256], + 13218: [[107, 109, 178], 256], + 13219: [[109, 109, 179], 256], + 13220: [[99, 109, 179], 256], + 13221: [[109, 179], 256], + 13222: [[107, 109, 179], 256], + 13223: [[109, 8725, 115], 256], + 13224: [[109, 8725, 115, 178], 256], + 13225: [[80, 97], 256], + 13226: [[107, 80, 97], 256], + 13227: [[77, 80, 97], 256], + 13228: [[71, 80, 97], 256], + 13229: [[114, 97, 100], 256], + 13230: [[114, 97, 100, 8725, 115], 256], + 13231: [[114, 97, 100, 8725, 115, 178], 256], + 13232: [[112, 115], 256], + 13233: [[110, 115], 256], + 13234: [[956, 115], 256], + 13235: [[109, 115], 256], + 13236: [[112, 86], 256], + 13237: [[110, 86], 256], + 13238: [[956, 86], 256], + 13239: [[109, 86], 256], + 13240: [[107, 86], 256], + 13241: [[77, 86], 256], + 13242: [[112, 87], 256], + 13243: [[110, 87], 256], + 13244: [[956, 87], 256], + 13245: [[109, 87], 256], + 13246: [[107, 87], 256], + 13247: [[77, 87], 256], + 13248: [[107, 937], 256], + 13249: [[77, 937], 256], + 13250: [[97, 46, 109, 46], 256], + 13251: [[66, 113], 256], + 13252: [[99, 99], 256], + 13253: [[99, 100], 256], + 13254: [[67, 8725, 107, 103], 256], + 13255: [[67, 111, 46], 256], + 13256: [[100, 66], 256], + 13257: [[71, 121], 256], + 13258: [[104, 97], 256], + 13259: [[72, 80], 256], + 13260: [[105, 110], 256], + 13261: [[75, 75], 256], + 13262: [[75, 77], 256], + 13263: [[107, 116], 256], + 13264: [[108, 109], 256], + 13265: [[108, 110], 256], + 13266: [[108, 111, 103], 256], + 13267: [[108, 120], 256], + 13268: [[109, 98], 256], + 13269: [[109, 105, 108], 256], + 13270: [[109, 111, 108], 256], + 13271: [[80, 72], 256], + 13272: [[112, 46, 109, 46], 256], + 13273: [[80, 80, 77], 256], + 13274: [[80, 82], 256], + 13275: [[115, 114], 256], + 13276: [[83, 118], 256], + 13277: [[87, 98], 256], + 13278: [[86, 8725, 109], 256], + 13279: [[65, 8725, 109], 256], + 13280: [[49, 26085], 256], + 13281: [[50, 26085], 256], + 13282: [[51, 26085], 256], + 13283: [[52, 26085], 256], + 13284: [[53, 26085], 256], + 13285: [[54, 26085], 256], + 13286: [[55, 26085], 256], + 13287: [[56, 26085], 256], + 13288: [[57, 26085], 256], + 13289: [[49, 48, 26085], 256], + 13290: [[49, 49, 26085], 256], + 13291: [[49, 50, 26085], 256], + 13292: [[49, 51, 26085], 256], + 13293: [[49, 52, 26085], 256], + 13294: [[49, 53, 26085], 256], + 13295: [[49, 54, 26085], 256], + 13296: [[49, 55, 26085], 256], + 13297: [[49, 56, 26085], 256], + 13298: [[49, 57, 26085], 256], + 13299: [[50, 48, 26085], 256], + 13300: [[50, 49, 26085], 256], + 13301: [[50, 50, 26085], 256], + 13302: [[50, 51, 26085], 256], + 13303: [[50, 52, 26085], 256], + 13304: [[50, 53, 26085], 256], + 13305: [[50, 54, 26085], 256], + 13306: [[50, 55, 26085], 256], + 13307: [[50, 56, 26085], 256], + 13308: [[50, 57, 26085], 256], + 13309: [[51, 48, 26085], 256], + 13310: [[51, 49, 26085], 256], + 13311: [[103, 97, 108], 256] + }, + 42496: { + 42607: [, 230], + 42612: [, 230], + 42613: [, 230], + 42614: [, 230], + 42615: [, 230], + 42616: [, 230], + 42617: [, 230], + 42618: [, 230], + 42619: [, 230], + 42620: [, 230], + 42621: [, 230], + 42655: [, 230], + 42736: [, 230], + 42737: [, 230] + }, + 42752: { 42864: [[42863], 256], 43000: [[294], 256], 43001: [[339], 256] }, + 43008: { + 43014: [, 9], + 43204: [, 9], + 43232: [, 230], + 43233: [, 230], + 43234: [, 230], + 43235: [, 230], + 43236: [, 230], + 43237: [, 230], + 43238: [, 230], + 43239: [, 230], + 43240: [, 230], + 43241: [, 230], + 43242: [, 230], + 43243: [, 230], + 43244: [, 230], + 43245: [, 230], + 43246: [, 230], + 43247: [, 230], + 43248: [, 230], + 43249: [, 230] + }, + 43264: { + 43307: [, 220], + 43308: [, 220], + 43309: [, 220], + 43347: [, 9], + 43443: [, 7], + 43456: [, 9] + }, + 43520: { + 43696: [, 230], + 43698: [, 230], + 43699: [, 230], + 43700: [, 220], + 43703: [, 230], + 43704: [, 230], + 43710: [, 230], + 43711: [, 230], + 43713: [, 230], + 43766: [, 9] + }, + 43776: { 44013: [, 9] }, + 53504: { + 119134: [[119127, 119141], 512], + 119135: [[119128, 119141], 512], + 119136: [[119135, 119150], 512], + 119137: [[119135, 119151], 512], + 119138: [[119135, 119152], 512], + 119139: [[119135, 119153], 512], + 119140: [[119135, 119154], 512], + 119141: [, 216], + 119142: [, 216], + 119143: [, 1], + 119144: [, 1], + 119145: [, 1], + 119149: [, 226], + 119150: [, 216], + 119151: [, 216], + 119152: [, 216], + 119153: [, 216], + 119154: [, 216], + 119163: [, 220], + 119164: [, 220], + 119165: [, 220], + 119166: [, 220], + 119167: [, 220], + 119168: [, 220], + 119169: [, 220], + 119170: [, 220], + 119173: [, 230], + 119174: [, 230], + 119175: [, 230], + 119176: [, 230], + 119177: [, 230], + 119178: [, 220], + 119179: [, 220], + 119210: [, 230], + 119211: [, 230], + 119212: [, 230], + 119213: [, 230], + 119227: [[119225, 119141], 512], + 119228: [[119226, 119141], 512], + 119229: [[119227, 119150], 512], + 119230: [[119228, 119150], 512], + 119231: [[119227, 119151], 512], + 119232: [[119228, 119151], 512] + }, + 53760: { 119362: [, 230], 119363: [, 230], 119364: [, 230] }, + 54272: { + 119808: [[65], 256], + 119809: [[66], 256], + 119810: [[67], 256], + 119811: [[68], 256], + 119812: [[69], 256], + 119813: [[70], 256], + 119814: [[71], 256], + 119815: [[72], 256], + 119816: [[73], 256], + 119817: [[74], 256], + 119818: [[75], 256], + 119819: [[76], 256], + 119820: [[77], 256], + 119821: [[78], 256], + 119822: [[79], 256], + 119823: [[80], 256], + 119824: [[81], 256], + 119825: [[82], 256], + 119826: [[83], 256], + 119827: [[84], 256], + 119828: [[85], 256], + 119829: [[86], 256], + 119830: [[87], 256], + 119831: [[88], 256], + 119832: [[89], 256], + 119833: [[90], 256], + 119834: [[97], 256], + 119835: [[98], 256], + 119836: [[99], 256], + 119837: [[100], 256], + 119838: [[101], 256], + 119839: [[102], 256], + 119840: [[103], 256], + 119841: [[104], 256], + 119842: [[105], 256], + 119843: [[106], 256], + 119844: [[107], 256], + 119845: [[108], 256], + 119846: [[109], 256], + 119847: [[110], 256], + 119848: [[111], 256], + 119849: [[112], 256], + 119850: [[113], 256], + 119851: [[114], 256], + 119852: [[115], 256], + 119853: [[116], 256], + 119854: [[117], 256], + 119855: [[118], 256], + 119856: [[119], 256], + 119857: [[120], 256], + 119858: [[121], 256], + 119859: [[122], 256], + 119860: [[65], 256], + 119861: [[66], 256], + 119862: [[67], 256], + 119863: [[68], 256], + 119864: [[69], 256], + 119865: [[70], 256], + 119866: [[71], 256], + 119867: [[72], 256], + 119868: [[73], 256], + 119869: [[74], 256], + 119870: [[75], 256], + 119871: [[76], 256], + 119872: [[77], 256], + 119873: [[78], 256], + 119874: [[79], 256], + 119875: [[80], 256], + 119876: [[81], 256], + 119877: [[82], 256], + 119878: [[83], 256], + 119879: [[84], 256], + 119880: [[85], 256], + 119881: [[86], 256], + 119882: [[87], 256], + 119883: [[88], 256], + 119884: [[89], 256], + 119885: [[90], 256], + 119886: [[97], 256], + 119887: [[98], 256], + 119888: [[99], 256], + 119889: [[100], 256], + 119890: [[101], 256], + 119891: [[102], 256], + 119892: [[103], 256], + 119894: [[105], 256], + 119895: [[106], 256], + 119896: [[107], 256], + 119897: [[108], 256], + 119898: [[109], 256], + 119899: [[110], 256], + 119900: [[111], 256], + 119901: [[112], 256], + 119902: [[113], 256], + 119903: [[114], 256], + 119904: [[115], 256], + 119905: [[116], 256], + 119906: [[117], 256], + 119907: [[118], 256], + 119908: [[119], 256], + 119909: [[120], 256], + 119910: [[121], 256], + 119911: [[122], 256], + 119912: [[65], 256], + 119913: [[66], 256], + 119914: [[67], 256], + 119915: [[68], 256], + 119916: [[69], 256], + 119917: [[70], 256], + 119918: [[71], 256], + 119919: [[72], 256], + 119920: [[73], 256], + 119921: [[74], 256], + 119922: [[75], 256], + 119923: [[76], 256], + 119924: [[77], 256], + 119925: [[78], 256], + 119926: [[79], 256], + 119927: [[80], 256], + 119928: [[81], 256], + 119929: [[82], 256], + 119930: [[83], 256], + 119931: [[84], 256], + 119932: [[85], 256], + 119933: [[86], 256], + 119934: [[87], 256], + 119935: [[88], 256], + 119936: [[89], 256], + 119937: [[90], 256], + 119938: [[97], 256], + 119939: [[98], 256], + 119940: [[99], 256], + 119941: [[100], 256], + 119942: [[101], 256], + 119943: [[102], 256], + 119944: [[103], 256], + 119945: [[104], 256], + 119946: [[105], 256], + 119947: [[106], 256], + 119948: [[107], 256], + 119949: [[108], 256], + 119950: [[109], 256], + 119951: [[110], 256], + 119952: [[111], 256], + 119953: [[112], 256], + 119954: [[113], 256], + 119955: [[114], 256], + 119956: [[115], 256], + 119957: [[116], 256], + 119958: [[117], 256], + 119959: [[118], 256], + 119960: [[119], 256], + 119961: [[120], 256], + 119962: [[121], 256], + 119963: [[122], 256], + 119964: [[65], 256], + 119966: [[67], 256], + 119967: [[68], 256], + 119970: [[71], 256], + 119973: [[74], 256], + 119974: [[75], 256], + 119977: [[78], 256], + 119978: [[79], 256], + 119979: [[80], 256], + 119980: [[81], 256], + 119982: [[83], 256], + 119983: [[84], 256], + 119984: [[85], 256], + 119985: [[86], 256], + 119986: [[87], 256], + 119987: [[88], 256], + 119988: [[89], 256], + 119989: [[90], 256], + 119990: [[97], 256], + 119991: [[98], 256], + 119992: [[99], 256], + 119993: [[100], 256], + 119995: [[102], 256], + 119997: [[104], 256], + 119998: [[105], 256], + 119999: [[106], 256], + 120000: [[107], 256], + 120001: [[108], 256], + 120002: [[109], 256], + 120003: [[110], 256], + 120005: [[112], 256], + 120006: [[113], 256], + 120007: [[114], 256], + 120008: [[115], 256], + 120009: [[116], 256], + 120010: [[117], 256], + 120011: [[118], 256], + 120012: [[119], 256], + 120013: [[120], 256], + 120014: [[121], 256], + 120015: [[122], 256], + 120016: [[65], 256], + 120017: [[66], 256], + 120018: [[67], 256], + 120019: [[68], 256], + 120020: [[69], 256], + 120021: [[70], 256], + 120022: [[71], 256], + 120023: [[72], 256], + 120024: [[73], 256], + 120025: [[74], 256], + 120026: [[75], 256], + 120027: [[76], 256], + 120028: [[77], 256], + 120029: [[78], 256], + 120030: [[79], 256], + 120031: [[80], 256], + 120032: [[81], 256], + 120033: [[82], 256], + 120034: [[83], 256], + 120035: [[84], 256], + 120036: [[85], 256], + 120037: [[86], 256], + 120038: [[87], 256], + 120039: [[88], 256], + 120040: [[89], 256], + 120041: [[90], 256], + 120042: [[97], 256], + 120043: [[98], 256], + 120044: [[99], 256], + 120045: [[100], 256], + 120046: [[101], 256], + 120047: [[102], 256], + 120048: [[103], 256], + 120049: [[104], 256], + 120050: [[105], 256], + 120051: [[106], 256], + 120052: [[107], 256], + 120053: [[108], 256], + 120054: [[109], 256], + 120055: [[110], 256], + 120056: [[111], 256], + 120057: [[112], 256], + 120058: [[113], 256], + 120059: [[114], 256], + 120060: [[115], 256], + 120061: [[116], 256], + 120062: [[117], 256], + 120063: [[118], 256] + }, + 54528: { + 120064: [[119], 256], + 120065: [[120], 256], + 120066: [[121], 256], + 120067: [[122], 256], + 120068: [[65], 256], + 120069: [[66], 256], + 120071: [[68], 256], + 120072: [[69], 256], + 120073: [[70], 256], + 120074: [[71], 256], + 120077: [[74], 256], + 120078: [[75], 256], + 120079: [[76], 256], + 120080: [[77], 256], + 120081: [[78], 256], + 120082: [[79], 256], + 120083: [[80], 256], + 120084: [[81], 256], + 120086: [[83], 256], + 120087: [[84], 256], + 120088: [[85], 256], + 120089: [[86], 256], + 120090: [[87], 256], + 120091: [[88], 256], + 120092: [[89], 256], + 120094: [[97], 256], + 120095: [[98], 256], + 120096: [[99], 256], + 120097: [[100], 256], + 120098: [[101], 256], + 120099: [[102], 256], + 120100: [[103], 256], + 120101: [[104], 256], + 120102: [[105], 256], + 120103: [[106], 256], + 120104: [[107], 256], + 120105: [[108], 256], + 120106: [[109], 256], + 120107: [[110], 256], + 120108: [[111], 256], + 120109: [[112], 256], + 120110: [[113], 256], + 120111: [[114], 256], + 120112: [[115], 256], + 120113: [[116], 256], + 120114: [[117], 256], + 120115: [[118], 256], + 120116: [[119], 256], + 120117: [[120], 256], + 120118: [[121], 256], + 120119: [[122], 256], + 120120: [[65], 256], + 120121: [[66], 256], + 120123: [[68], 256], + 120124: [[69], 256], + 120125: [[70], 256], + 120126: [[71], 256], + 120128: [[73], 256], + 120129: [[74], 256], + 120130: [[75], 256], + 120131: [[76], 256], + 120132: [[77], 256], + 120134: [[79], 256], + 120138: [[83], 256], + 120139: [[84], 256], + 120140: [[85], 256], + 120141: [[86], 256], + 120142: [[87], 256], + 120143: [[88], 256], + 120144: [[89], 256], + 120146: [[97], 256], + 120147: [[98], 256], + 120148: [[99], 256], + 120149: [[100], 256], + 120150: [[101], 256], + 120151: [[102], 256], + 120152: [[103], 256], + 120153: [[104], 256], + 120154: [[105], 256], + 120155: [[106], 256], + 120156: [[107], 256], + 120157: [[108], 256], + 120158: [[109], 256], + 120159: [[110], 256], + 120160: [[111], 256], + 120161: [[112], 256], + 120162: [[113], 256], + 120163: [[114], 256], + 120164: [[115], 256], + 120165: [[116], 256], + 120166: [[117], 256], + 120167: [[118], 256], + 120168: [[119], 256], + 120169: [[120], 256], + 120170: [[121], 256], + 120171: [[122], 256], + 120172: [[65], 256], + 120173: [[66], 256], + 120174: [[67], 256], + 120175: [[68], 256], + 120176: [[69], 256], + 120177: [[70], 256], + 120178: [[71], 256], + 120179: [[72], 256], + 120180: [[73], 256], + 120181: [[74], 256], + 120182: [[75], 256], + 120183: [[76], 256], + 120184: [[77], 256], + 120185: [[78], 256], + 120186: [[79], 256], + 120187: [[80], 256], + 120188: [[81], 256], + 120189: [[82], 256], + 120190: [[83], 256], + 120191: [[84], 256], + 120192: [[85], 256], + 120193: [[86], 256], + 120194: [[87], 256], + 120195: [[88], 256], + 120196: [[89], 256], + 120197: [[90], 256], + 120198: [[97], 256], + 120199: [[98], 256], + 120200: [[99], 256], + 120201: [[100], 256], + 120202: [[101], 256], + 120203: [[102], 256], + 120204: [[103], 256], + 120205: [[104], 256], + 120206: [[105], 256], + 120207: [[106], 256], + 120208: [[107], 256], + 120209: [[108], 256], + 120210: [[109], 256], + 120211: [[110], 256], + 120212: [[111], 256], + 120213: [[112], 256], + 120214: [[113], 256], + 120215: [[114], 256], + 120216: [[115], 256], + 120217: [[116], 256], + 120218: [[117], 256], + 120219: [[118], 256], + 120220: [[119], 256], + 120221: [[120], 256], + 120222: [[121], 256], + 120223: [[122], 256], + 120224: [[65], 256], + 120225: [[66], 256], + 120226: [[67], 256], + 120227: [[68], 256], + 120228: [[69], 256], + 120229: [[70], 256], + 120230: [[71], 256], + 120231: [[72], 256], + 120232: [[73], 256], + 120233: [[74], 256], + 120234: [[75], 256], + 120235: [[76], 256], + 120236: [[77], 256], + 120237: [[78], 256], + 120238: [[79], 256], + 120239: [[80], 256], + 120240: [[81], 256], + 120241: [[82], 256], + 120242: [[83], 256], + 120243: [[84], 256], + 120244: [[85], 256], + 120245: [[86], 256], + 120246: [[87], 256], + 120247: [[88], 256], + 120248: [[89], 256], + 120249: [[90], 256], + 120250: [[97], 256], + 120251: [[98], 256], + 120252: [[99], 256], + 120253: [[100], 256], + 120254: [[101], 256], + 120255: [[102], 256], + 120256: [[103], 256], + 120257: [[104], 256], + 120258: [[105], 256], + 120259: [[106], 256], + 120260: [[107], 256], + 120261: [[108], 256], + 120262: [[109], 256], + 120263: [[110], 256], + 120264: [[111], 256], + 120265: [[112], 256], + 120266: [[113], 256], + 120267: [[114], 256], + 120268: [[115], 256], + 120269: [[116], 256], + 120270: [[117], 256], + 120271: [[118], 256], + 120272: [[119], 256], + 120273: [[120], 256], + 120274: [[121], 256], + 120275: [[122], 256], + 120276: [[65], 256], + 120277: [[66], 256], + 120278: [[67], 256], + 120279: [[68], 256], + 120280: [[69], 256], + 120281: [[70], 256], + 120282: [[71], 256], + 120283: [[72], 256], + 120284: [[73], 256], + 120285: [[74], 256], + 120286: [[75], 256], + 120287: [[76], 256], + 120288: [[77], 256], + 120289: [[78], 256], + 120290: [[79], 256], + 120291: [[80], 256], + 120292: [[81], 256], + 120293: [[82], 256], + 120294: [[83], 256], + 120295: [[84], 256], + 120296: [[85], 256], + 120297: [[86], 256], + 120298: [[87], 256], + 120299: [[88], 256], + 120300: [[89], 256], + 120301: [[90], 256], + 120302: [[97], 256], + 120303: [[98], 256], + 120304: [[99], 256], + 120305: [[100], 256], + 120306: [[101], 256], + 120307: [[102], 256], + 120308: [[103], 256], + 120309: [[104], 256], + 120310: [[105], 256], + 120311: [[106], 256], + 120312: [[107], 256], + 120313: [[108], 256], + 120314: [[109], 256], + 120315: [[110], 256], + 120316: [[111], 256], + 120317: [[112], 256], + 120318: [[113], 256], + 120319: [[114], 256] + }, + 54784: { + 120320: [[115], 256], + 120321: [[116], 256], + 120322: [[117], 256], + 120323: [[118], 256], + 120324: [[119], 256], + 120325: [[120], 256], + 120326: [[121], 256], + 120327: [[122], 256], + 120328: [[65], 256], + 120329: [[66], 256], + 120330: [[67], 256], + 120331: [[68], 256], + 120332: [[69], 256], + 120333: [[70], 256], + 120334: [[71], 256], + 120335: [[72], 256], + 120336: [[73], 256], + 120337: [[74], 256], + 120338: [[75], 256], + 120339: [[76], 256], + 120340: [[77], 256], + 120341: [[78], 256], + 120342: [[79], 256], + 120343: [[80], 256], + 120344: [[81], 256], + 120345: [[82], 256], + 120346: [[83], 256], + 120347: [[84], 256], + 120348: [[85], 256], + 120349: [[86], 256], + 120350: [[87], 256], + 120351: [[88], 256], + 120352: [[89], 256], + 120353: [[90], 256], + 120354: [[97], 256], + 120355: [[98], 256], + 120356: [[99], 256], + 120357: [[100], 256], + 120358: [[101], 256], + 120359: [[102], 256], + 120360: [[103], 256], + 120361: [[104], 256], + 120362: [[105], 256], + 120363: [[106], 256], + 120364: [[107], 256], + 120365: [[108], 256], + 120366: [[109], 256], + 120367: [[110], 256], + 120368: [[111], 256], + 120369: [[112], 256], + 120370: [[113], 256], + 120371: [[114], 256], + 120372: [[115], 256], + 120373: [[116], 256], + 120374: [[117], 256], + 120375: [[118], 256], + 120376: [[119], 256], + 120377: [[120], 256], + 120378: [[121], 256], + 120379: [[122], 256], + 120380: [[65], 256], + 120381: [[66], 256], + 120382: [[67], 256], + 120383: [[68], 256], + 120384: [[69], 256], + 120385: [[70], 256], + 120386: [[71], 256], + 120387: [[72], 256], + 120388: [[73], 256], + 120389: [[74], 256], + 120390: [[75], 256], + 120391: [[76], 256], + 120392: [[77], 256], + 120393: [[78], 256], + 120394: [[79], 256], + 120395: [[80], 256], + 120396: [[81], 256], + 120397: [[82], 256], + 120398: [[83], 256], + 120399: [[84], 256], + 120400: [[85], 256], + 120401: [[86], 256], + 120402: [[87], 256], + 120403: [[88], 256], + 120404: [[89], 256], + 120405: [[90], 256], + 120406: [[97], 256], + 120407: [[98], 256], + 120408: [[99], 256], + 120409: [[100], 256], + 120410: [[101], 256], + 120411: [[102], 256], + 120412: [[103], 256], + 120413: [[104], 256], + 120414: [[105], 256], + 120415: [[106], 256], + 120416: [[107], 256], + 120417: [[108], 256], + 120418: [[109], 256], + 120419: [[110], 256], + 120420: [[111], 256], + 120421: [[112], 256], + 120422: [[113], 256], + 120423: [[114], 256], + 120424: [[115], 256], + 120425: [[116], 256], + 120426: [[117], 256], + 120427: [[118], 256], + 120428: [[119], 256], + 120429: [[120], 256], + 120430: [[121], 256], + 120431: [[122], 256], + 120432: [[65], 256], + 120433: [[66], 256], + 120434: [[67], 256], + 120435: [[68], 256], + 120436: [[69], 256], + 120437: [[70], 256], + 120438: [[71], 256], + 120439: [[72], 256], + 120440: [[73], 256], + 120441: [[74], 256], + 120442: [[75], 256], + 120443: [[76], 256], + 120444: [[77], 256], + 120445: [[78], 256], + 120446: [[79], 256], + 120447: [[80], 256], + 120448: [[81], 256], + 120449: [[82], 256], + 120450: [[83], 256], + 120451: [[84], 256], + 120452: [[85], 256], + 120453: [[86], 256], + 120454: [[87], 256], + 120455: [[88], 256], + 120456: [[89], 256], + 120457: [[90], 256], + 120458: [[97], 256], + 120459: [[98], 256], + 120460: [[99], 256], + 120461: [[100], 256], + 120462: [[101], 256], + 120463: [[102], 256], + 120464: [[103], 256], + 120465: [[104], 256], + 120466: [[105], 256], + 120467: [[106], 256], + 120468: [[107], 256], + 120469: [[108], 256], + 120470: [[109], 256], + 120471: [[110], 256], + 120472: [[111], 256], + 120473: [[112], 256], + 120474: [[113], 256], + 120475: [[114], 256], + 120476: [[115], 256], + 120477: [[116], 256], + 120478: [[117], 256], + 120479: [[118], 256], + 120480: [[119], 256], + 120481: [[120], 256], + 120482: [[121], 256], + 120483: [[122], 256], + 120484: [[305], 256], + 120485: [[567], 256], + 120488: [[913], 256], + 120489: [[914], 256], + 120490: [[915], 256], + 120491: [[916], 256], + 120492: [[917], 256], + 120493: [[918], 256], + 120494: [[919], 256], + 120495: [[920], 256], + 120496: [[921], 256], + 120497: [[922], 256], + 120498: [[923], 256], + 120499: [[924], 256], + 120500: [[925], 256], + 120501: [[926], 256], + 120502: [[927], 256], + 120503: [[928], 256], + 120504: [[929], 256], + 120505: [[1012], 256], + 120506: [[931], 256], + 120507: [[932], 256], + 120508: [[933], 256], + 120509: [[934], 256], + 120510: [[935], 256], + 120511: [[936], 256], + 120512: [[937], 256], + 120513: [[8711], 256], + 120514: [[945], 256], + 120515: [[946], 256], + 120516: [[947], 256], + 120517: [[948], 256], + 120518: [[949], 256], + 120519: [[950], 256], + 120520: [[951], 256], + 120521: [[952], 256], + 120522: [[953], 256], + 120523: [[954], 256], + 120524: [[955], 256], + 120525: [[956], 256], + 120526: [[957], 256], + 120527: [[958], 256], + 120528: [[959], 256], + 120529: [[960], 256], + 120530: [[961], 256], + 120531: [[962], 256], + 120532: [[963], 256], + 120533: [[964], 256], + 120534: [[965], 256], + 120535: [[966], 256], + 120536: [[967], 256], + 120537: [[968], 256], + 120538: [[969], 256], + 120539: [[8706], 256], + 120540: [[1013], 256], + 120541: [[977], 256], + 120542: [[1008], 256], + 120543: [[981], 256], + 120544: [[1009], 256], + 120545: [[982], 256], + 120546: [[913], 256], + 120547: [[914], 256], + 120548: [[915], 256], + 120549: [[916], 256], + 120550: [[917], 256], + 120551: [[918], 256], + 120552: [[919], 256], + 120553: [[920], 256], + 120554: [[921], 256], + 120555: [[922], 256], + 120556: [[923], 256], + 120557: [[924], 256], + 120558: [[925], 256], + 120559: [[926], 256], + 120560: [[927], 256], + 120561: [[928], 256], + 120562: [[929], 256], + 120563: [[1012], 256], + 120564: [[931], 256], + 120565: [[932], 256], + 120566: [[933], 256], + 120567: [[934], 256], + 120568: [[935], 256], + 120569: [[936], 256], + 120570: [[937], 256], + 120571: [[8711], 256], + 120572: [[945], 256], + 120573: [[946], 256], + 120574: [[947], 256], + 120575: [[948], 256] + }, + 55040: { + 120576: [[949], 256], + 120577: [[950], 256], + 120578: [[951], 256], + 120579: [[952], 256], + 120580: [[953], 256], + 120581: [[954], 256], + 120582: [[955], 256], + 120583: [[956], 256], + 120584: [[957], 256], + 120585: [[958], 256], + 120586: [[959], 256], + 120587: [[960], 256], + 120588: [[961], 256], + 120589: [[962], 256], + 120590: [[963], 256], + 120591: [[964], 256], + 120592: [[965], 256], + 120593: [[966], 256], + 120594: [[967], 256], + 120595: [[968], 256], + 120596: [[969], 256], + 120597: [[8706], 256], + 120598: [[1013], 256], + 120599: [[977], 256], + 120600: [[1008], 256], + 120601: [[981], 256], + 120602: [[1009], 256], + 120603: [[982], 256], + 120604: [[913], 256], + 120605: [[914], 256], + 120606: [[915], 256], + 120607: [[916], 256], + 120608: [[917], 256], + 120609: [[918], 256], + 120610: [[919], 256], + 120611: [[920], 256], + 120612: [[921], 256], + 120613: [[922], 256], + 120614: [[923], 256], + 120615: [[924], 256], + 120616: [[925], 256], + 120617: [[926], 256], + 120618: [[927], 256], + 120619: [[928], 256], + 120620: [[929], 256], + 120621: [[1012], 256], + 120622: [[931], 256], + 120623: [[932], 256], + 120624: [[933], 256], + 120625: [[934], 256], + 120626: [[935], 256], + 120627: [[936], 256], + 120628: [[937], 256], + 120629: [[8711], 256], + 120630: [[945], 256], + 120631: [[946], 256], + 120632: [[947], 256], + 120633: [[948], 256], + 120634: [[949], 256], + 120635: [[950], 256], + 120636: [[951], 256], + 120637: [[952], 256], + 120638: [[953], 256], + 120639: [[954], 256], + 120640: [[955], 256], + 120641: [[956], 256], + 120642: [[957], 256], + 120643: [[958], 256], + 120644: [[959], 256], + 120645: [[960], 256], + 120646: [[961], 256], + 120647: [[962], 256], + 120648: [[963], 256], + 120649: [[964], 256], + 120650: [[965], 256], + 120651: [[966], 256], + 120652: [[967], 256], + 120653: [[968], 256], + 120654: [[969], 256], + 120655: [[8706], 256], + 120656: [[1013], 256], + 120657: [[977], 256], + 120658: [[1008], 256], + 120659: [[981], 256], + 120660: [[1009], 256], + 120661: [[982], 256], + 120662: [[913], 256], + 120663: [[914], 256], + 120664: [[915], 256], + 120665: [[916], 256], + 120666: [[917], 256], + 120667: [[918], 256], + 120668: [[919], 256], + 120669: [[920], 256], + 120670: [[921], 256], + 120671: [[922], 256], + 120672: [[923], 256], + 120673: [[924], 256], + 120674: [[925], 256], + 120675: [[926], 256], + 120676: [[927], 256], + 120677: [[928], 256], + 120678: [[929], 256], + 120679: [[1012], 256], + 120680: [[931], 256], + 120681: [[932], 256], + 120682: [[933], 256], + 120683: [[934], 256], + 120684: [[935], 256], + 120685: [[936], 256], + 120686: [[937], 256], + 120687: [[8711], 256], + 120688: [[945], 256], + 120689: [[946], 256], + 120690: [[947], 256], + 120691: [[948], 256], + 120692: [[949], 256], + 120693: [[950], 256], + 120694: [[951], 256], + 120695: [[952], 256], + 120696: [[953], 256], + 120697: [[954], 256], + 120698: [[955], 256], + 120699: [[956], 256], + 120700: [[957], 256], + 120701: [[958], 256], + 120702: [[959], 256], + 120703: [[960], 256], + 120704: [[961], 256], + 120705: [[962], 256], + 120706: [[963], 256], + 120707: [[964], 256], + 120708: [[965], 256], + 120709: [[966], 256], + 120710: [[967], 256], + 120711: [[968], 256], + 120712: [[969], 256], + 120713: [[8706], 256], + 120714: [[1013], 256], + 120715: [[977], 256], + 120716: [[1008], 256], + 120717: [[981], 256], + 120718: [[1009], 256], + 120719: [[982], 256], + 120720: [[913], 256], + 120721: [[914], 256], + 120722: [[915], 256], + 120723: [[916], 256], + 120724: [[917], 256], + 120725: [[918], 256], + 120726: [[919], 256], + 120727: [[920], 256], + 120728: [[921], 256], + 120729: [[922], 256], + 120730: [[923], 256], + 120731: [[924], 256], + 120732: [[925], 256], + 120733: [[926], 256], + 120734: [[927], 256], + 120735: [[928], 256], + 120736: [[929], 256], + 120737: [[1012], 256], + 120738: [[931], 256], + 120739: [[932], 256], + 120740: [[933], 256], + 120741: [[934], 256], + 120742: [[935], 256], + 120743: [[936], 256], + 120744: [[937], 256], + 120745: [[8711], 256], + 120746: [[945], 256], + 120747: [[946], 256], + 120748: [[947], 256], + 120749: [[948], 256], + 120750: [[949], 256], + 120751: [[950], 256], + 120752: [[951], 256], + 120753: [[952], 256], + 120754: [[953], 256], + 120755: [[954], 256], + 120756: [[955], 256], + 120757: [[956], 256], + 120758: [[957], 256], + 120759: [[958], 256], + 120760: [[959], 256], + 120761: [[960], 256], + 120762: [[961], 256], + 120763: [[962], 256], + 120764: [[963], 256], + 120765: [[964], 256], + 120766: [[965], 256], + 120767: [[966], 256], + 120768: [[967], 256], + 120769: [[968], 256], + 120770: [[969], 256], + 120771: [[8706], 256], + 120772: [[1013], 256], + 120773: [[977], 256], + 120774: [[1008], 256], + 120775: [[981], 256], + 120776: [[1009], 256], + 120777: [[982], 256], + 120778: [[988], 256], + 120779: [[989], 256], + 120782: [[48], 256], + 120783: [[49], 256], + 120784: [[50], 256], + 120785: [[51], 256], + 120786: [[52], 256], + 120787: [[53], 256], + 120788: [[54], 256], + 120789: [[55], 256], + 120790: [[56], 256], + 120791: [[57], 256], + 120792: [[48], 256], + 120793: [[49], 256], + 120794: [[50], 256], + 120795: [[51], 256], + 120796: [[52], 256], + 120797: [[53], 256], + 120798: [[54], 256], + 120799: [[55], 256], + 120800: [[56], 256], + 120801: [[57], 256], + 120802: [[48], 256], + 120803: [[49], 256], + 120804: [[50], 256], + 120805: [[51], 256], + 120806: [[52], 256], + 120807: [[53], 256], + 120808: [[54], 256], + 120809: [[55], 256], + 120810: [[56], 256], + 120811: [[57], 256], + 120812: [[48], 256], + 120813: [[49], 256], + 120814: [[50], 256], + 120815: [[51], 256], + 120816: [[52], 256], + 120817: [[53], 256], + 120818: [[54], 256], + 120819: [[55], 256], + 120820: [[56], 256], + 120821: [[57], 256], + 120822: [[48], 256], + 120823: [[49], 256], + 120824: [[50], 256], + 120825: [[51], 256], + 120826: [[52], 256], + 120827: [[53], 256], + 120828: [[54], 256], + 120829: [[55], 256], + 120830: [[56], 256], + 120831: [[57], 256] + }, + 60928: { + 126464: [[1575], 256], + 126465: [[1576], 256], + 126466: [[1580], 256], + 126467: [[1583], 256], + 126469: [[1608], 256], + 126470: [[1586], 256], + 126471: [[1581], 256], + 126472: [[1591], 256], + 126473: [[1610], 256], + 126474: [[1603], 256], + 126475: [[1604], 256], + 126476: [[1605], 256], + 126477: [[1606], 256], + 126478: [[1587], 256], + 126479: [[1593], 256], + 126480: [[1601], 256], + 126481: [[1589], 256], + 126482: [[1602], 256], + 126483: [[1585], 256], + 126484: [[1588], 256], + 126485: [[1578], 256], + 126486: [[1579], 256], + 126487: [[1582], 256], + 126488: [[1584], 256], + 126489: [[1590], 256], + 126490: [[1592], 256], + 126491: [[1594], 256], + 126492: [[1646], 256], + 126493: [[1722], 256], + 126494: [[1697], 256], + 126495: [[1647], 256], + 126497: [[1576], 256], + 126498: [[1580], 256], + 126500: [[1607], 256], + 126503: [[1581], 256], + 126505: [[1610], 256], + 126506: [[1603], 256], + 126507: [[1604], 256], + 126508: [[1605], 256], + 126509: [[1606], 256], + 126510: [[1587], 256], + 126511: [[1593], 256], + 126512: [[1601], 256], + 126513: [[1589], 256], + 126514: [[1602], 256], + 126516: [[1588], 256], + 126517: [[1578], 256], + 126518: [[1579], 256], + 126519: [[1582], 256], + 126521: [[1590], 256], + 126523: [[1594], 256], + 126530: [[1580], 256], + 126535: [[1581], 256], + 126537: [[1610], 256], + 126539: [[1604], 256], + 126541: [[1606], 256], + 126542: [[1587], 256], + 126543: [[1593], 256], + 126545: [[1589], 256], + 126546: [[1602], 256], + 126548: [[1588], 256], + 126551: [[1582], 256], + 126553: [[1590], 256], + 126555: [[1594], 256], + 126557: [[1722], 256], + 126559: [[1647], 256], + 126561: [[1576], 256], + 126562: [[1580], 256], + 126564: [[1607], 256], + 126567: [[1581], 256], + 126568: [[1591], 256], + 126569: [[1610], 256], + 126570: [[1603], 256], + 126572: [[1605], 256], + 126573: [[1606], 256], + 126574: [[1587], 256], + 126575: [[1593], 256], + 126576: [[1601], 256], + 126577: [[1589], 256], + 126578: [[1602], 256], + 126580: [[1588], 256], + 126581: [[1578], 256], + 126582: [[1579], 256], + 126583: [[1582], 256], + 126585: [[1590], 256], + 126586: [[1592], 256], + 126587: [[1594], 256], + 126588: [[1646], 256], + 126590: [[1697], 256], + 126592: [[1575], 256], + 126593: [[1576], 256], + 126594: [[1580], 256], + 126595: [[1583], 256], + 126596: [[1607], 256], + 126597: [[1608], 256], + 126598: [[1586], 256], + 126599: [[1581], 256], + 126600: [[1591], 256], + 126601: [[1610], 256], + 126603: [[1604], 256], + 126604: [[1605], 256], + 126605: [[1606], 256], + 126606: [[1587], 256], + 126607: [[1593], 256], + 126608: [[1601], 256], + 126609: [[1589], 256], + 126610: [[1602], 256], + 126611: [[1585], 256], + 126612: [[1588], 256], + 126613: [[1578], 256], + 126614: [[1579], 256], + 126615: [[1582], 256], + 126616: [[1584], 256], + 126617: [[1590], 256], + 126618: [[1592], 256], + 126619: [[1594], 256], + 126625: [[1576], 256], + 126626: [[1580], 256], + 126627: [[1583], 256], + 126629: [[1608], 256], + 126630: [[1586], 256], + 126631: [[1581], 256], + 126632: [[1591], 256], + 126633: [[1610], 256], + 126635: [[1604], 256], + 126636: [[1605], 256], + 126637: [[1606], 256], + 126638: [[1587], 256], + 126639: [[1593], 256], + 126640: [[1601], 256], + 126641: [[1589], 256], + 126642: [[1602], 256], + 126643: [[1585], 256], + 126644: [[1588], 256], + 126645: [[1578], 256], + 126646: [[1579], 256], + 126647: [[1582], 256], + 126648: [[1584], 256], + 126649: [[1590], 256], + 126650: [[1592], 256], + 126651: [[1594], 256] + }, + 61696: { + 127232: [[48, 46], 256], + 127233: [[48, 44], 256], + 127234: [[49, 44], 256], + 127235: [[50, 44], 256], + 127236: [[51, 44], 256], + 127237: [[52, 44], 256], + 127238: [[53, 44], 256], + 127239: [[54, 44], 256], + 127240: [[55, 44], 256], + 127241: [[56, 44], 256], + 127242: [[57, 44], 256], + 127248: [[40, 65, 41], 256], + 127249: [[40, 66, 41], 256], + 127250: [[40, 67, 41], 256], + 127251: [[40, 68, 41], 256], + 127252: [[40, 69, 41], 256], + 127253: [[40, 70, 41], 256], + 127254: [[40, 71, 41], 256], + 127255: [[40, 72, 41], 256], + 127256: [[40, 73, 41], 256], + 127257: [[40, 74, 41], 256], + 127258: [[40, 75, 41], 256], + 127259: [[40, 76, 41], 256], + 127260: [[40, 77, 41], 256], + 127261: [[40, 78, 41], 256], + 127262: [[40, 79, 41], 256], + 127263: [[40, 80, 41], 256], + 127264: [[40, 81, 41], 256], + 127265: [[40, 82, 41], 256], + 127266: [[40, 83, 41], 256], + 127267: [[40, 84, 41], 256], + 127268: [[40, 85, 41], 256], + 127269: [[40, 86, 41], 256], + 127270: [[40, 87, 41], 256], + 127271: [[40, 88, 41], 256], + 127272: [[40, 89, 41], 256], + 127273: [[40, 90, 41], 256], + 127274: [[12308, 83, 12309], 256], + 127275: [[67], 256], + 127276: [[82], 256], + 127277: [[67, 68], 256], + 127278: [[87, 90], 256], + 127280: [[65], 256], + 127281: [[66], 256], + 127282: [[67], 256], + 127283: [[68], 256], + 127284: [[69], 256], + 127285: [[70], 256], + 127286: [[71], 256], + 127287: [[72], 256], + 127288: [[73], 256], + 127289: [[74], 256], + 127290: [[75], 256], + 127291: [[76], 256], + 127292: [[77], 256], + 127293: [[78], 256], + 127294: [[79], 256], + 127295: [[80], 256], + 127296: [[81], 256], + 127297: [[82], 256], + 127298: [[83], 256], + 127299: [[84], 256], + 127300: [[85], 256], + 127301: [[86], 256], + 127302: [[87], 256], + 127303: [[88], 256], + 127304: [[89], 256], + 127305: [[90], 256], + 127306: [[72, 86], 256], + 127307: [[77, 86], 256], + 127308: [[83, 68], 256], + 127309: [[83, 83], 256], + 127310: [[80, 80, 86], 256], + 127311: [[87, 67], 256], + 127338: [[77, 67], 256], + 127339: [[77, 68], 256], + 127376: [[68, 74], 256] + }, + 61952: { + 127488: [[12411, 12363], 256], + 127489: [[12467, 12467], 256], + 127490: [[12469], 256], + 127504: [[25163], 256], + 127505: [[23383], 256], + 127506: [[21452], 256], + 127507: [[12487], 256], + 127508: [[20108], 256], + 127509: [[22810], 256], + 127510: [[35299], 256], + 127511: [[22825], 256], + 127512: [[20132], 256], + 127513: [[26144], 256], + 127514: [[28961], 256], + 127515: [[26009], 256], + 127516: [[21069], 256], + 127517: [[24460], 256], + 127518: [[20877], 256], + 127519: [[26032], 256], + 127520: [[21021], 256], + 127521: [[32066], 256], + 127522: [[29983], 256], + 127523: [[36009], 256], + 127524: [[22768], 256], + 127525: [[21561], 256], + 127526: [[28436], 256], + 127527: [[25237], 256], + 127528: [[25429], 256], + 127529: [[19968], 256], + 127530: [[19977], 256], + 127531: [[36938], 256], + 127532: [[24038], 256], + 127533: [[20013], 256], + 127534: [[21491], 256], + 127535: [[25351], 256], + 127536: [[36208], 256], + 127537: [[25171], 256], + 127538: [[31105], 256], + 127539: [[31354], 256], + 127540: [[21512], 256], + 127541: [[28288], 256], + 127542: [[26377], 256], + 127543: [[26376], 256], + 127544: [[30003], 256], + 127545: [[21106], 256], + 127546: [[21942], 256], + 127552: [[12308, 26412, 12309], 256], + 127553: [[12308, 19977, 12309], 256], + 127554: [[12308, 20108, 12309], 256], + 127555: [[12308, 23433, 12309], 256], + 127556: [[12308, 28857, 12309], 256], + 127557: [[12308, 25171, 12309], 256], + 127558: [[12308, 30423, 12309], 256], + 127559: [[12308, 21213, 12309], 256], + 127560: [[12308, 25943, 12309], 256], + 127568: [[24471], 256], + 127569: [[21487], 256] + }, + 63488: { + 194560: [[20029]], + 194561: [[20024]], + 194562: [[20033]], + 194563: [[131362]], + 194564: [[20320]], + 194565: [[20398]], + 194566: [[20411]], + 194567: [[20482]], + 194568: [[20602]], + 194569: [[20633]], + 194570: [[20711]], + 194571: [[20687]], + 194572: [[13470]], + 194573: [[132666]], + 194574: [[20813]], + 194575: [[20820]], + 194576: [[20836]], + 194577: [[20855]], + 194578: [[132380]], + 194579: [[13497]], + 194580: [[20839]], + 194581: [[20877]], + 194582: [[132427]], + 194583: [[20887]], + 194584: [[20900]], + 194585: [[20172]], + 194586: [[20908]], + 194587: [[20917]], + 194588: [[168415]], + 194589: [[20981]], + 194590: [[20995]], + 194591: [[13535]], + 194592: [[21051]], + 194593: [[21062]], + 194594: [[21106]], + 194595: [[21111]], + 194596: [[13589]], + 194597: [[21191]], + 194598: [[21193]], + 194599: [[21220]], + 194600: [[21242]], + 194601: [[21253]], + 194602: [[21254]], + 194603: [[21271]], + 194604: [[21321]], + 194605: [[21329]], + 194606: [[21338]], + 194607: [[21363]], + 194608: [[21373]], + 194609: [[21375]], + 194610: [[21375]], + 194611: [[21375]], + 194612: [[133676]], + 194613: [[28784]], + 194614: [[21450]], + 194615: [[21471]], + 194616: [[133987]], + 194617: [[21483]], + 194618: [[21489]], + 194619: [[21510]], + 194620: [[21662]], + 194621: [[21560]], + 194622: [[21576]], + 194623: [[21608]], + 194624: [[21666]], + 194625: [[21750]], + 194626: [[21776]], + 194627: [[21843]], + 194628: [[21859]], + 194629: [[21892]], + 194630: [[21892]], + 194631: [[21913]], + 194632: [[21931]], + 194633: [[21939]], + 194634: [[21954]], + 194635: [[22294]], + 194636: [[22022]], + 194637: [[22295]], + 194638: [[22097]], + 194639: [[22132]], + 194640: [[20999]], + 194641: [[22766]], + 194642: [[22478]], + 194643: [[22516]], + 194644: [[22541]], + 194645: [[22411]], + 194646: [[22578]], + 194647: [[22577]], + 194648: [[22700]], + 194649: [[136420]], + 194650: [[22770]], + 194651: [[22775]], + 194652: [[22790]], + 194653: [[22810]], + 194654: [[22818]], + 194655: [[22882]], + 194656: [[136872]], + 194657: [[136938]], + 194658: [[23020]], + 194659: [[23067]], + 194660: [[23079]], + 194661: [[23000]], + 194662: [[23142]], + 194663: [[14062]], + 194664: [[14076]], + 194665: [[23304]], + 194666: [[23358]], + 194667: [[23358]], + 194668: [[137672]], + 194669: [[23491]], + 194670: [[23512]], + 194671: [[23527]], + 194672: [[23539]], + 194673: [[138008]], + 194674: [[23551]], + 194675: [[23558]], + 194676: [[24403]], + 194677: [[23586]], + 194678: [[14209]], + 194679: [[23648]], + 194680: [[23662]], + 194681: [[23744]], + 194682: [[23693]], + 194683: [[138724]], + 194684: [[23875]], + 194685: [[138726]], + 194686: [[23918]], + 194687: [[23915]], + 194688: [[23932]], + 194689: [[24033]], + 194690: [[24034]], + 194691: [[14383]], + 194692: [[24061]], + 194693: [[24104]], + 194694: [[24125]], + 194695: [[24169]], + 194696: [[14434]], + 194697: [[139651]], + 194698: [[14460]], + 194699: [[24240]], + 194700: [[24243]], + 194701: [[24246]], + 194702: [[24266]], + 194703: [[172946]], + 194704: [[24318]], + 194705: [[140081]], + 194706: [[140081]], + 194707: [[33281]], + 194708: [[24354]], + 194709: [[24354]], + 194710: [[14535]], + 194711: [[144056]], + 194712: [[156122]], + 194713: [[24418]], + 194714: [[24427]], + 194715: [[14563]], + 194716: [[24474]], + 194717: [[24525]], + 194718: [[24535]], + 194719: [[24569]], + 194720: [[24705]], + 194721: [[14650]], + 194722: [[14620]], + 194723: [[24724]], + 194724: [[141012]], + 194725: [[24775]], + 194726: [[24904]], + 194727: [[24908]], + 194728: [[24910]], + 194729: [[24908]], + 194730: [[24954]], + 194731: [[24974]], + 194732: [[25010]], + 194733: [[24996]], + 194734: [[25007]], + 194735: [[25054]], + 194736: [[25074]], + 194737: [[25078]], + 194738: [[25104]], + 194739: [[25115]], + 194740: [[25181]], + 194741: [[25265]], + 194742: [[25300]], + 194743: [[25424]], + 194744: [[142092]], + 194745: [[25405]], + 194746: [[25340]], + 194747: [[25448]], + 194748: [[25475]], + 194749: [[25572]], + 194750: [[142321]], + 194751: [[25634]], + 194752: [[25541]], + 194753: [[25513]], + 194754: [[14894]], + 194755: [[25705]], + 194756: [[25726]], + 194757: [[25757]], + 194758: [[25719]], + 194759: [[14956]], + 194760: [[25935]], + 194761: [[25964]], + 194762: [[143370]], + 194763: [[26083]], + 194764: [[26360]], + 194765: [[26185]], + 194766: [[15129]], + 194767: [[26257]], + 194768: [[15112]], + 194769: [[15076]], + 194770: [[20882]], + 194771: [[20885]], + 194772: [[26368]], + 194773: [[26268]], + 194774: [[32941]], + 194775: [[17369]], + 194776: [[26391]], + 194777: [[26395]], + 194778: [[26401]], + 194779: [[26462]], + 194780: [[26451]], + 194781: [[144323]], + 194782: [[15177]], + 194783: [[26618]], + 194784: [[26501]], + 194785: [[26706]], + 194786: [[26757]], + 194787: [[144493]], + 194788: [[26766]], + 194789: [[26655]], + 194790: [[26900]], + 194791: [[15261]], + 194792: [[26946]], + 194793: [[27043]], + 194794: [[27114]], + 194795: [[27304]], + 194796: [[145059]], + 194797: [[27355]], + 194798: [[15384]], + 194799: [[27425]], + 194800: [[145575]], + 194801: [[27476]], + 194802: [[15438]], + 194803: [[27506]], + 194804: [[27551]], + 194805: [[27578]], + 194806: [[27579]], + 194807: [[146061]], + 194808: [[138507]], + 194809: [[146170]], + 194810: [[27726]], + 194811: [[146620]], + 194812: [[27839]], + 194813: [[27853]], + 194814: [[27751]], + 194815: [[27926]] + }, + 63744: { + 63744: [[35912]], + 63745: [[26356]], + 63746: [[36554]], + 63747: [[36040]], + 63748: [[28369]], + 63749: [[20018]], + 63750: [[21477]], + 63751: [[40860]], + 63752: [[40860]], + 63753: [[22865]], + 63754: [[37329]], + 63755: [[21895]], + 63756: [[22856]], + 63757: [[25078]], + 63758: [[30313]], + 63759: [[32645]], + 63760: [[34367]], + 63761: [[34746]], + 63762: [[35064]], + 63763: [[37007]], + 63764: [[27138]], + 63765: [[27931]], + 63766: [[28889]], + 63767: [[29662]], + 63768: [[33853]], + 63769: [[37226]], + 63770: [[39409]], + 63771: [[20098]], + 63772: [[21365]], + 63773: [[27396]], + 63774: [[29211]], + 63775: [[34349]], + 63776: [[40478]], + 63777: [[23888]], + 63778: [[28651]], + 63779: [[34253]], + 63780: [[35172]], + 63781: [[25289]], + 63782: [[33240]], + 63783: [[34847]], + 63784: [[24266]], + 63785: [[26391]], + 63786: [[28010]], + 63787: [[29436]], + 63788: [[37070]], + 63789: [[20358]], + 63790: [[20919]], + 63791: [[21214]], + 63792: [[25796]], + 63793: [[27347]], + 63794: [[29200]], + 63795: [[30439]], + 63796: [[32769]], + 63797: [[34310]], + 63798: [[34396]], + 63799: [[36335]], + 63800: [[38706]], + 63801: [[39791]], + 63802: [[40442]], + 63803: [[30860]], + 63804: [[31103]], + 63805: [[32160]], + 63806: [[33737]], + 63807: [[37636]], + 63808: [[40575]], + 63809: [[35542]], + 63810: [[22751]], + 63811: [[24324]], + 63812: [[31840]], + 63813: [[32894]], + 63814: [[29282]], + 63815: [[30922]], + 63816: [[36034]], + 63817: [[38647]], + 63818: [[22744]], + 63819: [[23650]], + 63820: [[27155]], + 63821: [[28122]], + 63822: [[28431]], + 63823: [[32047]], + 63824: [[32311]], + 63825: [[38475]], + 63826: [[21202]], + 63827: [[32907]], + 63828: [[20956]], + 63829: [[20940]], + 63830: [[31260]], + 63831: [[32190]], + 63832: [[33777]], + 63833: [[38517]], + 63834: [[35712]], + 63835: [[25295]], + 63836: [[27138]], + 63837: [[35582]], + 63838: [[20025]], + 63839: [[23527]], + 63840: [[24594]], + 63841: [[29575]], + 63842: [[30064]], + 63843: [[21271]], + 63844: [[30971]], + 63845: [[20415]], + 63846: [[24489]], + 63847: [[19981]], + 63848: [[27852]], + 63849: [[25976]], + 63850: [[32034]], + 63851: [[21443]], + 63852: [[22622]], + 63853: [[30465]], + 63854: [[33865]], + 63855: [[35498]], + 63856: [[27578]], + 63857: [[36784]], + 63858: [[27784]], + 63859: [[25342]], + 63860: [[33509]], + 63861: [[25504]], + 63862: [[30053]], + 63863: [[20142]], + 63864: [[20841]], + 63865: [[20937]], + 63866: [[26753]], + 63867: [[31975]], + 63868: [[33391]], + 63869: [[35538]], + 63870: [[37327]], + 63871: [[21237]], + 63872: [[21570]], + 63873: [[22899]], + 63874: [[24300]], + 63875: [[26053]], + 63876: [[28670]], + 63877: [[31018]], + 63878: [[38317]], + 63879: [[39530]], + 63880: [[40599]], + 63881: [[40654]], + 63882: [[21147]], + 63883: [[26310]], + 63884: [[27511]], + 63885: [[36706]], + 63886: [[24180]], + 63887: [[24976]], + 63888: [[25088]], + 63889: [[25754]], + 63890: [[28451]], + 63891: [[29001]], + 63892: [[29833]], + 63893: [[31178]], + 63894: [[32244]], + 63895: [[32879]], + 63896: [[36646]], + 63897: [[34030]], + 63898: [[36899]], + 63899: [[37706]], + 63900: [[21015]], + 63901: [[21155]], + 63902: [[21693]], + 63903: [[28872]], + 63904: [[35010]], + 63905: [[35498]], + 63906: [[24265]], + 63907: [[24565]], + 63908: [[25467]], + 63909: [[27566]], + 63910: [[31806]], + 63911: [[29557]], + 63912: [[20196]], + 63913: [[22265]], + 63914: [[23527]], + 63915: [[23994]], + 63916: [[24604]], + 63917: [[29618]], + 63918: [[29801]], + 63919: [[32666]], + 63920: [[32838]], + 63921: [[37428]], + 63922: [[38646]], + 63923: [[38728]], + 63924: [[38936]], + 63925: [[20363]], + 63926: [[31150]], + 63927: [[37300]], + 63928: [[38584]], + 63929: [[24801]], + 63930: [[20102]], + 63931: [[20698]], + 63932: [[23534]], + 63933: [[23615]], + 63934: [[26009]], + 63935: [[27138]], + 63936: [[29134]], + 63937: [[30274]], + 63938: [[34044]], + 63939: [[36988]], + 63940: [[40845]], + 63941: [[26248]], + 63942: [[38446]], + 63943: [[21129]], + 63944: [[26491]], + 63945: [[26611]], + 63946: [[27969]], + 63947: [[28316]], + 63948: [[29705]], + 63949: [[30041]], + 63950: [[30827]], + 63951: [[32016]], + 63952: [[39006]], + 63953: [[20845]], + 63954: [[25134]], + 63955: [[38520]], + 63956: [[20523]], + 63957: [[23833]], + 63958: [[28138]], + 63959: [[36650]], + 63960: [[24459]], + 63961: [[24900]], + 63962: [[26647]], + 63963: [[29575]], + 63964: [[38534]], + 63965: [[21033]], + 63966: [[21519]], + 63967: [[23653]], + 63968: [[26131]], + 63969: [[26446]], + 63970: [[26792]], + 63971: [[27877]], + 63972: [[29702]], + 63973: [[30178]], + 63974: [[32633]], + 63975: [[35023]], + 63976: [[35041]], + 63977: [[37324]], + 63978: [[38626]], + 63979: [[21311]], + 63980: [[28346]], + 63981: [[21533]], + 63982: [[29136]], + 63983: [[29848]], + 63984: [[34298]], + 63985: [[38563]], + 63986: [[40023]], + 63987: [[40607]], + 63988: [[26519]], + 63989: [[28107]], + 63990: [[33256]], + 63991: [[31435]], + 63992: [[31520]], + 63993: [[31890]], + 63994: [[29376]], + 63995: [[28825]], + 63996: [[35672]], + 63997: [[20160]], + 63998: [[33590]], + 63999: [[21050]], + 194816: [[27966]], + 194817: [[28023]], + 194818: [[27969]], + 194819: [[28009]], + 194820: [[28024]], + 194821: [[28037]], + 194822: [[146718]], + 194823: [[27956]], + 194824: [[28207]], + 194825: [[28270]], + 194826: [[15667]], + 194827: [[28363]], + 194828: [[28359]], + 194829: [[147153]], + 194830: [[28153]], + 194831: [[28526]], + 194832: [[147294]], + 194833: [[147342]], + 194834: [[28614]], + 194835: [[28729]], + 194836: [[28702]], + 194837: [[28699]], + 194838: [[15766]], + 194839: [[28746]], + 194840: [[28797]], + 194841: [[28791]], + 194842: [[28845]], + 194843: [[132389]], + 194844: [[28997]], + 194845: [[148067]], + 194846: [[29084]], + 194847: [[148395]], + 194848: [[29224]], + 194849: [[29237]], + 194850: [[29264]], + 194851: [[149000]], + 194852: [[29312]], + 194853: [[29333]], + 194854: [[149301]], + 194855: [[149524]], + 194856: [[29562]], + 194857: [[29579]], + 194858: [[16044]], + 194859: [[29605]], + 194860: [[16056]], + 194861: [[16056]], + 194862: [[29767]], + 194863: [[29788]], + 194864: [[29809]], + 194865: [[29829]], + 194866: [[29898]], + 194867: [[16155]], + 194868: [[29988]], + 194869: [[150582]], + 194870: [[30014]], + 194871: [[150674]], + 194872: [[30064]], + 194873: [[139679]], + 194874: [[30224]], + 194875: [[151457]], + 194876: [[151480]], + 194877: [[151620]], + 194878: [[16380]], + 194879: [[16392]], + 194880: [[30452]], + 194881: [[151795]], + 194882: [[151794]], + 194883: [[151833]], + 194884: [[151859]], + 194885: [[30494]], + 194886: [[30495]], + 194887: [[30495]], + 194888: [[30538]], + 194889: [[16441]], + 194890: [[30603]], + 194891: [[16454]], + 194892: [[16534]], + 194893: [[152605]], + 194894: [[30798]], + 194895: [[30860]], + 194896: [[30924]], + 194897: [[16611]], + 194898: [[153126]], + 194899: [[31062]], + 194900: [[153242]], + 194901: [[153285]], + 194902: [[31119]], + 194903: [[31211]], + 194904: [[16687]], + 194905: [[31296]], + 194906: [[31306]], + 194907: [[31311]], + 194908: [[153980]], + 194909: [[154279]], + 194910: [[154279]], + 194911: [[31470]], + 194912: [[16898]], + 194913: [[154539]], + 194914: [[31686]], + 194915: [[31689]], + 194916: [[16935]], + 194917: [[154752]], + 194918: [[31954]], + 194919: [[17056]], + 194920: [[31976]], + 194921: [[31971]], + 194922: [[32000]], + 194923: [[155526]], + 194924: [[32099]], + 194925: [[17153]], + 194926: [[32199]], + 194927: [[32258]], + 194928: [[32325]], + 194929: [[17204]], + 194930: [[156200]], + 194931: [[156231]], + 194932: [[17241]], + 194933: [[156377]], + 194934: [[32634]], + 194935: [[156478]], + 194936: [[32661]], + 194937: [[32762]], + 194938: [[32773]], + 194939: [[156890]], + 194940: [[156963]], + 194941: [[32864]], + 194942: [[157096]], + 194943: [[32880]], + 194944: [[144223]], + 194945: [[17365]], + 194946: [[32946]], + 194947: [[33027]], + 194948: [[17419]], + 194949: [[33086]], + 194950: [[23221]], + 194951: [[157607]], + 194952: [[157621]], + 194953: [[144275]], + 194954: [[144284]], + 194955: [[33281]], + 194956: [[33284]], + 194957: [[36766]], + 194958: [[17515]], + 194959: [[33425]], + 194960: [[33419]], + 194961: [[33437]], + 194962: [[21171]], + 194963: [[33457]], + 194964: [[33459]], + 194965: [[33469]], + 194966: [[33510]], + 194967: [[158524]], + 194968: [[33509]], + 194969: [[33565]], + 194970: [[33635]], + 194971: [[33709]], + 194972: [[33571]], + 194973: [[33725]], + 194974: [[33767]], + 194975: [[33879]], + 194976: [[33619]], + 194977: [[33738]], + 194978: [[33740]], + 194979: [[33756]], + 194980: [[158774]], + 194981: [[159083]], + 194982: [[158933]], + 194983: [[17707]], + 194984: [[34033]], + 194985: [[34035]], + 194986: [[34070]], + 194987: [[160714]], + 194988: [[34148]], + 194989: [[159532]], + 194990: [[17757]], + 194991: [[17761]], + 194992: [[159665]], + 194993: [[159954]], + 194994: [[17771]], + 194995: [[34384]], + 194996: [[34396]], + 194997: [[34407]], + 194998: [[34409]], + 194999: [[34473]], + 195000: [[34440]], + 195001: [[34574]], + 195002: [[34530]], + 195003: [[34681]], + 195004: [[34600]], + 195005: [[34667]], + 195006: [[34694]], + 195007: [[17879]], + 195008: [[34785]], + 195009: [[34817]], + 195010: [[17913]], + 195011: [[34912]], + 195012: [[34915]], + 195013: [[161383]], + 195014: [[35031]], + 195015: [[35038]], + 195016: [[17973]], + 195017: [[35066]], + 195018: [[13499]], + 195019: [[161966]], + 195020: [[162150]], + 195021: [[18110]], + 195022: [[18119]], + 195023: [[35488]], + 195024: [[35565]], + 195025: [[35722]], + 195026: [[35925]], + 195027: [[162984]], + 195028: [[36011]], + 195029: [[36033]], + 195030: [[36123]], + 195031: [[36215]], + 195032: [[163631]], + 195033: [[133124]], + 195034: [[36299]], + 195035: [[36284]], + 195036: [[36336]], + 195037: [[133342]], + 195038: [[36564]], + 195039: [[36664]], + 195040: [[165330]], + 195041: [[165357]], + 195042: [[37012]], + 195043: [[37105]], + 195044: [[37137]], + 195045: [[165678]], + 195046: [[37147]], + 195047: [[37432]], + 195048: [[37591]], + 195049: [[37592]], + 195050: [[37500]], + 195051: [[37881]], + 195052: [[37909]], + 195053: [[166906]], + 195054: [[38283]], + 195055: [[18837]], + 195056: [[38327]], + 195057: [[167287]], + 195058: [[18918]], + 195059: [[38595]], + 195060: [[23986]], + 195061: [[38691]], + 195062: [[168261]], + 195063: [[168474]], + 195064: [[19054]], + 195065: [[19062]], + 195066: [[38880]], + 195067: [[168970]], + 195068: [[19122]], + 195069: [[169110]], + 195070: [[38923]], + 195071: [[38923]] + }, + 64000: { + 64000: [[20999]], + 64001: [[24230]], + 64002: [[25299]], + 64003: [[31958]], + 64004: [[23429]], + 64005: [[27934]], + 64006: [[26292]], + 64007: [[36667]], + 64008: [[34892]], + 64009: [[38477]], + 64010: [[35211]], + 64011: [[24275]], + 64012: [[20800]], + 64013: [[21952]], + 64016: [[22618]], + 64018: [[26228]], + 64021: [[20958]], + 64022: [[29482]], + 64023: [[30410]], + 64024: [[31036]], + 64025: [[31070]], + 64026: [[31077]], + 64027: [[31119]], + 64028: [[38742]], + 64029: [[31934]], + 64030: [[32701]], + 64032: [[34322]], + 64034: [[35576]], + 64037: [[36920]], + 64038: [[37117]], + 64042: [[39151]], + 64043: [[39164]], + 64044: [[39208]], + 64045: [[40372]], + 64046: [[37086]], + 64047: [[38583]], + 64048: [[20398]], + 64049: [[20711]], + 64050: [[20813]], + 64051: [[21193]], + 64052: [[21220]], + 64053: [[21329]], + 64054: [[21917]], + 64055: [[22022]], + 64056: [[22120]], + 64057: [[22592]], + 64058: [[22696]], + 64059: [[23652]], + 64060: [[23662]], + 64061: [[24724]], + 64062: [[24936]], + 64063: [[24974]], + 64064: [[25074]], + 64065: [[25935]], + 64066: [[26082]], + 64067: [[26257]], + 64068: [[26757]], + 64069: [[28023]], + 64070: [[28186]], + 64071: [[28450]], + 64072: [[29038]], + 64073: [[29227]], + 64074: [[29730]], + 64075: [[30865]], + 64076: [[31038]], + 64077: [[31049]], + 64078: [[31048]], + 64079: [[31056]], + 64080: [[31062]], + 64081: [[31069]], + 64082: [[31117]], + 64083: [[31118]], + 64084: [[31296]], + 64085: [[31361]], + 64086: [[31680]], + 64087: [[32244]], + 64088: [[32265]], + 64089: [[32321]], + 64090: [[32626]], + 64091: [[32773]], + 64092: [[33261]], + 64093: [[33401]], + 64094: [[33401]], + 64095: [[33879]], + 64096: [[35088]], + 64097: [[35222]], + 64098: [[35585]], + 64099: [[35641]], + 64100: [[36051]], + 64101: [[36104]], + 64102: [[36790]], + 64103: [[36920]], + 64104: [[38627]], + 64105: [[38911]], + 64106: [[38971]], + 64107: [[24693]], + 64108: [[148206]], + 64109: [[33304]], + 64112: [[20006]], + 64113: [[20917]], + 64114: [[20840]], + 64115: [[20352]], + 64116: [[20805]], + 64117: [[20864]], + 64118: [[21191]], + 64119: [[21242]], + 64120: [[21917]], + 64121: [[21845]], + 64122: [[21913]], + 64123: [[21986]], + 64124: [[22618]], + 64125: [[22707]], + 64126: [[22852]], + 64127: [[22868]], + 64128: [[23138]], + 64129: [[23336]], + 64130: [[24274]], + 64131: [[24281]], + 64132: [[24425]], + 64133: [[24493]], + 64134: [[24792]], + 64135: [[24910]], + 64136: [[24840]], + 64137: [[24974]], + 64138: [[24928]], + 64139: [[25074]], + 64140: [[25140]], + 64141: [[25540]], + 64142: [[25628]], + 64143: [[25682]], + 64144: [[25942]], + 64145: [[26228]], + 64146: [[26391]], + 64147: [[26395]], + 64148: [[26454]], + 64149: [[27513]], + 64150: [[27578]], + 64151: [[27969]], + 64152: [[28379]], + 64153: [[28363]], + 64154: [[28450]], + 64155: [[28702]], + 64156: [[29038]], + 64157: [[30631]], + 64158: [[29237]], + 64159: [[29359]], + 64160: [[29482]], + 64161: [[29809]], + 64162: [[29958]], + 64163: [[30011]], + 64164: [[30237]], + 64165: [[30239]], + 64166: [[30410]], + 64167: [[30427]], + 64168: [[30452]], + 64169: [[30538]], + 64170: [[30528]], + 64171: [[30924]], + 64172: [[31409]], + 64173: [[31680]], + 64174: [[31867]], + 64175: [[32091]], + 64176: [[32244]], + 64177: [[32574]], + 64178: [[32773]], + 64179: [[33618]], + 64180: [[33775]], + 64181: [[34681]], + 64182: [[35137]], + 64183: [[35206]], + 64184: [[35222]], + 64185: [[35519]], + 64186: [[35576]], + 64187: [[35531]], + 64188: [[35585]], + 64189: [[35582]], + 64190: [[35565]], + 64191: [[35641]], + 64192: [[35722]], + 64193: [[36104]], + 64194: [[36664]], + 64195: [[36978]], + 64196: [[37273]], + 64197: [[37494]], + 64198: [[38524]], + 64199: [[38627]], + 64200: [[38742]], + 64201: [[38875]], + 64202: [[38911]], + 64203: [[38923]], + 64204: [[38971]], + 64205: [[39698]], + 64206: [[40860]], + 64207: [[141386]], + 64208: [[141380]], + 64209: [[144341]], + 64210: [[15261]], + 64211: [[16408]], + 64212: [[16441]], + 64213: [[152137]], + 64214: [[154832]], + 64215: [[163539]], + 64216: [[40771]], + 64217: [[40846]], + 195072: [[38953]], + 195073: [[169398]], + 195074: [[39138]], + 195075: [[19251]], + 195076: [[39209]], + 195077: [[39335]], + 195078: [[39362]], + 195079: [[39422]], + 195080: [[19406]], + 195081: [[170800]], + 195082: [[39698]], + 195083: [[40000]], + 195084: [[40189]], + 195085: [[19662]], + 195086: [[19693]], + 195087: [[40295]], + 195088: [[172238]], + 195089: [[19704]], + 195090: [[172293]], + 195091: [[172558]], + 195092: [[172689]], + 195093: [[40635]], + 195094: [[19798]], + 195095: [[40697]], + 195096: [[40702]], + 195097: [[40709]], + 195098: [[40719]], + 195099: [[40726]], + 195100: [[40763]], + 195101: [[173568]] + }, + 64256: { + 64256: [[102, 102], 256], + 64257: [[102, 105], 256], + 64258: [[102, 108], 256], + 64259: [[102, 102, 105], 256], + 64260: [[102, 102, 108], 256], + 64261: [[383, 116], 256], + 64262: [[115, 116], 256], + 64275: [[1396, 1398], 256], + 64276: [[1396, 1381], 256], + 64277: [[1396, 1387], 256], + 64278: [[1406, 1398], 256], + 64279: [[1396, 1389], 256], + 64285: [[1497, 1460], 512], + 64286: [, 26], + 64287: [[1522, 1463], 512], + 64288: [[1506], 256], + 64289: [[1488], 256], + 64290: [[1491], 256], + 64291: [[1492], 256], + 64292: [[1499], 256], + 64293: [[1500], 256], + 64294: [[1501], 256], + 64295: [[1512], 256], + 64296: [[1514], 256], + 64297: [[43], 256], + 64298: [[1513, 1473], 512], + 64299: [[1513, 1474], 512], + 64300: [[64329, 1473], 512], + 64301: [[64329, 1474], 512], + 64302: [[1488, 1463], 512], + 64303: [[1488, 1464], 512], + 64304: [[1488, 1468], 512], + 64305: [[1489, 1468], 512], + 64306: [[1490, 1468], 512], + 64307: [[1491, 1468], 512], + 64308: [[1492, 1468], 512], + 64309: [[1493, 1468], 512], + 64310: [[1494, 1468], 512], + 64312: [[1496, 1468], 512], + 64313: [[1497, 1468], 512], + 64314: [[1498, 1468], 512], + 64315: [[1499, 1468], 512], + 64316: [[1500, 1468], 512], + 64318: [[1502, 1468], 512], + 64320: [[1504, 1468], 512], + 64321: [[1505, 1468], 512], + 64323: [[1507, 1468], 512], + 64324: [[1508, 1468], 512], + 64326: [[1510, 1468], 512], + 64327: [[1511, 1468], 512], + 64328: [[1512, 1468], 512], + 64329: [[1513, 1468], 512], + 64330: [[1514, 1468], 512], + 64331: [[1493, 1465], 512], + 64332: [[1489, 1471], 512], + 64333: [[1499, 1471], 512], + 64334: [[1508, 1471], 512], + 64335: [[1488, 1500], 256], + 64336: [[1649], 256], + 64337: [[1649], 256], + 64338: [[1659], 256], + 64339: [[1659], 256], + 64340: [[1659], 256], + 64341: [[1659], 256], + 64342: [[1662], 256], + 64343: [[1662], 256], + 64344: [[1662], 256], + 64345: [[1662], 256], + 64346: [[1664], 256], + 64347: [[1664], 256], + 64348: [[1664], 256], + 64349: [[1664], 256], + 64350: [[1658], 256], + 64351: [[1658], 256], + 64352: [[1658], 256], + 64353: [[1658], 256], + 64354: [[1663], 256], + 64355: [[1663], 256], + 64356: [[1663], 256], + 64357: [[1663], 256], + 64358: [[1657], 256], + 64359: [[1657], 256], + 64360: [[1657], 256], + 64361: [[1657], 256], + 64362: [[1700], 256], + 64363: [[1700], 256], + 64364: [[1700], 256], + 64365: [[1700], 256], + 64366: [[1702], 256], + 64367: [[1702], 256], + 64368: [[1702], 256], + 64369: [[1702], 256], + 64370: [[1668], 256], + 64371: [[1668], 256], + 64372: [[1668], 256], + 64373: [[1668], 256], + 64374: [[1667], 256], + 64375: [[1667], 256], + 64376: [[1667], 256], + 64377: [[1667], 256], + 64378: [[1670], 256], + 64379: [[1670], 256], + 64380: [[1670], 256], + 64381: [[1670], 256], + 64382: [[1671], 256], + 64383: [[1671], 256], + 64384: [[1671], 256], + 64385: [[1671], 256], + 64386: [[1677], 256], + 64387: [[1677], 256], + 64388: [[1676], 256], + 64389: [[1676], 256], + 64390: [[1678], 256], + 64391: [[1678], 256], + 64392: [[1672], 256], + 64393: [[1672], 256], + 64394: [[1688], 256], + 64395: [[1688], 256], + 64396: [[1681], 256], + 64397: [[1681], 256], + 64398: [[1705], 256], + 64399: [[1705], 256], + 64400: [[1705], 256], + 64401: [[1705], 256], + 64402: [[1711], 256], + 64403: [[1711], 256], + 64404: [[1711], 256], + 64405: [[1711], 256], + 64406: [[1715], 256], + 64407: [[1715], 256], + 64408: [[1715], 256], + 64409: [[1715], 256], + 64410: [[1713], 256], + 64411: [[1713], 256], + 64412: [[1713], 256], + 64413: [[1713], 256], + 64414: [[1722], 256], + 64415: [[1722], 256], + 64416: [[1723], 256], + 64417: [[1723], 256], + 64418: [[1723], 256], + 64419: [[1723], 256], + 64420: [[1728], 256], + 64421: [[1728], 256], + 64422: [[1729], 256], + 64423: [[1729], 256], + 64424: [[1729], 256], + 64425: [[1729], 256], + 64426: [[1726], 256], + 64427: [[1726], 256], + 64428: [[1726], 256], + 64429: [[1726], 256], + 64430: [[1746], 256], + 64431: [[1746], 256], + 64432: [[1747], 256], + 64433: [[1747], 256], + 64467: [[1709], 256], + 64468: [[1709], 256], + 64469: [[1709], 256], + 64470: [[1709], 256], + 64471: [[1735], 256], + 64472: [[1735], 256], + 64473: [[1734], 256], + 64474: [[1734], 256], + 64475: [[1736], 256], + 64476: [[1736], 256], + 64477: [[1655], 256], + 64478: [[1739], 256], + 64479: [[1739], 256], + 64480: [[1733], 256], + 64481: [[1733], 256], + 64482: [[1737], 256], + 64483: [[1737], 256], + 64484: [[1744], 256], + 64485: [[1744], 256], + 64486: [[1744], 256], + 64487: [[1744], 256], + 64488: [[1609], 256], + 64489: [[1609], 256], + 64490: [[1574, 1575], 256], + 64491: [[1574, 1575], 256], + 64492: [[1574, 1749], 256], + 64493: [[1574, 1749], 256], + 64494: [[1574, 1608], 256], + 64495: [[1574, 1608], 256], + 64496: [[1574, 1735], 256], + 64497: [[1574, 1735], 256], + 64498: [[1574, 1734], 256], + 64499: [[1574, 1734], 256], + 64500: [[1574, 1736], 256], + 64501: [[1574, 1736], 256], + 64502: [[1574, 1744], 256], + 64503: [[1574, 1744], 256], + 64504: [[1574, 1744], 256], + 64505: [[1574, 1609], 256], + 64506: [[1574, 1609], 256], + 64507: [[1574, 1609], 256], + 64508: [[1740], 256], + 64509: [[1740], 256], + 64510: [[1740], 256], + 64511: [[1740], 256] + }, + 64512: { + 64512: [[1574, 1580], 256], + 64513: [[1574, 1581], 256], + 64514: [[1574, 1605], 256], + 64515: [[1574, 1609], 256], + 64516: [[1574, 1610], 256], + 64517: [[1576, 1580], 256], + 64518: [[1576, 1581], 256], + 64519: [[1576, 1582], 256], + 64520: [[1576, 1605], 256], + 64521: [[1576, 1609], 256], + 64522: [[1576, 1610], 256], + 64523: [[1578, 1580], 256], + 64524: [[1578, 1581], 256], + 64525: [[1578, 1582], 256], + 64526: [[1578, 1605], 256], + 64527: [[1578, 1609], 256], + 64528: [[1578, 1610], 256], + 64529: [[1579, 1580], 256], + 64530: [[1579, 1605], 256], + 64531: [[1579, 1609], 256], + 64532: [[1579, 1610], 256], + 64533: [[1580, 1581], 256], + 64534: [[1580, 1605], 256], + 64535: [[1581, 1580], 256], + 64536: [[1581, 1605], 256], + 64537: [[1582, 1580], 256], + 64538: [[1582, 1581], 256], + 64539: [[1582, 1605], 256], + 64540: [[1587, 1580], 256], + 64541: [[1587, 1581], 256], + 64542: [[1587, 1582], 256], + 64543: [[1587, 1605], 256], + 64544: [[1589, 1581], 256], + 64545: [[1589, 1605], 256], + 64546: [[1590, 1580], 256], + 64547: [[1590, 1581], 256], + 64548: [[1590, 1582], 256], + 64549: [[1590, 1605], 256], + 64550: [[1591, 1581], 256], + 64551: [[1591, 1605], 256], + 64552: [[1592, 1605], 256], + 64553: [[1593, 1580], 256], + 64554: [[1593, 1605], 256], + 64555: [[1594, 1580], 256], + 64556: [[1594, 1605], 256], + 64557: [[1601, 1580], 256], + 64558: [[1601, 1581], 256], + 64559: [[1601, 1582], 256], + 64560: [[1601, 1605], 256], + 64561: [[1601, 1609], 256], + 64562: [[1601, 1610], 256], + 64563: [[1602, 1581], 256], + 64564: [[1602, 1605], 256], + 64565: [[1602, 1609], 256], + 64566: [[1602, 1610], 256], + 64567: [[1603, 1575], 256], + 64568: [[1603, 1580], 256], + 64569: [[1603, 1581], 256], + 64570: [[1603, 1582], 256], + 64571: [[1603, 1604], 256], + 64572: [[1603, 1605], 256], + 64573: [[1603, 1609], 256], + 64574: [[1603, 1610], 256], + 64575: [[1604, 1580], 256], + 64576: [[1604, 1581], 256], + 64577: [[1604, 1582], 256], + 64578: [[1604, 1605], 256], + 64579: [[1604, 1609], 256], + 64580: [[1604, 1610], 256], + 64581: [[1605, 1580], 256], + 64582: [[1605, 1581], 256], + 64583: [[1605, 1582], 256], + 64584: [[1605, 1605], 256], + 64585: [[1605, 1609], 256], + 64586: [[1605, 1610], 256], + 64587: [[1606, 1580], 256], + 64588: [[1606, 1581], 256], + 64589: [[1606, 1582], 256], + 64590: [[1606, 1605], 256], + 64591: [[1606, 1609], 256], + 64592: [[1606, 1610], 256], + 64593: [[1607, 1580], 256], + 64594: [[1607, 1605], 256], + 64595: [[1607, 1609], 256], + 64596: [[1607, 1610], 256], + 64597: [[1610, 1580], 256], + 64598: [[1610, 1581], 256], + 64599: [[1610, 1582], 256], + 64600: [[1610, 1605], 256], + 64601: [[1610, 1609], 256], + 64602: [[1610, 1610], 256], + 64603: [[1584, 1648], 256], + 64604: [[1585, 1648], 256], + 64605: [[1609, 1648], 256], + 64606: [[32, 1612, 1617], 256], + 64607: [[32, 1613, 1617], 256], + 64608: [[32, 1614, 1617], 256], + 64609: [[32, 1615, 1617], 256], + 64610: [[32, 1616, 1617], 256], + 64611: [[32, 1617, 1648], 256], + 64612: [[1574, 1585], 256], + 64613: [[1574, 1586], 256], + 64614: [[1574, 1605], 256], + 64615: [[1574, 1606], 256], + 64616: [[1574, 1609], 256], + 64617: [[1574, 1610], 256], + 64618: [[1576, 1585], 256], + 64619: [[1576, 1586], 256], + 64620: [[1576, 1605], 256], + 64621: [[1576, 1606], 256], + 64622: [[1576, 1609], 256], + 64623: [[1576, 1610], 256], + 64624: [[1578, 1585], 256], + 64625: [[1578, 1586], 256], + 64626: [[1578, 1605], 256], + 64627: [[1578, 1606], 256], + 64628: [[1578, 1609], 256], + 64629: [[1578, 1610], 256], + 64630: [[1579, 1585], 256], + 64631: [[1579, 1586], 256], + 64632: [[1579, 1605], 256], + 64633: [[1579, 1606], 256], + 64634: [[1579, 1609], 256], + 64635: [[1579, 1610], 256], + 64636: [[1601, 1609], 256], + 64637: [[1601, 1610], 256], + 64638: [[1602, 1609], 256], + 64639: [[1602, 1610], 256], + 64640: [[1603, 1575], 256], + 64641: [[1603, 1604], 256], + 64642: [[1603, 1605], 256], + 64643: [[1603, 1609], 256], + 64644: [[1603, 1610], 256], + 64645: [[1604, 1605], 256], + 64646: [[1604, 1609], 256], + 64647: [[1604, 1610], 256], + 64648: [[1605, 1575], 256], + 64649: [[1605, 1605], 256], + 64650: [[1606, 1585], 256], + 64651: [[1606, 1586], 256], + 64652: [[1606, 1605], 256], + 64653: [[1606, 1606], 256], + 64654: [[1606, 1609], 256], + 64655: [[1606, 1610], 256], + 64656: [[1609, 1648], 256], + 64657: [[1610, 1585], 256], + 64658: [[1610, 1586], 256], + 64659: [[1610, 1605], 256], + 64660: [[1610, 1606], 256], + 64661: [[1610, 1609], 256], + 64662: [[1610, 1610], 256], + 64663: [[1574, 1580], 256], + 64664: [[1574, 1581], 256], + 64665: [[1574, 1582], 256], + 64666: [[1574, 1605], 256], + 64667: [[1574, 1607], 256], + 64668: [[1576, 1580], 256], + 64669: [[1576, 1581], 256], + 64670: [[1576, 1582], 256], + 64671: [[1576, 1605], 256], + 64672: [[1576, 1607], 256], + 64673: [[1578, 1580], 256], + 64674: [[1578, 1581], 256], + 64675: [[1578, 1582], 256], + 64676: [[1578, 1605], 256], + 64677: [[1578, 1607], 256], + 64678: [[1579, 1605], 256], + 64679: [[1580, 1581], 256], + 64680: [[1580, 1605], 256], + 64681: [[1581, 1580], 256], + 64682: [[1581, 1605], 256], + 64683: [[1582, 1580], 256], + 64684: [[1582, 1605], 256], + 64685: [[1587, 1580], 256], + 64686: [[1587, 1581], 256], + 64687: [[1587, 1582], 256], + 64688: [[1587, 1605], 256], + 64689: [[1589, 1581], 256], + 64690: [[1589, 1582], 256], + 64691: [[1589, 1605], 256], + 64692: [[1590, 1580], 256], + 64693: [[1590, 1581], 256], + 64694: [[1590, 1582], 256], + 64695: [[1590, 1605], 256], + 64696: [[1591, 1581], 256], + 64697: [[1592, 1605], 256], + 64698: [[1593, 1580], 256], + 64699: [[1593, 1605], 256], + 64700: [[1594, 1580], 256], + 64701: [[1594, 1605], 256], + 64702: [[1601, 1580], 256], + 64703: [[1601, 1581], 256], + 64704: [[1601, 1582], 256], + 64705: [[1601, 1605], 256], + 64706: [[1602, 1581], 256], + 64707: [[1602, 1605], 256], + 64708: [[1603, 1580], 256], + 64709: [[1603, 1581], 256], + 64710: [[1603, 1582], 256], + 64711: [[1603, 1604], 256], + 64712: [[1603, 1605], 256], + 64713: [[1604, 1580], 256], + 64714: [[1604, 1581], 256], + 64715: [[1604, 1582], 256], + 64716: [[1604, 1605], 256], + 64717: [[1604, 1607], 256], + 64718: [[1605, 1580], 256], + 64719: [[1605, 1581], 256], + 64720: [[1605, 1582], 256], + 64721: [[1605, 1605], 256], + 64722: [[1606, 1580], 256], + 64723: [[1606, 1581], 256], + 64724: [[1606, 1582], 256], + 64725: [[1606, 1605], 256], + 64726: [[1606, 1607], 256], + 64727: [[1607, 1580], 256], + 64728: [[1607, 1605], 256], + 64729: [[1607, 1648], 256], + 64730: [[1610, 1580], 256], + 64731: [[1610, 1581], 256], + 64732: [[1610, 1582], 256], + 64733: [[1610, 1605], 256], + 64734: [[1610, 1607], 256], + 64735: [[1574, 1605], 256], + 64736: [[1574, 1607], 256], + 64737: [[1576, 1605], 256], + 64738: [[1576, 1607], 256], + 64739: [[1578, 1605], 256], + 64740: [[1578, 1607], 256], + 64741: [[1579, 1605], 256], + 64742: [[1579, 1607], 256], + 64743: [[1587, 1605], 256], + 64744: [[1587, 1607], 256], + 64745: [[1588, 1605], 256], + 64746: [[1588, 1607], 256], + 64747: [[1603, 1604], 256], + 64748: [[1603, 1605], 256], + 64749: [[1604, 1605], 256], + 64750: [[1606, 1605], 256], + 64751: [[1606, 1607], 256], + 64752: [[1610, 1605], 256], + 64753: [[1610, 1607], 256], + 64754: [[1600, 1614, 1617], 256], + 64755: [[1600, 1615, 1617], 256], + 64756: [[1600, 1616, 1617], 256], + 64757: [[1591, 1609], 256], + 64758: [[1591, 1610], 256], + 64759: [[1593, 1609], 256], + 64760: [[1593, 1610], 256], + 64761: [[1594, 1609], 256], + 64762: [[1594, 1610], 256], + 64763: [[1587, 1609], 256], + 64764: [[1587, 1610], 256], + 64765: [[1588, 1609], 256], + 64766: [[1588, 1610], 256], + 64767: [[1581, 1609], 256] + }, + 64768: { + 64768: [[1581, 1610], 256], + 64769: [[1580, 1609], 256], + 64770: [[1580, 1610], 256], + 64771: [[1582, 1609], 256], + 64772: [[1582, 1610], 256], + 64773: [[1589, 1609], 256], + 64774: [[1589, 1610], 256], + 64775: [[1590, 1609], 256], + 64776: [[1590, 1610], 256], + 64777: [[1588, 1580], 256], + 64778: [[1588, 1581], 256], + 64779: [[1588, 1582], 256], + 64780: [[1588, 1605], 256], + 64781: [[1588, 1585], 256], + 64782: [[1587, 1585], 256], + 64783: [[1589, 1585], 256], + 64784: [[1590, 1585], 256], + 64785: [[1591, 1609], 256], + 64786: [[1591, 1610], 256], + 64787: [[1593, 1609], 256], + 64788: [[1593, 1610], 256], + 64789: [[1594, 1609], 256], + 64790: [[1594, 1610], 256], + 64791: [[1587, 1609], 256], + 64792: [[1587, 1610], 256], + 64793: [[1588, 1609], 256], + 64794: [[1588, 1610], 256], + 64795: [[1581, 1609], 256], + 64796: [[1581, 1610], 256], + 64797: [[1580, 1609], 256], + 64798: [[1580, 1610], 256], + 64799: [[1582, 1609], 256], + 64800: [[1582, 1610], 256], + 64801: [[1589, 1609], 256], + 64802: [[1589, 1610], 256], + 64803: [[1590, 1609], 256], + 64804: [[1590, 1610], 256], + 64805: [[1588, 1580], 256], + 64806: [[1588, 1581], 256], + 64807: [[1588, 1582], 256], + 64808: [[1588, 1605], 256], + 64809: [[1588, 1585], 256], + 64810: [[1587, 1585], 256], + 64811: [[1589, 1585], 256], + 64812: [[1590, 1585], 256], + 64813: [[1588, 1580], 256], + 64814: [[1588, 1581], 256], + 64815: [[1588, 1582], 256], + 64816: [[1588, 1605], 256], + 64817: [[1587, 1607], 256], + 64818: [[1588, 1607], 256], + 64819: [[1591, 1605], 256], + 64820: [[1587, 1580], 256], + 64821: [[1587, 1581], 256], + 64822: [[1587, 1582], 256], + 64823: [[1588, 1580], 256], + 64824: [[1588, 1581], 256], + 64825: [[1588, 1582], 256], + 64826: [[1591, 1605], 256], + 64827: [[1592, 1605], 256], + 64828: [[1575, 1611], 256], + 64829: [[1575, 1611], 256], + 64848: [[1578, 1580, 1605], 256], + 64849: [[1578, 1581, 1580], 256], + 64850: [[1578, 1581, 1580], 256], + 64851: [[1578, 1581, 1605], 256], + 64852: [[1578, 1582, 1605], 256], + 64853: [[1578, 1605, 1580], 256], + 64854: [[1578, 1605, 1581], 256], + 64855: [[1578, 1605, 1582], 256], + 64856: [[1580, 1605, 1581], 256], + 64857: [[1580, 1605, 1581], 256], + 64858: [[1581, 1605, 1610], 256], + 64859: [[1581, 1605, 1609], 256], + 64860: [[1587, 1581, 1580], 256], + 64861: [[1587, 1580, 1581], 256], + 64862: [[1587, 1580, 1609], 256], + 64863: [[1587, 1605, 1581], 256], + 64864: [[1587, 1605, 1581], 256], + 64865: [[1587, 1605, 1580], 256], + 64866: [[1587, 1605, 1605], 256], + 64867: [[1587, 1605, 1605], 256], + 64868: [[1589, 1581, 1581], 256], + 64869: [[1589, 1581, 1581], 256], + 64870: [[1589, 1605, 1605], 256], + 64871: [[1588, 1581, 1605], 256], + 64872: [[1588, 1581, 1605], 256], + 64873: [[1588, 1580, 1610], 256], + 64874: [[1588, 1605, 1582], 256], + 64875: [[1588, 1605, 1582], 256], + 64876: [[1588, 1605, 1605], 256], + 64877: [[1588, 1605, 1605], 256], + 64878: [[1590, 1581, 1609], 256], + 64879: [[1590, 1582, 1605], 256], + 64880: [[1590, 1582, 1605], 256], + 64881: [[1591, 1605, 1581], 256], + 64882: [[1591, 1605, 1581], 256], + 64883: [[1591, 1605, 1605], 256], + 64884: [[1591, 1605, 1610], 256], + 64885: [[1593, 1580, 1605], 256], + 64886: [[1593, 1605, 1605], 256], + 64887: [[1593, 1605, 1605], 256], + 64888: [[1593, 1605, 1609], 256], + 64889: [[1594, 1605, 1605], 256], + 64890: [[1594, 1605, 1610], 256], + 64891: [[1594, 1605, 1609], 256], + 64892: [[1601, 1582, 1605], 256], + 64893: [[1601, 1582, 1605], 256], + 64894: [[1602, 1605, 1581], 256], + 64895: [[1602, 1605, 1605], 256], + 64896: [[1604, 1581, 1605], 256], + 64897: [[1604, 1581, 1610], 256], + 64898: [[1604, 1581, 1609], 256], + 64899: [[1604, 1580, 1580], 256], + 64900: [[1604, 1580, 1580], 256], + 64901: [[1604, 1582, 1605], 256], + 64902: [[1604, 1582, 1605], 256], + 64903: [[1604, 1605, 1581], 256], + 64904: [[1604, 1605, 1581], 256], + 64905: [[1605, 1581, 1580], 256], + 64906: [[1605, 1581, 1605], 256], + 64907: [[1605, 1581, 1610], 256], + 64908: [[1605, 1580, 1581], 256], + 64909: [[1605, 1580, 1605], 256], + 64910: [[1605, 1582, 1580], 256], + 64911: [[1605, 1582, 1605], 256], + 64914: [[1605, 1580, 1582], 256], + 64915: [[1607, 1605, 1580], 256], + 64916: [[1607, 1605, 1605], 256], + 64917: [[1606, 1581, 1605], 256], + 64918: [[1606, 1581, 1609], 256], + 64919: [[1606, 1580, 1605], 256], + 64920: [[1606, 1580, 1605], 256], + 64921: [[1606, 1580, 1609], 256], + 64922: [[1606, 1605, 1610], 256], + 64923: [[1606, 1605, 1609], 256], + 64924: [[1610, 1605, 1605], 256], + 64925: [[1610, 1605, 1605], 256], + 64926: [[1576, 1582, 1610], 256], + 64927: [[1578, 1580, 1610], 256], + 64928: [[1578, 1580, 1609], 256], + 64929: [[1578, 1582, 1610], 256], + 64930: [[1578, 1582, 1609], 256], + 64931: [[1578, 1605, 1610], 256], + 64932: [[1578, 1605, 1609], 256], + 64933: [[1580, 1605, 1610], 256], + 64934: [[1580, 1581, 1609], 256], + 64935: [[1580, 1605, 1609], 256], + 64936: [[1587, 1582, 1609], 256], + 64937: [[1589, 1581, 1610], 256], + 64938: [[1588, 1581, 1610], 256], + 64939: [[1590, 1581, 1610], 256], + 64940: [[1604, 1580, 1610], 256], + 64941: [[1604, 1605, 1610], 256], + 64942: [[1610, 1581, 1610], 256], + 64943: [[1610, 1580, 1610], 256], + 64944: [[1610, 1605, 1610], 256], + 64945: [[1605, 1605, 1610], 256], + 64946: [[1602, 1605, 1610], 256], + 64947: [[1606, 1581, 1610], 256], + 64948: [[1602, 1605, 1581], 256], + 64949: [[1604, 1581, 1605], 256], + 64950: [[1593, 1605, 1610], 256], + 64951: [[1603, 1605, 1610], 256], + 64952: [[1606, 1580, 1581], 256], + 64953: [[1605, 1582, 1610], 256], + 64954: [[1604, 1580, 1605], 256], + 64955: [[1603, 1605, 1605], 256], + 64956: [[1604, 1580, 1605], 256], + 64957: [[1606, 1580, 1581], 256], + 64958: [[1580, 1581, 1610], 256], + 64959: [[1581, 1580, 1610], 256], + 64960: [[1605, 1580, 1610], 256], + 64961: [[1601, 1605, 1610], 256], + 64962: [[1576, 1581, 1610], 256], + 64963: [[1603, 1605, 1605], 256], + 64964: [[1593, 1580, 1605], 256], + 64965: [[1589, 1605, 1605], 256], + 64966: [[1587, 1582, 1610], 256], + 64967: [[1606, 1580, 1610], 256], + 65008: [[1589, 1604, 1746], 256], + 65009: [[1602, 1604, 1746], 256], + 65010: [[1575, 1604, 1604, 1607], 256], + 65011: [[1575, 1603, 1576, 1585], 256], + 65012: [[1605, 1581, 1605, 1583], 256], + 65013: [[1589, 1604, 1593, 1605], 256], + 65014: [[1585, 1587, 1608, 1604], 256], + 65015: [[1593, 1604, 1610, 1607], 256], + 65016: [[1608, 1587, 1604, 1605], 256], + 65017: [[1589, 1604, 1609], 256], + 65018: [ + [ + 1589, + 1604, + 1609, + 32, + 1575, + 1604, + 1604, + 1607, + 32, + 1593, + 1604, + 1610, + 1607, + 32, + 1608, + 1587, + 1604, + 1605 + ], + 256 + ], + 65019: [[1580, 1604, 32, 1580, 1604, 1575, 1604, 1607], 256], + 65020: [[1585, 1740, 1575, 1604], 256] + }, + 65024: { + 65040: [[44], 256], + 65041: [[12289], 256], + 65042: [[12290], 256], + 65043: [[58], 256], + 65044: [[59], 256], + 65045: [[33], 256], + 65046: [[63], 256], + 65047: [[12310], 256], + 65048: [[12311], 256], + 65049: [[8230], 256], + 65056: [, 230], + 65057: [, 230], + 65058: [, 230], + 65059: [, 230], + 65060: [, 230], + 65061: [, 230], + 65062: [, 230], + 65072: [[8229], 256], + 65073: [[8212], 256], + 65074: [[8211], 256], + 65075: [[95], 256], + 65076: [[95], 256], + 65077: [[40], 256], + 65078: [[41], 256], + 65079: [[123], 256], + 65080: [[125], 256], + 65081: [[12308], 256], + 65082: [[12309], 256], + 65083: [[12304], 256], + 65084: [[12305], 256], + 65085: [[12298], 256], + 65086: [[12299], 256], + 65087: [[12296], 256], + 65088: [[12297], 256], + 65089: [[12300], 256], + 65090: [[12301], 256], + 65091: [[12302], 256], + 65092: [[12303], 256], + 65095: [[91], 256], + 65096: [[93], 256], + 65097: [[8254], 256], + 65098: [[8254], 256], + 65099: [[8254], 256], + 65100: [[8254], 256], + 65101: [[95], 256], + 65102: [[95], 256], + 65103: [[95], 256], + 65104: [[44], 256], + 65105: [[12289], 256], + 65106: [[46], 256], + 65108: [[59], 256], + 65109: [[58], 256], + 65110: [[63], 256], + 65111: [[33], 256], + 65112: [[8212], 256], + 65113: [[40], 256], + 65114: [[41], 256], + 65115: [[123], 256], + 65116: [[125], 256], + 65117: [[12308], 256], + 65118: [[12309], 256], + 65119: [[35], 256], + 65120: [[38], 256], + 65121: [[42], 256], + 65122: [[43], 256], + 65123: [[45], 256], + 65124: [[60], 256], + 65125: [[62], 256], + 65126: [[61], 256], + 65128: [[92], 256], + 65129: [[36], 256], + 65130: [[37], 256], + 65131: [[64], 256], + 65136: [[32, 1611], 256], + 65137: [[1600, 1611], 256], + 65138: [[32, 1612], 256], + 65140: [[32, 1613], 256], + 65142: [[32, 1614], 256], + 65143: [[1600, 1614], 256], + 65144: [[32, 1615], 256], + 65145: [[1600, 1615], 256], + 65146: [[32, 1616], 256], + 65147: [[1600, 1616], 256], + 65148: [[32, 1617], 256], + 65149: [[1600, 1617], 256], + 65150: [[32, 1618], 256], + 65151: [[1600, 1618], 256], + 65152: [[1569], 256], + 65153: [[1570], 256], + 65154: [[1570], 256], + 65155: [[1571], 256], + 65156: [[1571], 256], + 65157: [[1572], 256], + 65158: [[1572], 256], + 65159: [[1573], 256], + 65160: [[1573], 256], + 65161: [[1574], 256], + 65162: [[1574], 256], + 65163: [[1574], 256], + 65164: [[1574], 256], + 65165: [[1575], 256], + 65166: [[1575], 256], + 65167: [[1576], 256], + 65168: [[1576], 256], + 65169: [[1576], 256], + 65170: [[1576], 256], + 65171: [[1577], 256], + 65172: [[1577], 256], + 65173: [[1578], 256], + 65174: [[1578], 256], + 65175: [[1578], 256], + 65176: [[1578], 256], + 65177: [[1579], 256], + 65178: [[1579], 256], + 65179: [[1579], 256], + 65180: [[1579], 256], + 65181: [[1580], 256], + 65182: [[1580], 256], + 65183: [[1580], 256], + 65184: [[1580], 256], + 65185: [[1581], 256], + 65186: [[1581], 256], + 65187: [[1581], 256], + 65188: [[1581], 256], + 65189: [[1582], 256], + 65190: [[1582], 256], + 65191: [[1582], 256], + 65192: [[1582], 256], + 65193: [[1583], 256], + 65194: [[1583], 256], + 65195: [[1584], 256], + 65196: [[1584], 256], + 65197: [[1585], 256], + 65198: [[1585], 256], + 65199: [[1586], 256], + 65200: [[1586], 256], + 65201: [[1587], 256], + 65202: [[1587], 256], + 65203: [[1587], 256], + 65204: [[1587], 256], + 65205: [[1588], 256], + 65206: [[1588], 256], + 65207: [[1588], 256], + 65208: [[1588], 256], + 65209: [[1589], 256], + 65210: [[1589], 256], + 65211: [[1589], 256], + 65212: [[1589], 256], + 65213: [[1590], 256], + 65214: [[1590], 256], + 65215: [[1590], 256], + 65216: [[1590], 256], + 65217: [[1591], 256], + 65218: [[1591], 256], + 65219: [[1591], 256], + 65220: [[1591], 256], + 65221: [[1592], 256], + 65222: [[1592], 256], + 65223: [[1592], 256], + 65224: [[1592], 256], + 65225: [[1593], 256], + 65226: [[1593], 256], + 65227: [[1593], 256], + 65228: [[1593], 256], + 65229: [[1594], 256], + 65230: [[1594], 256], + 65231: [[1594], 256], + 65232: [[1594], 256], + 65233: [[1601], 256], + 65234: [[1601], 256], + 65235: [[1601], 256], + 65236: [[1601], 256], + 65237: [[1602], 256], + 65238: [[1602], 256], + 65239: [[1602], 256], + 65240: [[1602], 256], + 65241: [[1603], 256], + 65242: [[1603], 256], + 65243: [[1603], 256], + 65244: [[1603], 256], + 65245: [[1604], 256], + 65246: [[1604], 256], + 65247: [[1604], 256], + 65248: [[1604], 256], + 65249: [[1605], 256], + 65250: [[1605], 256], + 65251: [[1605], 256], + 65252: [[1605], 256], + 65253: [[1606], 256], + 65254: [[1606], 256], + 65255: [[1606], 256], + 65256: [[1606], 256], + 65257: [[1607], 256], + 65258: [[1607], 256], + 65259: [[1607], 256], + 65260: [[1607], 256], + 65261: [[1608], 256], + 65262: [[1608], 256], + 65263: [[1609], 256], + 65264: [[1609], 256], + 65265: [[1610], 256], + 65266: [[1610], 256], + 65267: [[1610], 256], + 65268: [[1610], 256], + 65269: [[1604, 1570], 256], + 65270: [[1604, 1570], 256], + 65271: [[1604, 1571], 256], + 65272: [[1604, 1571], 256], + 65273: [[1604, 1573], 256], + 65274: [[1604, 1573], 256], + 65275: [[1604, 1575], 256], + 65276: [[1604, 1575], 256] + }, + 65280: { + 65281: [[33], 256], + 65282: [[34], 256], + 65283: [[35], 256], + 65284: [[36], 256], + 65285: [[37], 256], + 65286: [[38], 256], + 65287: [[39], 256], + 65288: [[40], 256], + 65289: [[41], 256], + 65290: [[42], 256], + 65291: [[43], 256], + 65292: [[44], 256], + 65293: [[45], 256], + 65294: [[46], 256], + 65295: [[47], 256], + 65296: [[48], 256], + 65297: [[49], 256], + 65298: [[50], 256], + 65299: [[51], 256], + 65300: [[52], 256], + 65301: [[53], 256], + 65302: [[54], 256], + 65303: [[55], 256], + 65304: [[56], 256], + 65305: [[57], 256], + 65306: [[58], 256], + 65307: [[59], 256], + 65308: [[60], 256], + 65309: [[61], 256], + 65310: [[62], 256], + 65311: [[63], 256], + 65312: [[64], 256], + 65313: [[65], 256], + 65314: [[66], 256], + 65315: [[67], 256], + 65316: [[68], 256], + 65317: [[69], 256], + 65318: [[70], 256], + 65319: [[71], 256], + 65320: [[72], 256], + 65321: [[73], 256], + 65322: [[74], 256], + 65323: [[75], 256], + 65324: [[76], 256], + 65325: [[77], 256], + 65326: [[78], 256], + 65327: [[79], 256], + 65328: [[80], 256], + 65329: [[81], 256], + 65330: [[82], 256], + 65331: [[83], 256], + 65332: [[84], 256], + 65333: [[85], 256], + 65334: [[86], 256], + 65335: [[87], 256], + 65336: [[88], 256], + 65337: [[89], 256], + 65338: [[90], 256], + 65339: [[91], 256], + 65340: [[92], 256], + 65341: [[93], 256], + 65342: [[94], 256], + 65343: [[95], 256], + 65344: [[96], 256], + 65345: [[97], 256], + 65346: [[98], 256], + 65347: [[99], 256], + 65348: [[100], 256], + 65349: [[101], 256], + 65350: [[102], 256], + 65351: [[103], 256], + 65352: [[104], 256], + 65353: [[105], 256], + 65354: [[106], 256], + 65355: [[107], 256], + 65356: [[108], 256], + 65357: [[109], 256], + 65358: [[110], 256], + 65359: [[111], 256], + 65360: [[112], 256], + 65361: [[113], 256], + 65362: [[114], 256], + 65363: [[115], 256], + 65364: [[116], 256], + 65365: [[117], 256], + 65366: [[118], 256], + 65367: [[119], 256], + 65368: [[120], 256], + 65369: [[121], 256], + 65370: [[122], 256], + 65371: [[123], 256], + 65372: [[124], 256], + 65373: [[125], 256], + 65374: [[126], 256], + 65375: [[10629], 256], + 65376: [[10630], 256], + 65377: [[12290], 256], + 65378: [[12300], 256], + 65379: [[12301], 256], + 65380: [[12289], 256], + 65381: [[12539], 256], + 65382: [[12530], 256], + 65383: [[12449], 256], + 65384: [[12451], 256], + 65385: [[12453], 256], + 65386: [[12455], 256], + 65387: [[12457], 256], + 65388: [[12515], 256], + 65389: [[12517], 256], + 65390: [[12519], 256], + 65391: [[12483], 256], + 65392: [[12540], 256], + 65393: [[12450], 256], + 65394: [[12452], 256], + 65395: [[12454], 256], + 65396: [[12456], 256], + 65397: [[12458], 256], + 65398: [[12459], 256], + 65399: [[12461], 256], + 65400: [[12463], 256], + 65401: [[12465], 256], + 65402: [[12467], 256], + 65403: [[12469], 256], + 65404: [[12471], 256], + 65405: [[12473], 256], + 65406: [[12475], 256], + 65407: [[12477], 256], + 65408: [[12479], 256], + 65409: [[12481], 256], + 65410: [[12484], 256], + 65411: [[12486], 256], + 65412: [[12488], 256], + 65413: [[12490], 256], + 65414: [[12491], 256], + 65415: [[12492], 256], + 65416: [[12493], 256], + 65417: [[12494], 256], + 65418: [[12495], 256], + 65419: [[12498], 256], + 65420: [[12501], 256], + 65421: [[12504], 256], + 65422: [[12507], 256], + 65423: [[12510], 256], + 65424: [[12511], 256], + 65425: [[12512], 256], + 65426: [[12513], 256], + 65427: [[12514], 256], + 65428: [[12516], 256], + 65429: [[12518], 256], + 65430: [[12520], 256], + 65431: [[12521], 256], + 65432: [[12522], 256], + 65433: [[12523], 256], + 65434: [[12524], 256], + 65435: [[12525], 256], + 65436: [[12527], 256], + 65437: [[12531], 256], + 65438: [[12441], 256], + 65439: [[12442], 256], + 65440: [[12644], 256], + 65441: [[12593], 256], + 65442: [[12594], 256], + 65443: [[12595], 256], + 65444: [[12596], 256], + 65445: [[12597], 256], + 65446: [[12598], 256], + 65447: [[12599], 256], + 65448: [[12600], 256], + 65449: [[12601], 256], + 65450: [[12602], 256], + 65451: [[12603], 256], + 65452: [[12604], 256], + 65453: [[12605], 256], + 65454: [[12606], 256], + 65455: [[12607], 256], + 65456: [[12608], 256], + 65457: [[12609], 256], + 65458: [[12610], 256], + 65459: [[12611], 256], + 65460: [[12612], 256], + 65461: [[12613], 256], + 65462: [[12614], 256], + 65463: [[12615], 256], + 65464: [[12616], 256], + 65465: [[12617], 256], + 65466: [[12618], 256], + 65467: [[12619], 256], + 65468: [[12620], 256], + 65469: [[12621], 256], + 65470: [[12622], 256], + 65474: [[12623], 256], + 65475: [[12624], 256], + 65476: [[12625], 256], + 65477: [[12626], 256], + 65478: [[12627], 256], + 65479: [[12628], 256], + 65482: [[12629], 256], + 65483: [[12630], 256], + 65484: [[12631], 256], + 65485: [[12632], 256], + 65486: [[12633], 256], + 65487: [[12634], 256], + 65490: [[12635], 256], + 65491: [[12636], 256], + 65492: [[12637], 256], + 65493: [[12638], 256], + 65494: [[12639], 256], + 65495: [[12640], 256], + 65498: [[12641], 256], + 65499: [[12642], 256], + 65500: [[12643], 256], + 65504: [[162], 256], + 65505: [[163], 256], + 65506: [[172], 256], + 65507: [[175], 256], + 65508: [[166], 256], + 65509: [[165], 256], + 65510: [[8361], 256], + 65512: [[9474], 256], + 65513: [[8592], 256], + 65514: [[8593], 256], + 65515: [[8594], 256], + 65516: [[8595], 256], + 65517: [[9632], 256], + 65518: [[9675], 256] + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/implement.js new file mode 100644 index 00000000..ad11739e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "normalize", + { value: require("./shim"), +configurable: true, +enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/index.js new file mode 100644 index 00000000..7e91b08b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype.normalize + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/is-implemented.js new file mode 100644 index 00000000..01b48a9d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "æøåäüö"; + +module.exports = function () { + if (typeof str.normalize !== "function") return false; + return str.normalize("NFKD") === "æøåäüö"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/shim.js new file mode 100644 index 00000000..aba37f55 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/normalize/shim.js @@ -0,0 +1,317 @@ +/* eslint no-bitwise: "off", max-statements: "off", max-lines: "off" */ + +// Taken from: https://github.com/walling/unorm/blob/master/lib/unorm.js + +/* + * UnicodeNormalizer 1.0.0 + * Copyright (c) 2008 Matsuza + * Dual licensed under the MIT (MIT-LICENSE.txt) and + * GPL (GPL-LICENSE.txt) licenses. + * $Date: 2008-06-05 16:44:17 +0200 (Thu, 05 Jun 2008) $ + * $Rev: 13309 $ +*/ + +"use strict"; + +var primitiveSet = require("../../../object/primitive-set") + , validValue = require("../../../object/valid-value") + , data = require("./_data"); + +var floor = Math.floor + , forms = primitiveSet("NFC", "NFD", "NFKC", "NFKD") + , DEFAULT_FEATURE = [null, 0, {}] + , CACHE_THRESHOLD = 10 + , SBase = 0xac00 + , LBase = 0x1100 + , VBase = 0x1161 + , TBase = 0x11a7 + , LCount = 19 + , VCount = 21 + , TCount = 28 + , NCount = VCount * TCount + , SCount = LCount * NCount + , UChar + , cache = {} + , cacheCounter = [] + , fromCache + , fromData + , fromCpOnly + , fromRuleBasedJamo + , fromCpFilter + , strategies + , UCharIterator + , RecursDecompIterator + , DecompIterator + , CompIterator + , createIterator + , normalize; + +UChar = function (cp, feature) { + this.codepoint = cp; + this.feature = feature; +}; + +// Strategies +(function () { + for (var i = 0; i <= 0xff; ++i) cacheCounter[i] = 0; +}()); + +fromCache = function (nextStep, cp, needFeature) { + var ret = cache[cp]; + if (!ret) { + ret = nextStep(cp, needFeature); + if (Boolean(ret.feature) && ++cacheCounter[(cp >> 8) & 0xff] > CACHE_THRESHOLD) { + cache[cp] = ret; + } + } + return ret; +}; + +fromData = function (next, cp) { + var hash = cp & 0xff00, dunit = UChar.udata[hash] || {}, feature = dunit[cp]; + return feature ? new UChar(cp, feature) : new UChar(cp, DEFAULT_FEATURE); +}; +fromCpOnly = function (next, cp, needFeature) { + return needFeature ? next(cp, needFeature) : new UChar(cp, null); +}; + +fromRuleBasedJamo = function (next, cp, needFeature) { + var char, base, i, arr, SIndex, TIndex, feature, j; + if (cp < LBase || (LBase + LCount <= cp && cp < SBase) || SBase + SCount < cp) { + return next(cp, needFeature); + } + if (LBase <= cp && cp < LBase + LCount) { + char = {}; + base = (cp - LBase) * VCount; + for (i = 0; i < VCount; ++i) { + char[VBase + i] = SBase + TCount * (i + base); + } + arr = new Array(3); + arr[2] = char; + return new UChar(cp, arr); + } + + SIndex = cp - SBase; + TIndex = SIndex % TCount; + feature = []; + if (TIndex === 0) { + feature[0] = [LBase + floor(SIndex / NCount), VBase + floor(SIndex % NCount / TCount)]; + feature[2] = {}; + for (j = 1; j < TCount; ++j) { + feature[2][TBase + j] = cp + j; + } + } else { + feature[0] = [SBase + SIndex - TIndex, TBase + TIndex]; + } + return new UChar(cp, feature); +}; + +fromCpFilter = function (next, cp, needFeature) { + return cp < 60 || (cp > 13311 && cp < 42607) + ? new UChar(cp, DEFAULT_FEATURE) + : next(cp, needFeature); +}; + +strategies = [fromCpFilter, fromCache, fromCpOnly, fromRuleBasedJamo, fromData]; + +UChar.fromCharCode = strategies.reduceRight(function (next, strategy) { + return function (cp, needFeature) { + return strategy(next, cp, needFeature); + }; +}, null); + +UChar.isHighSurrogate = function (cp) { + return cp >= 0xd800 && cp <= 0xdbff; +}; +UChar.isLowSurrogate = function (cp) { + return cp >= 0xdc00 && cp <= 0xdfff; +}; + +UChar.prototype.prepFeature = function () { + if (!this.feature) { + this.feature = UChar.fromCharCode(this.codepoint, true).feature; + } +}; + +UChar.prototype.toString = function () { + var num; + if (this.codepoint < 0x10000) return String.fromCharCode(this.codepoint); + num = this.codepoint - 0x10000; + return String.fromCharCode(floor(num / 0x400) + 0xd800, num % 0x400 + 0xdc00); +}; + +UChar.prototype.getDecomp = function () { + this.prepFeature(); + return this.feature[0] || null; +}; + +UChar.prototype.isCompatibility = function () { + this.prepFeature(); + return Boolean(this.feature[1]) && this.feature[1] & (1 << 8); +}; +UChar.prototype.isExclude = function () { + this.prepFeature(); + return Boolean(this.feature[1]) && this.feature[1] & (1 << 9); +}; +UChar.prototype.getCanonicalClass = function () { + this.prepFeature(); + return this.feature[1] ? this.feature[1] & 0xff : 0; +}; +UChar.prototype.getComposite = function (following) { + var cp; + this.prepFeature(); + if (!this.feature[2]) return null; + cp = this.feature[2][following.codepoint]; + return cp ? UChar.fromCharCode(cp) : null; +}; + +UCharIterator = function (str) { + this.str = str; + this.cursor = 0; +}; +UCharIterator.prototype.next = function () { + if (Boolean(this.str) && this.cursor < this.str.length) { + var cp = this.str.charCodeAt(this.cursor++), d; + if ( + UChar.isHighSurrogate(cp) && + this.cursor < this.str.length && + UChar.isLowSurrogate(d = this.str.charCodeAt(this.cursor)) + ) { + cp = (cp - 0xd800) * 0x400 + (d - 0xdc00) + 0x10000; + ++this.cursor; + } + return UChar.fromCharCode(cp); + } + this.str = null; + return null; +}; + +RecursDecompIterator = function (it, cano) { + this.it = it; + this.canonical = cano; + this.resBuf = []; +}; + +RecursDecompIterator.prototype.next = function () { + var recursiveDecomp, uchar; + recursiveDecomp = function (cano, ucharLoc) { + var decomp = ucharLoc.getDecomp(), ret, i, a, j; + if (Boolean(decomp) && !(cano && ucharLoc.isCompatibility())) { + ret = []; + for (i = 0; i < decomp.length; ++i) { + a = recursiveDecomp(cano, UChar.fromCharCode(decomp[i])); + // Ret.concat(a); //<-why does not this work? + // following block is a workaround. + for (j = 0; j < a.length; ++j) ret.push(a[j]); + } + return ret; + } + return [ucharLoc]; + }; + if (this.resBuf.length === 0) { + uchar = this.it.next(); + if (!uchar) return null; + this.resBuf = recursiveDecomp(this.canonical, uchar); + } + return this.resBuf.shift(); +}; + +DecompIterator = function (it) { + this.it = it; + this.resBuf = []; +}; + +DecompIterator.prototype.next = function () { + var cc, uchar, inspt, uchar2, cc2; + if (this.resBuf.length === 0) { + do { + uchar = this.it.next(); + if (!uchar) break; + cc = uchar.getCanonicalClass(); + inspt = this.resBuf.length; + if (cc !== 0) { + for (inspt; inspt > 0; --inspt) { + uchar2 = this.resBuf[inspt - 1]; + cc2 = uchar2.getCanonicalClass(); + // eslint-disable-next-line max-depth + if (cc2 <= cc) break; + } + } + this.resBuf.splice(inspt, 0, uchar); + } while (cc !== 0); + } + return this.resBuf.shift(); +}; + +CompIterator = function (it) { + this.it = it; + this.procBuf = []; + this.resBuf = []; + this.lastClass = null; +}; + +CompIterator.prototype.next = function () { + var uchar, starter, composite, cc; + while (this.resBuf.length === 0) { + uchar = this.it.next(); + if (!uchar) { + this.resBuf = this.procBuf; + this.procBuf = []; + break; + } + if (this.procBuf.length === 0) { + this.lastClass = uchar.getCanonicalClass(); + this.procBuf.push(uchar); + } else { + starter = this.procBuf[0]; + composite = starter.getComposite(uchar); + cc = uchar.getCanonicalClass(); + if (Boolean(composite) && (this.lastClass < cc || this.lastClass === 0)) { + this.procBuf[0] = composite; + } else { + if (cc === 0) { + this.resBuf = this.procBuf; + this.procBuf = []; + } + this.lastClass = cc; + this.procBuf.push(uchar); + } + } + } + return this.resBuf.shift(); +}; + +createIterator = function (mode, str) { + switch (mode) { + case "NFD": + return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true)); + case "NFKD": + return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false)); + case "NFC": + return new CompIterator( + new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true)) + ); + case "NFKC": + return new CompIterator( + new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false)) + ); + default: + throw new Error(mode + " is invalid"); + } +}; +normalize = function (mode, str) { + var it = createIterator(mode, str), ret = "", uchar; + while ((uchar = it.next())) ret += uchar.toString(); + return ret; +}; + +/* Unicode data */ +UChar.udata = data; + +module.exports = function (/* Form*/) { + var str = String(validValue(this)), form = arguments[0]; + if (form === undefined) form = "NFC"; + else form = String(form); + if (!forms[form]) throw new RangeError("Invalid normalization form: " + form); + return normalize(form, str); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/pad.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/pad.js new file mode 100644 index 00000000..159f8951 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/pad.js @@ -0,0 +1,18 @@ +"use strict"; + +var toInteger = require("../../number/to-integer") + , value = require("../../object/valid-value") + , repeat = require("./repeat") + + , abs = Math.abs, max = Math.max; + +module.exports = function (fill/*, length*/) { + var self = String(value(this)) + , sLength = self.length + , length = arguments[1]; + + length = isNaN(length) ? 1 : toInteger(length); + fill = repeat.call(String(fill), abs(length)); + if (length >= 0) return fill.slice(0, max(0, length - sLength)) + self; + return self + ((sLength + length) >= 0 ? "" : fill.slice(length + sLength)); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/plain-replace-all.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/plain-replace-all.js new file mode 100644 index 00000000..9334fe09 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/plain-replace-all.js @@ -0,0 +1,16 @@ +"use strict"; + +var value = require("../../object/valid-value"); + +module.exports = function (search, replace) { + var index, pos = 0, str = String(value(this)), sl, rl; + search = String(search); + replace = String(replace); + sl = search.length; + rl = replace.length; + while ((index = str.indexOf(search, pos)) !== -1) { + str = str.slice(0, index) + replace + str.slice(index + sl); + pos = index + rl; + } + return str; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/plain-replace.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/plain-replace.js new file mode 100644 index 00000000..f24f5215 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/plain-replace.js @@ -0,0 +1,10 @@ +"use strict"; + +var indexOf = String.prototype.indexOf, slice = String.prototype.slice; + +module.exports = function (search, replace) { + var index = indexOf.call(this, search); + if (index === -1) return String(this); + return slice.call(this, 0, index) + replace + + slice.call(this, index + String(search).length); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/implement.js new file mode 100644 index 00000000..7066b7b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "repeat", + { value: require("./shim"), +configurable: true, +enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/index.js new file mode 100644 index 00000000..99d44b2e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype.repeat + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/is-implemented.js new file mode 100644 index 00000000..e8e02409 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/is-implemented.js @@ -0,0 +1,8 @@ +"use strict"; + +var str = "foo"; + +module.exports = function () { + if (typeof str.repeat !== "function") return false; + return str.repeat(2) === "foofoo"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/shim.js new file mode 100644 index 00000000..ac259a83 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/repeat/shim.js @@ -0,0 +1,24 @@ +// Thanks +// @rauchma http://www.2ality.com/2014/01/efficient-string-repeat.html +// @mathiasbynens https://github.com/mathiasbynens/String.prototype.repeat/blob/4a4b567def/repeat.js + +"use strict"; + +var value = require("../../../object/valid-value") + , toInteger = require("../../../number/to-integer"); + +module.exports = function (count) { + var str = String(value(this)), result; + count = toInteger(count); + if (count < 0) throw new RangeError("Count must be >= 0"); + if (!isFinite(count)) throw new RangeError("Count must be < ∞"); + + result = ""; + while (count) { + if (count % 2) result += str; + if (count > 1) str += str; + // eslint-disable-next-line no-bitwise + count >>= 1; + } + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/implement.js new file mode 100644 index 00000000..11613da2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/implement.js @@ -0,0 +1,9 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String.prototype, "startsWith", + { value: require("./shim"), +configurable: true, +enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/index.js new file mode 100644 index 00000000..9a6c3743 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.prototype.startsWith + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/is-implemented.js new file mode 100644 index 00000000..f6b6e296 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +var str = "razdwatrzy"; + +module.exports = function () { + if (typeof str.startsWith !== "function") return false; + return (str.startsWith("trzy") === false) && + (str.startsWith("raz") === true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/shim.js new file mode 100644 index 00000000..d4554779 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/starts-with/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +var value = require("../../../object/valid-value") + , toInteger = require("../../../number/to-integer") + + , max = Math.max, min = Math.min; + +module.exports = function (searchString/*, position*/) { + var start, self = String(value(this)); + start = min(max(toInteger(arguments[1]), 0), self.length); + return self.indexOf(searchString, start) === start; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/uncapitalize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/uncapitalize.js new file mode 100644 index 00000000..202dbb73 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/#/uncapitalize.js @@ -0,0 +1,8 @@ +"use strict"; + +var ensureStringifiable = require("../../object/validate-stringifiable-value"); + +module.exports = function () { + var str = ensureStringifiable(this); + return str.charAt(0).toLowerCase() + str.slice(1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/format-method.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/format-method.js new file mode 100644 index 00000000..28956fea --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/format-method.js @@ -0,0 +1,27 @@ +"use strict"; + +var isCallable = require("../object/is-callable") + , value = require("../object/valid-value") + , call = Function.prototype.call; + +module.exports = function (fmap) { + fmap = Object(value(fmap)); + return function (pattern) { + var context = this; + value(context); + pattern = String(pattern); + return pattern.replace(/%([a-zA-Z]+)|\\([\u0000-\uffff])/g, function ( + match, + token, + escapeChar + ) { + var t, result; + if (escapeChar) return escapeChar; + t = token; + while (t && !(result = fmap[t])) t = t.slice(0, -1); + if (!result) return match; + if (isCallable(result)) result = call.call(result, context); + return result + token.slice(t.length); + }); + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/implement.js new file mode 100644 index 00000000..4f815d6b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String, "fromCodePoint", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/index.js new file mode 100644 index 00000000..d5a81122 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.fromCodePoint + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/is-implemented.js new file mode 100644 index 00000000..e6ccfa7f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/is-implemented.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function () { + var fromCodePoint = String.fromCodePoint; + if (typeof fromCodePoint !== "function") return false; + return fromCodePoint(0x1D306, 0x61, 0x1D307) === "\ud834\udf06a\ud834\udf07"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/shim.js new file mode 100644 index 00000000..55824f57 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/from-code-point/shim.js @@ -0,0 +1,37 @@ +// Based on: +// http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/ +// and: +// https://github.com/mathiasbynens/String.fromCodePoint/blob/master +// /fromcodepoint.js + +"use strict"; + +var floor = Math.floor, fromCharCode = String.fromCharCode; + +// eslint-disable-next-line no-unused-vars +module.exports = function (codePoint1 /*, …codePoints*/) { + var chars = [], length = arguments.length, i, codePoint, result = ""; + for (i = 0; i < length; ++i) { + codePoint = Number(arguments[i]); + if ( + !isFinite(codePoint) || + codePoint < 0 || + codePoint > 0x10ffff || + floor(codePoint) !== codePoint + ) { + throw new RangeError("Invalid code point " + codePoint); + } + + if (codePoint < 0x10000) { + chars.push(codePoint); + } else { + codePoint -= 0x10000; + // eslint-disable-next-line no-bitwise + chars.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00); + } + if (i + 1 !== length && chars.length <= 0x4000) continue; + result += fromCharCode.apply(null, chars); + chars.length = 0; + } + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/index.js new file mode 100644 index 00000000..4393588f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/index.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = { + "#": require("./#"), + "formatMethod": require("./format-method"), + "fromCodePoint": require("./from-code-point"), + "isString": require("./is-string"), + "random": require("./random"), + "randomUniq": require("./random-uniq"), + "raw": require("./raw") +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/is-string.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/is-string.js new file mode 100644 index 00000000..1b1e8630 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/is-string.js @@ -0,0 +1,13 @@ +"use strict"; + +var objToString = Object.prototype.toString, id = objToString.call(""); + +module.exports = function (value) { + return ( + typeof value === "string" || + (value && + typeof value === "object" && + (value instanceof String || objToString.call(value) === id)) || + false + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/random-uniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/random-uniq.js new file mode 100644 index 00000000..ea10a816 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/random-uniq.js @@ -0,0 +1,13 @@ +"use strict"; + +var generated = Object.create(null), random = Math.random; + +module.exports = function () { + var str; + do { + str = random() + .toString(36) + .slice(2); + } while (generated[str]); + return str; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/random.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/random.js new file mode 100644 index 00000000..4ecec7fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/random.js @@ -0,0 +1,42 @@ +"use strict"; + +var isValue = require("../object/is-value") + , toNaturalNumber = require("../number/to-pos-integer"); + +var generated = Object.create(null), random = Math.random, uniqTryLimit = 100; + +var getChunk = function () { + return random() + .toString(36) + .slice(2); +}; + +var getString = function (/* length */) { + var str = getChunk(), length = arguments[0]; + if (!isValue(length)) return str; + while (str.length < length) str += getChunk(); + return str.slice(0, length); +}; + +module.exports = function (/* options */) { + var options = Object(arguments[0]), length = options.length, isUnique = options.isUnique; + + if (isValue(length)) length = toNaturalNumber(length); + + var str = getString(length); + if (isUnique) { + var count = 0; + while (generated[str]) { + if (++count === uniqTryLimit) { + throw new Error( + "Cannot generate random string.\n" + + "String.random is not designed to effectively generate many short and " + + "unique random strings" + ); + } + str = getString(length); + } + generated[str] = true; + } + return str; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/implement.js new file mode 100644 index 00000000..0f17df3f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +if (!require("./is-implemented")()) { + Object.defineProperty(String, "raw", { value: require("./shim"), + configurable: true, +enumerable: false, +writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/index.js new file mode 100644 index 00000000..e818dd56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = require("./is-implemented")() + ? String.raw + : require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/is-implemented.js new file mode 100644 index 00000000..8758108c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/is-implemented.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function () { + var raw = String.raw, test; + if (typeof raw !== "function") return false; + test = ["foo\nbar", "marko\n"]; + test.raw = ["foo\\nbar", "marko\\n"]; + return raw(test, "INSE\nRT") === "foo\\nbarINSE\nRTmarko\\n"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/shim.js new file mode 100644 index 00000000..8c52bb55 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/string/raw/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +var toPosInt = require("../../number/to-pos-integer") + , validValue = require("../../object/valid-value") + , reduce = Array.prototype.reduce; + +module.exports = function (callSite /*, …substitutions*/) { + var args, rawValue = Object(validValue(Object(validValue(callSite)).raw)); + if (!toPosInt(rawValue.length)) return ""; + args = arguments; + return reduce.call(rawValue, function (str1, str2, i) { + return str1 + String(args[i]) + str2; + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/.eslintrc.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/.eslintrc.json new file mode 100644 index 00000000..3ac4585b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/.eslintrc.json @@ -0,0 +1,14 @@ +{ + "globals": { + "Symbol": true + }, + "rules": { + "consistent-this": "off", + "id-length": "off", + "no-empty-function": "off", + "no-eval": "off", + "no-new-wrappers": "off", + "no-prototype-builtins": "off", + "no-shadow": "off" + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/__tad.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/__tad.js new file mode 100644 index 00000000..883c3792 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/__tad.js @@ -0,0 +1,3 @@ +"use strict"; + +exports.context = null; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/implement.js new file mode 100644 index 00000000..1a20aa82 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/@@iterator/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/shim.js new file mode 100644 index 00000000..71b71d58 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/@@iterator/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: "1", done: false }); + a.deep(iterator.next(), { value: "2", done: false }); + a.deep(iterator.next(), { value: "3", done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/_compare-by-length.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/_compare-by-length.js new file mode 100644 index 00000000..a53d8470 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/_compare-by-length.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var arr = [4, 5, 6], obj1 = { length: 8 }, obj2 = {}, obj3 = { length: 1 }; + + a.deep([arr, obj1, obj2, obj3].sort(t), [obj2, obj3, arr, obj1]); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/binary-search.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/binary-search.js new file mode 100644 index 00000000..04dfaefa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/binary-search.js @@ -0,0 +1,17 @@ +"use strict"; + +var compare = function (value) { + return this - value; +}; + +module.exports = function (t, a) { + var arr; + arr = [2, 5, 5, 8, 34, 67, 98, 345, 678]; + + // Highest, equal match + a(t.call(arr, compare.bind(1)), 0, "All higher"); + a(t.call(arr, compare.bind(679)), arr.length - 1, "All lower"); + a(t.call(arr, compare.bind(4)), 0, "Mid"); + a(t.call(arr, compare.bind(5)), 2, "Match"); + a(t.call(arr, compare.bind(6)), 2, "Above"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/clear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/clear.js new file mode 100644 index 00000000..640cc192 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/clear.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + var arr = [1, 2, {}, 4]; + a(t.call(arr), arr, "Returns same array"); + a.deep(arr, [], "Empties array"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/compact.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/compact.js new file mode 100644 index 00000000..05160844 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/compact.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + a(t.call(this).length, 3); + }, + "": function (t, a) { + var o, x, y, z; + o = {}; + x = [0, 1, "", null, o, false, undefined, true]; + y = x.slice(0); + + a.not(z = t.call(x), x, "Returns different object"); + a.deep(x, y, "Origin not changed"); + a.deep(z, [0, 1, "", o, false, true], "Result"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/implement.js new file mode 100644 index 00000000..c4dc41fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/concat/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/shim.js new file mode 100644 index 00000000..30a9b0c6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/concat/shim.js @@ -0,0 +1,26 @@ +"use strict"; + +var isConcatSpreadable = require("es6-symbol").isConcatSpreadable + , SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr = [1, 3, 45], x = {}, subArr, subArr2, result; + + a.deep(t.call(arr, "2d", x, ["ere", "fe", x], false, null), + [1, 3, 45, "2d", x, "ere", "fe", x, false, null], "Plain array"); + + subArr = new SubArray("lol", "miszko"); + subArr2 = new SubArray("elo", "fol"); + + result = t.call(subArr, "df", arr, "fef", subArr2, null); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, ["lol", "miszko", "df", 1, 3, 45, "fef", "elo", "fol", null], + "Spreable by default"); + + SubArray.prototype[isConcatSpreadable] = false; + + result = t.call(subArr, "df", arr, "fef", subArr2, null); + a.deep(result, [subArr, "df", 1, 3, 45, "fef", subArr2, null], "Non spreadable"); + + delete SubArray.prototype[isConcatSpreadable]; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/contains.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/contains.js new file mode 100644 index 00000000..fb0f96ce --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/contains.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + a(t.call(this, this[1]), true, "Contains"); + a(t.call(this, {}), false, "Does Not contain"); + }, + "": function (t, a) { + var o, x = {}, y = {}; + + o = [1, "raz", x]; + + a(t.call(o, 1), true, "First"); + a(t.call(o, "1"), false, "Type coercion"); + a(t.call(o, "raz"), true, "Primitive"); + a(t.call(o, "foo"), false, "Primitive not found"); + a(t.call(o, x), true, "Object found"); + a(t.call(o, y), false, "Object not found"); + a(t.call(o, 1, 1), false, "Position"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/implement.js new file mode 100644 index 00000000..87272ac0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/copy-within/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/shim.js new file mode 100644 index 00000000..03a631fe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/copy-within/shim.js @@ -0,0 +1,29 @@ +"use strict"; + +module.exports = function (t, a) { + var args, x; + + a.h1("2 args"); + x = [1, 2, 3, 4, 5]; + t.call(x, 0, 3); + a.deep(x, [4, 5, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 2), [1, 3, 4, 5, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 2, 2), [1, 2, 3, 4, 5]); + + a.h1("3 args"); + a.deep(t.call([1, 2, 3, 4, 5], 0, 3, 4), [4, 2, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 3, 4), [1, 4, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 2, 4), [1, 3, 4, 4, 5]); + + a.h1("Negative args"); + a.deep(t.call([1, 2, 3, 4, 5], 0, -2), [4, 5, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 0, -2, -1), [4, 2, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -2), [1, 3, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -1), [1, 3, 4, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3), [1, 3, 4, 5, 5]); + + a.h1("Array-likes"); + args = { 0: 1, 1: 2, 2: 3, length: 3 }; + a.deep(t.call(args, -2, 0), { 0: 1, 1: 1, 2: 2, length: 3 }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/diff.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/diff.js new file mode 100644 index 00000000..397c5ddf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/diff.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + a.deep(t.call(this, this), []); + }, + "": function (t, a) { + var x = {}, y = {}; + + a.deep(t.call([1, "raz", x, 2, "trzy", y], [x, 2, "trzy"]), [1, "raz", y], + "Scope longer"); + a.deep(t.call([1, "raz", x], [x, 2, "trzy", 1, y]), ["raz"], + "Arg longer"); + a.deep(t.call([1, "raz", x], []), [1, "raz", x], "Empty arg"); + a.deep(t.call([], [1, y, "sdfs"]), [], "Empty scope"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/e-index-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/e-index-of.js new file mode 100644 index 00000000..1e42cbd7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/e-index-of.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([3, "raz", {}, x, {}], x), 3, "Regular"); + a(t.call([3, "raz", NaN, {}, NaN], NaN), 2, "NaN"); + a(t.call([3, "raz", 0, {}, -0], -0), 2, "-0"); + a(t.call([3, "raz", -0, {}, 0], +0), 2, "+0"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 4, "fromIndex"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, -1), 4, "fromIndex negative #1"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, -2), 4, "fromIndex negative #2"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, -3), 2, "fromIndex negative #3"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/e-last-index-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/e-last-index-of.js new file mode 100644 index 00000000..2c7fff9f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/e-last-index-of.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([3, "raz", {}, x, {}, x], x), 5, "Regular"); + a(t.call([3, "raz", NaN, {}, x], NaN), 2, "NaN"); + a(t.call([3, "raz", 0, {}, -0], -0), 4, "-0"); + a(t.call([3, "raz", -0, {}, 0], +0), 4, "+0"); + a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 2, "fromIndex"); + a(t.call([3, "raz", NaN, 2, NaN], NaN, -1), 4, "Negative fromIndex #1"); + a(t.call([3, "raz", NaN, 2, NaN], NaN, -2), 2, "Negative fromIndex #2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/implement.js new file mode 100644 index 00000000..fa16930c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/entries/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/shim.js new file mode 100644 index 00000000..87ac25a9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/entries/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: [0, "1"], done: false }); + a.deep(iterator.next(), { value: [1, "2"], done: false }); + a.deep(iterator.next(), { value: [2, "3"], done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/exclusion.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/exclusion.js new file mode 100644 index 00000000..827c037a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/exclusion.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var x = {}; + a.deep(t.call(this, this, [this[0], this[2], x]), [x]); + }, + "": function (t, a) { + var x = {}, y = {}; + + a.deep(t.call([x, y]), [x, y], "No arguments"); + a.deep(t.call([x, 1], [], []), [x, 1], "Empty arguments"); + a.deep(t.call([1, "raz", x], [2, "raz", y], [2, "raz", x]), [1, y]); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/implement.js new file mode 100644 index 00000000..fe806a6b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/fill/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/shim.js new file mode 100644 index 00000000..c752e10b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/fill/shim.js @@ -0,0 +1,18 @@ +// Taken from https://github.com/paulmillr/es6-shim/blob/master/test/array.js + +"use strict"; + +module.exports = function (t, a) { + var x; + + x = [1, 2, 3, 4, 5, 6]; + a(t.call(x, -1), x, "Returns self object"); + a.deep(x, [-1, -1, -1, -1, -1, -1], "Value"); + + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 3), [1, 2, 3, -1, -1, -1], + "Positive start"); + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, -3), [1, 2, 3, -1, -1, -1], + "Negative start"); + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 9), [1, 2, 3, 4, 5, 6], + "Large start"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/implement.js new file mode 100644 index 00000000..cac92c83 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/filter/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/shim.js new file mode 100644 index 00000000..e20a6511 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/filter/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, Boolean), ["foo", "2d", x], "Plain array"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, Boolean); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, ["foo", "2d", x], "Result of subclass"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/implement.js new file mode 100644 index 00000000..341bedef --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/find-index/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/shim.js new file mode 100644 index 00000000..0a6fe113 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find-index/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +exports.__generic = function (t, a) { + var count = 0, o = {}, self = Object(this); + a(t.call(self, function (value, i, scope) { + a(value, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + }, self), -1, "Falsy result"); + a(count, 3); + + count = -1; + a(t.call(this, function () { + return ++count ? o : null; + }, this), 1, "Truthy result"); + a(count, 1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/implement.js new file mode 100644 index 00000000..9333b25f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/find/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/shim.js new file mode 100644 index 00000000..b8fd9f06 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/find/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +exports.__generic = function (t, a) { + var count = 0, o = {}, self = Object(this); + a(t.call(self, function (value, i, scope) { + a(value, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + }, self), undefined, "Falsy result"); + a(count, 3); + + count = -1; + a(t.call(this, function () { + return ++count ? o : null; + }, this), this[1], "Truthy result"); + a(count, 1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/first-index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/first-index.js new file mode 100644 index 00000000..af3388b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/first-index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a(t.call([]), null, "Empty"); + a(t.call([null]), 0, "One value"); + a(t.call([1, 2, 3]), 0, "Many values"); + a(t.call(new Array(1000)), null, "Sparse empty"); + x = []; + x[883] = undefined; + x[890] = null; + a(t.call(x), 883, "Manual sparse, distant value"); + x = new Array(1000); + x[657] = undefined; + x[700] = null; + a(t.call(x), 657, "Sparse, distant value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/first.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/first.js new file mode 100644 index 00000000..5e9c1ae8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/first.js @@ -0,0 +1,13 @@ +"use strict"; + +exports.__generic = function (t, a) { + a(t.call(this), this[0]); +}; +exports[""] = function (t, a) { + var x; + a(t.call([]), undefined, "Empty"); + a(t.call(new Array(234), undefined, "Sparse empty")); + x = new Array(2342); + x[434] = {}; + a(t.call(x), x[434], "Sparse"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/flatten.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/flatten.js new file mode 100644 index 00000000..c1234c3a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/flatten.js @@ -0,0 +1,14 @@ +"use strict"; + +var o = [1, 2, [3, 4, [5, 6], 7, 8], 9, 10, [11, 12, [13, 14]], 15]; + +module.exports = { + "__generic": function (t, a) { + a(t.call(this).length, 3); + }, + "Nested Arrays": function (t, a) { + var result = t.call(o); + a.not(o, result); + a.deep(result, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/for-each-right.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/for-each-right.js new file mode 100644 index 00000000..109101f8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/for-each-right.js @@ -0,0 +1,47 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var count = 0, first, last, x, icount = this.length; + t.call(this, function (item, index, col) { + ++count; + if (!first) { + first = item; + } + last = item; + x = col; + a(index, --icount, "Index"); + }); + a(count, this.length, "Iterated"); + a(first, this[this.length - 1], "First is last"); + a(last, this[0], "Last is first"); + a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip + }, + "": function (t, a) { + var x = {}, y, count; + t.call( + [1], + function () { + y = this; + }, + x + ); + a(y, x, "Scope"); + y = 0; + t.call([3, 4, 4], function (a, i) { + y += i; + }); + a(y, 3, "Indexes"); + + x = [1, 3]; + x[5] = "x"; + y = 0; + count = 0; + t.call(x, function (a, i) { + ++count; + y += i; + }); + a(y, 6, "Misssing Indexes"); + a(count, 3, "Misssing Indexes, count"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/group.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/group.js new file mode 100644 index 00000000..12667de9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/group.js @@ -0,0 +1,24 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var count = 0, self; + + self = Object(this); + a.deep(t.call(self, function (v, i, scope) { + a(v, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + return i; + }, self), { 0: [this[0]], 1: [this[1]], 2: [this[2]] }); + }, + "": function (t, a) { + var r; + r = t.call([2, 3, 3, 4, 5, 6, 7, 7, 23, 45, 34, 56], + function (v) { + return v % 2 ? "odd" : "even"; + }); + a.deep(r.odd, [3, 3, 5, 7, 7, 23, 45]); + a.deep(r.even, [2, 4, 6, 34, 56]); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/indexes-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/indexes-of.js new file mode 100644 index 00000000..1463417d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/indexes-of.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + a.deep(t.call(this, this[1]), [1]); + }, + "": function (t, a) { + var x = {}; + a.deep(t.call([1, 3, 5, 3, 5], 6), [], "No result"); + a.deep(t.call([1, 3, 5, 1, 3, 5, 1], 1), [0, 3, 6], "Some results"); + a.deep(t.call([], x), [], "Empty array"); + a.deep(t.call([x, 3, {}, x, 3, 5, x], x), [0, 3, 6], "Search for object"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/intersection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/intersection.js new file mode 100644 index 00000000..bb1097d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/intersection.js @@ -0,0 +1,24 @@ +"use strict"; + +var toArray = require("../../../array/to-array"); + +module.exports = { + "__generic": function (t, a) { + a.deep(t.call(this, this, this), toArray(this)); + }, + "": function (t, a) { + var x = {}, y = {}, p, r; + a.deep(t.call([], [2, 3, 4]), [], "Empty #1"); + a.deep(t.call([2, 3, 4], []), [], "Empty #2"); + a.deep(t.call([2, 3, x], [y, 5, 7]), [], "Different"); + p = t.call([3, 5, "raz", {}, "dwa", x], [1, 3, "raz", "dwa", "trzy", x, {}], + [3, "raz", x, 65]); + r = [3, "raz", x]; + p.sort(); + r.sort(); + a.deep(p, r, "Same parts"); + a.deep(t.call(r, r), r, "Same"); + a.deep(t.call([1, 2, x, 4, 5, y, 7], [7, y, 5, 4, x, 2, 1]), + [1, 2, x, 4, 5, y, 7], "Long reverse same"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-copy.js new file mode 100644 index 00000000..b090c2ac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-copy.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([], []), true, "Empty"); + a(t.call([], {}), true, "Empty lists"); + a(t.call([1, x, "raz"], [1, x, "raz"]), true, "Same"); + a(t.call([1, x, "raz"], { 0: 1, 1: x, 2: "raz", length: 3 }), true, + "Same lists"); + a(t.call([1, x, "raz"], [x, 1, "raz"]), false, "Diff order"); + a(t.call([1, x], [1, x, "raz"]), false, "Diff length #1"); + a(t.call([1, x, "raz"], [1, x]), false, "Diff length #2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-empty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-empty.js new file mode 100644 index 00000000..1e1c097b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-empty.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([]), true, "Empty"); + a(t.call({ length: 0 }), true, "Empty lists"); + a(t.call([1, x, "raz"]), false, "Non empty"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-uniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-uniq.js new file mode 100644 index 00000000..ab531ac5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/is-uniq.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}; + a(t.call([]), true, "Empty"); + a(t.call({}), true, "Empty lists"); + a(t.call([1, x, "raz"]), true, "Uniq"); + a(t.call([1, x, 1, "raz"]), false, "Not Uniq: primitive"); + a(t.call([1, x, "1", "raz"]), true, "Uniq: primitive"); + a(t.call([1, x, 1, {}, "raz"]), false, "Not Uniq: Obj"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/implement.js new file mode 100644 index 00000000..cc1f9316 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/keys/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/shim.js new file mode 100644 index 00000000..9be9a8f0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/keys/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: 0, done: false }); + a.deep(iterator.next(), { value: 1, done: false }); + a.deep(iterator.next(), { value: 2, done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/last-index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/last-index.js new file mode 100644 index 00000000..e66d16f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/last-index.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a(t.call([]), null, "Empty"); + a(t.call([null]), 0, "One value"); + a(t.call([1, 2, 3]), 2, "Many values"); + a(t.call(new Array(1000)), null, "Sparse empty"); + x = []; + x[883] = null; + x[890] = undefined; + a(t.call(x), 890, "Manual sparse, distant value"); + x = new Array(1000); + x[657] = null; + x[700] = undefined; + a(t.call(x), 700, "Sparse, distant value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/last.js new file mode 100644 index 00000000..6ca5d053 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/last.js @@ -0,0 +1,15 @@ +"use strict"; + +exports.__generic = function (t, a) { + a(t.call(this), this[this.length - 1]); +}; + +exports[""] = function (t, a) { + var x; + a(t.call([]), undefined, "Empty"); + a(t.call(new Array(234), undefined, "Sparse empty")); + x = new Array(2342); + x[434] = {}; + x[450] = {}; + a(t.call(x), x[450], "Sparse"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/implement.js new file mode 100644 index 00000000..26bb4115 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/map/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/shim.js new file mode 100644 index 00000000..02a5af25 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/map/shim.js @@ -0,0 +1,19 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false], + "Plain array"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, Boolean); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [true, false, false, true, false, true, false], + "Result of subclass"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/remove.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/remove.js new file mode 100644 index 00000000..d67457ea --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/remove.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + var y = {}, z = {}, x = [9, z, 5, y, "foo"]; + t.call(x, y); + a.deep(x, [9, z, 5, "foo"]); + t.call(x, {}); + a.deep(x, [9, z, 5, "foo"], "Not existing"); + t.call(x, 5); + a.deep(x, [9, z, "foo"], "Primitive"); + x = [9, z, 5, y, "foo"]; + t.call(x, z, 5, "foo"); + a.deep(x, [9, y], "More than one argument"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/separate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/separate.js new file mode 100644 index 00000000..9792637f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/separate.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + var x = [], y = {}, z = {}; + a.deep(t.call(x, y), [], "Empty"); + a.not(t.call(x), x, "Returns copy"); + a.deep(t.call([1], y), [1], "One"); + a.deep(t.call([1, "raz"], y), [1, y, "raz"], "One"); + a.deep(t.call([1, "raz", x], y), [1, y, "raz", y, x], "More"); + x = new Array(1000); + x[23] = 2; + x[3453] = "raz"; + x[500] = z; + a.deep(t.call(x, y), [2, y, z, y, "raz"], "Sparse"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/implement.js new file mode 100644 index 00000000..8c9b9be6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/slice/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/shim.js new file mode 100644 index 00000000..f09ad13c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/slice/shim.js @@ -0,0 +1,17 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, 2, 4), [0, "2d"], "Plain array: result"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, 2, 4); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [0, "2d"], "Subclass: result"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/some-right.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/some-right.js new file mode 100644 index 00000000..1e0f407e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/some-right.js @@ -0,0 +1,62 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + var count = 0, first, last, x, icount = this.length; + t.call(this, function (item, index, col) { + ++count; + if (!first) { + first = item; + } + last = item; + x = col; + a(index, --icount, "Index"); + }); + a(count, this.length, "Iterated"); + a(first, this[this.length - 1], "First is last"); + a(last, this[0], "Last is first"); + a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip + }, + "": function (t, a) { + var x = {}, y, count; + t.call( + [1], + function () { + y = this; + }, + x + ); + a(y, x, "Scope"); + y = 0; + t.call([3, 4, 4], function (a, i) { + y += i; + }); + a(y, 3, "Indexes"); + + x = [1, 3]; + x[5] = "x"; + y = 0; + count = 0; + a( + t.call(x, function (a, i) { + ++count; + y += i; + }), + false, + "Return" + ); + a(y, 6, "Misssing Indexes"); + a(count, 3, "Misssing Indexes, count"); + + count = 0; + a( + t.call([-2, -3, -4, 2, -5], function (item) { + ++count; + return item > 0; + }), + true, + "Return" + ); + a(count, 2, "Break after true is returned"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/implement.js new file mode 100644 index 00000000..f09257a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/splice/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/shim.js new file mode 100644 index 00000000..48020078 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/splice/shim.js @@ -0,0 +1,19 @@ +"use strict"; + +var SubArray = require("../../../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ["foo", undefined, 0, "2d", false, x, null]; + + a.deep(t.call(arr, 2, 2, "bar"), [0, "2d"], "Plain array: result"); + a.deep(arr, ["foo", undefined, "bar", false, x, null], "Plain array: change"); + + subArr = new SubArray("foo", undefined, 0, "2d", false, x, null); + + result = t.call(subArr, 2, 2, "bar"); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [0, "2d"], "Subclass: result"); + a.deep(subArr, ["foo", undefined, "bar", false, x, null], "Subclass: change"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/uniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/uniq.js new file mode 100644 index 00000000..c7223b26 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/uniq.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = { + "__generic": function (t, a) { + a(t.call(this).length, 3); + }, + "": function (t, a) { + var o, x = {}, y = {}, z = {}, w; + o = [1, 2, x, 3, 1, "raz", "1", y, x, "trzy", z, "raz"]; + + a.not(w = t.call(o), o, "Returns different object"); + a.deep(w, [1, 2, x, 3, "raz", "1", y, "trzy", z], "Result"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/implement.js new file mode 100644 index 00000000..4ba7613a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../array/#/values/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/shim.js new file mode 100644 index 00000000..71b71d58 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/#/values/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: "1", done: false }); + a.deep(iterator.next(), { value: "2", done: false }); + a.deep(iterator.next(), { value: "3", done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/__scopes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/__scopes.js new file mode 100644 index 00000000..bf47389f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/__scopes.js @@ -0,0 +1,11 @@ +"use strict"; + +exports.Array = ["1", "2", "3"]; + +exports.Arguments = (function () { + return arguments; +}("1", "2", "3")); + +exports.String = "123"; + +exports.Object = { 0: "1", 1: "2", 2: "3", 3: "4", length: 3 }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_is-extensible.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_is-extensible.js new file mode 100644 index 00000000..87881863 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_is-extensible.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t, "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js new file mode 100644 index 00000000..6b42f4d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js @@ -0,0 +1,7 @@ +"use strict"; + +var isArray = Array.isArray; + +module.exports = function (t) { + t(t === null || isArray(t.prototype), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_sub-array-dummy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_sub-array-dummy.js new file mode 100644 index 00000000..6b42f4d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/_sub-array-dummy.js @@ -0,0 +1,7 @@ +"use strict"; + +var isArray = Array.isArray; + +module.exports = function (t) { + t(t === null || isArray(t.prototype), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/implement.js new file mode 100644 index 00000000..2ed3788f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../array/from/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/shim.js new file mode 100644 index 00000000..17974c4b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/from/shim.js @@ -0,0 +1,138 @@ +// Some tests taken from: https://github.com/mathiasbynens/Array.from/blob/master/tests/tests.js + +"use strict"; + +module.exports = function (t, a) { + var o = [1, 2, 3], MyType; + a.not(t(o), o, "Array"); + a.deep(t(o), o, "Array: same content"); + a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String"); + a.deep( + t( + (function () { + return arguments; + })(3, o, "raz") + ), + [3, o, "raz"], + "Arguments" + ); + a.deep( + t( + (function () { + return arguments; + })(3) + ), + [3], + "Arguments with one numeric value" + ); + + a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other"); + + a.deep( + t( + o, + function (val) { + return (val + 2) * 10; + }, + 10 + ), + [30, 40, 50], + "Mapping" + ); + + a.throws( + function () { + t(); + }, + TypeError, + "Undefined" + ); + a.deep(t(3), [], "Primitive"); + + a(t.length, 1, "Length"); + a.deep(t({ length: 0 }), [], "No values Array-like"); + a.deep(t({ length: -1 }), [], "Invalid length Array-like"); + a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2"); + a.throws( + function () { + t(undefined); + }, + TypeError, + "Undefined" + ); + a.throws( + function () { + t(null); + }, + TypeError, + "Null" + ); + a.deep(t(false), [], "Boolean"); + a.deep(t(-Infinity), [], "Inifity"); + a.deep(t(-0), [], "-0"); + a.deep(t(+0), [], "+0"); + a.deep(t(1), [], "1"); + a.deep(t(Number(Infinity)), [], "+Infinity"); + a.deep(t({}), [], "Plain object"); + a.deep(t({ length: 1 }), [undefined], "Sparse array-like"); + a.deep( + t({ 0: "a", 1: "b", length: 2 }, function (x) { + return x + x; + }), + ["aa", "bb"], + "Map" + ); + a.deep( + t( + { 0: "a", 1: "b", length: 2 }, + function () { + return String(this); + }, + undefined + ), + ["undefined", "undefined"], + "Map context" + ); + a.deep( + t( + { 0: "a", 1: "b", length: 2 }, + function () { + return String(this); + }, + "x" + ), + ["x", "x"], + "Map primitive context" + ); + a.throws( + function () { + t({}, "foo", "x"); + }, + TypeError, + "Non callable for map" + ); + + a.deep(t({ length: 1, 0: "a" }), ["a"], "Null context"); + + a(t({ __proto__: { 0: "abc", length: 1 } })[0], "abc", "Values on prototype"); + + a.throws( + function () { + t.call(function () { + return Object.freeze({}); + }, {}); + }, + TypeError, + "Contructor producing freezed objects" + ); + + // Ensure no setters are called for the indexes + // Ensure no setters are called for the indexes + MyType = function () {}; + Object.defineProperty(MyType.prototype, "0", { + set: function (x) { + throw new Error("Setter called: " + x); + } + }); + a.deep(t.call(MyType, { 0: "abc", length: 1 }), { 0: "abc", length: 1 }, "Defined not set"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/generate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/generate.js new file mode 100644 index 00000000..efd5f7c8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/generate.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = {}; + a.deep(t(3), [undefined, undefined, undefined], "Just length"); + a.deep(t(0, "x"), [], "No repeat"); + a.deep(t(1, x, y), [x], "Arguments length larger than repeat number"); + a.deep(t(3, x), [x, x, x], "Single argument"); + a.deep(t(5, x, y), [x, y, x, y, x], "Many arguments"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/is-plain-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/is-plain-array.js new file mode 100644 index 00000000..2cfd50d3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/is-plain-array.js @@ -0,0 +1,18 @@ +"use strict"; + +var SubArray = require("../../array/_sub-array-dummy-safe"); + +module.exports = function (t, a) { + var arr = [1, 2, 3]; + a(t(arr), true, "Array"); + a(t(null), false, "Null"); + a(t(), false, "Undefined"); + a(t("234"), false, "String"); + a(t(23), false, "Number"); + a(t({}), false, "Plain object"); + a(t({ length: 1, 0: "raz" }), false, "Array-like"); + a(t(Object.create(arr)), false, "Array extension"); + if (!SubArray) return; + a(t(new SubArray(23)), false, "Subclass instance"); + a(t(Array.prototype), false, "Array.prototype"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/implement.js new file mode 100644 index 00000000..0b1f5c8f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../array/of/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/shim.js new file mode 100644 index 00000000..7d18859a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/of/shim.js @@ -0,0 +1,89 @@ +/* eslint no-useless-call: "off" */ +// Most tests taken from https://github.com/mathiasbynens/Array.of/blob/master/tests/tests.js +// Thanks @mathiasbynens + +"use strict"; + +var defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var x = {}, testObject, MyType; + + a.deep(t(), [], "No arguments"); + a.deep(t(3), [3], "One numeric argument"); + a.deep(t(3, "raz", null, x, undefined), [3, "raz", null, x, undefined], "Many arguments"); + + a(t.length, 0, "Length"); + + a.deep(t("abc"), ["abc"], "String"); + a.deep(t(undefined), [undefined], "Undefined"); + a.deep(t(null), [null], "Null"); + a.deep(t(false), [false], "Boolean"); + a.deep(t(-Infinity), [-Infinity], "Infinity"); + a.deep(t(-0), [-0], "-0"); + a.deep(t(+0), [+0], "+0"); + a.deep(t(1), [1], "1"); + a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args"); + a.deep(t(Number(Infinity)), [Number(Infinity)], "+Infinity"); + a.deep( + t({ 0: "a", 1: "b", 2: "c", length: 3 }), + [{ 0: "a", 1: "b", 2: "c", length: 3 }], + "Array like" + ); + a.deep( + t(undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)), + [undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], + "Falsy arguments" + ); + + a.h1("Null context"); + a.deep(t.call(null, "abc"), ["abc"], "String"); + a.deep(t.call(null, undefined), [undefined], "Undefined"); + a.deep(t.call(null, null), [null], "Null"); + a.deep(t.call(null, false), [false], "Boolean"); + a.deep(t.call(null, -Infinity), [-Infinity], "-Infinity"); + a.deep(t.call(null, -0), [-0], "-0"); + a.deep(t.call(null, +0), [+0], "+0"); + a.deep(t.call(null, 1), [1], "1"); + a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric"); + a.deep(t.call(null, Number(Infinity)), [Number(Infinity)], "+Infinity"); + a.deep( + t.call(null, { 0: "a", 1: "b", 2: "c", length: 3 }), + [{ 0: "a", 1: "b", 2: "c", length: 3 }], + "Array-like" + ); + a.deep( + t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)), + [undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], + "Falsy" + ); + + a.h1("Other constructor context"); + a.deep(t.call(Object, 1, 2, 3), { 0: 1, 1: 2, 2: 3, length: 3 }, "Many arguments"); + + testObject = Object(3); + testObject[0] = 1; + testObject[1] = 2; + testObject[2] = 3; + testObject.length = 3; + a.deep(t.call(Object, 1, 2, 3), testObject, "Test object"); + a(t.call(Object).length, 0, "No arguments"); + a.throws( + function () { + t.call(function () { + return Object.freeze({}); + }); + }, + TypeError, + "Frozen instance" + ); + + // Ensure no setters are called for the indexes + MyType = function () {}; + defineProperty(MyType.prototype, "0", { + set: function (x) { + throw new Error("Setter called: " + x); + } + }); + a.deep(t.call(MyType, "abc"), { 0: "abc", length: 1 }, "Define, not set"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/to-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/to-array.js new file mode 100644 index 00000000..a1f10a4a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/to-array.js @@ -0,0 +1,27 @@ +"use strict"; + +module.exports = function (t, a) { + var o = [1, 2, 3]; + a(t(o), o, "Array"); + a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String"); + a.deep( + t( + (function () { + return arguments; + })(3, o, "raz") + ), + [3, o, "raz"], + "Arguments" + ); + a.deep( + t( + (function () { + return arguments; + })(3) + ), + [3], + "Arguments with one numeric value" + ); + + a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/valid-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/valid-array.js new file mode 100644 index 00000000..a3708b22 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/array/valid-array.js @@ -0,0 +1,30 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "Null"); + a.throws(function () { + t(0); +}, TypeError, "Number"); + a.throws(function () { + t(true); +}, TypeError, "Boolean"); + a.throws(function () { + t("raz"); +}, TypeError, "String"); + a.throws(function () { + t(function () {}); +}, TypeError, "Function"); + a.throws(function () { + t({}); +}, TypeError, "Object"); + a.throws(function () { + t({ length: 0 }); +}, TypeError, "Array-like"); + a(t(x = []), x, "Array"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/boolean/is-boolean.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/boolean/is-boolean.js new file mode 100644 index 00000000..e36b3f34 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/boolean/is-boolean.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(false), true, "Boolean"); + a(t(new Boolean(false)), true, "Boolean object"); + a(t(new Date()), false, "Date"); + a(t(new String("raz")), false, "String object"); + a(t({}), false, "Plain object"); + a(t(/a/), false, "Regular expression"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/copy.js new file mode 100644 index 00000000..27c996bb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/copy.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var o = new Date(), o2; + + o2 = t.call(o); + a.not(o, o2, "Different objects"); + a.ok(o2 instanceof Date, "Instance of Date"); + a(o.getTime(), o2.getTime(), "Same time"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/days-in-month.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/days-in-month.js new file mode 100644 index 00000000..ce2dd775 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/days-in-month.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2001, 0, 1)), 31, "January"); + a(t.call(new Date(2001, 1, 1)), 28, "February"); + a(t.call(new Date(2000, 1, 1)), 29, "February (leap)"); + a(t.call(new Date(2001, 2, 1)), 31, "March"); + a(t.call(new Date(2001, 3, 1)), 30, "April"); + a(t.call(new Date(2001, 4, 1)), 31, "May"); + a(t.call(new Date(2001, 5, 1)), 30, "June"); + a(t.call(new Date(2001, 6, 1)), 31, "July"); + a(t.call(new Date(2001, 7, 1)), 31, "August"); + a(t.call(new Date(2001, 8, 1)), 30, "September"); + a(t.call(new Date(2001, 9, 1)), 31, "October"); + a(t.call(new Date(2001, 10, 1)), 30, "November"); + a(t.call(new Date(2001, 11, 1)), 31, "December"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-day.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-day.js new file mode 100644 index 00000000..fa929d68 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-day.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 0, 1, 13, 32, 34, 234)).valueOf(), + new Date(2000, 0, 1).valueOf()); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-month.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-month.js new file mode 100644 index 00000000..1df4ddbe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-month.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 0, 15, 13, 32, 34, 234)).valueOf(), + new Date(2000, 0, 1).valueOf()); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-year.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-year.js new file mode 100644 index 00000000..5b78b7dc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/floor-year.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 5, 13, 13, 32, 34, 234)).valueOf(), + new Date(2000, 0, 1).valueOf()); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/format.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/format.js new file mode 100644 index 00000000..510b26b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/#/format.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + var dt = new Date(2011, 2, 3, 3, 5, 5, 32); + a(t.call(dt, " %Y.%y.%m.%d.%H.%M.%S.%L "), " 2011.11.03.03.03.05.05.032 "); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/ensure-time-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/ensure-time-value.js new file mode 100644 index 00000000..39ddc23c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/ensure-time-value.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(12), 12, "Number in range"); + a(t(12.23), 12, "Rounds number in range"); + a(t(-12.63), -12, "Rounds negative number in range"); + a.throws( + function () { + t(NaN); + }, + TypeError, + "Throws on invalid" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/is-date.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/is-date.js new file mode 100644 index 00000000..90ae8ad7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/is-date.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new String("raz")), false, "String object"); + a(t({}), false, "Plain object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/is-time-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/is-time-value.js new file mode 100644 index 00000000..a21677c0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/is-time-value.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), true, "Number in range"); + a(t(true), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t({}), false, "Plain object"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); + a(t(8.64e17), false, "Beyond range"); + a(t(8.64e15), true, "Below range"); + a(t(-8.64e17), false, "Negative beyond range"); + a(t(-8.64e15), true, "Negative below range"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/valid-date.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/valid-date.js new file mode 100644 index 00000000..2856cb6a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/date/valid-date.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + var d = new Date(); + a(t(d), d, "Date"); + a.throws(function () { + t({}); + }, "Object"); + a.throws(function () { + t({ valueOf: function () { + return 20; +} }); + }, "Number object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/#/throw.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/#/throw.js new file mode 100644 index 00000000..8c5d04ee --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/#/throw.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var e = new Error(); + try { + t.call(e); + } catch (e2) { + a(e2, e); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/custom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/custom.js new file mode 100644 index 00000000..ca35c766 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/custom.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var T = t, err = new T("My Error", "MY_ERROR", { errno: 123 }); + a(err instanceof Error, true, "Instance of error"); + a(err.constructor, Error, "Constructor"); + a(err.name, "Error", "Name"); + a(String(err), "Error: My Error", "String representation"); + a(err.code, "MY_ERROR", "Code"); + a(err.errno, 123, "Errno"); + a(typeof err.stack, "string", "Stack trace"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/is-error.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/is-error.js new file mode 100644 index 00000000..423c7359 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/is-error.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), false, "Undefined"); + a(t(1), false, "Primitive"); + a(t({}), false, "Objectt"); + a(t({ toString: function () { + return "[object Error]"; +} }), false, + "Fake error"); + a(t(new Error()), true, "Error"); + a(t(new EvalError()), true, "EvalError"); + a(t(new RangeError()), true, "RangeError"); + a(t(new ReferenceError()), true, "ReferenceError"); + a(t(new SyntaxError()), true, "SyntaxError"); + a(t(new TypeError()), true, "TypeError"); + a(t(new URIError()), true, "URIError"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/valid-error.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/valid-error.js new file mode 100644 index 00000000..7d032bf2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/error/valid-error.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + var e = new Error(); + a(t(e), e, "Error"); + a.throws(function () { + t({}); + }, "Other"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/compose.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/compose.js new file mode 100644 index 00000000..b90a2169 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/compose.js @@ -0,0 +1,10 @@ +"use strict"; + +var f = function (a, b) { return ["a", arguments.length, a, b]; } + , g = function (a) { return ["b", arguments.length].concat(a); } + , h = function (a) { return ["c", arguments.length].concat(a); }; + +module.exports = function (t, a) { + a.deep(t.call(h, g, f)(1, 2), ["c", 1, "b", 1, "a", 2, 1, 2]); + a.deep(t(h, g, f)(1, 2), ["c", 1, "b", 1, "a", 2, 1, 2]); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/copy.js new file mode 100644 index 00000000..e7988ce7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/copy.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function (t, a) { + var foo = "raz", bar = "dwa"; + // eslint-disable-next-line func-names + var fn = function marko(a, b) { + return this + a + b + foo + bar; + }; + var result, o = {}; + + fn.prototype = o; + + fn.foo = "raz"; + + result = t.call(fn); + + a(result.length, fn.length, "Length"); + a(result.name, fn.name, "Length"); + a(result.call("marko", "el", "fe"), "markoelferazdwa", "Body"); + a(result.prototype, fn.prototype, "Prototype"); + a(result.foo, fn.foo, "Custom property"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/curry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/curry.js new file mode 100644 index 00000000..c30313a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/curry.js @@ -0,0 +1,20 @@ +"use strict"; + +var toArray = require("../../../array/to-array") + + , f = function () { + return toArray(arguments); +}; + +module.exports = function (t, a) { + var x, y = {}, z; + a.deep(t.call(f, 0, 1, 2)(3), [], "0 arguments"); + x = t.call(f, 5, {}); + a(x.length, 5, "Length #1"); + z = x(1, 2); + a(z.length, 3, "Length #2"); + z = z(3, 4); + a(z.length, 1, "Length #1"); + a.deep(z(5, 6), [1, 2, 3, 4, 5], "Many arguments"); + a.deep(x(8, 3)(y, 45)("raz", 6), [8, 3, y, 45, "raz"], "Many arguments #2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/lock.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/lock.js new file mode 100644 index 00000000..08ea9505 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/lock.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(function () { + return arguments.length; + })(1, 2, 3), 0); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/microtask-delay.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/microtask-delay.js new file mode 100644 index 00000000..8bd0dc12 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/microtask-delay.js @@ -0,0 +1,22 @@ +"use strict"; + +var nextTick = require("next-tick"); + +module.exports = function (t, a, d) { + var wasInvoked = false, args = [{}, {}], context = {}; + var target = t.call(function () { + a(this, context); + a.deep(arguments, args); + wasInvoked = true; + }); + + nextTick(function () { + a(wasInvoked, false); + target.apply(context, args); + a(wasInvoked, false); + nextTick(function () { + a(wasInvoked, true); + d(); + }); + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/not.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/not.js new file mode 100644 index 00000000..64fff715 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/not.js @@ -0,0 +1,11 @@ +"use strict"; + +var identity = require("../../../function/identity") + , noop = require("../../../function/noop"); + +module.exports = function (t, a) { + a(t.call(identity)(""), true, "Falsy"); + a(t.call(noop)(), true, "Undefined"); + a(t.call(identity)({}), false, "Any object"); + a(t.call(identity)(true), false, "True"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/partial.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/partial.js new file mode 100644 index 00000000..7e9428fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/partial.js @@ -0,0 +1,11 @@ +"use strict"; + +var toArray = require("../../../array/to-array") + + , f = function () { + return toArray(arguments); +}; + +module.exports = function (t, a) { + a.deep(t.call(f, 1)(2, 3), [1, 2, 3]); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/spread.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/spread.js new file mode 100644 index 00000000..d082fcab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/spread.js @@ -0,0 +1,10 @@ +"use strict"; + +var f = function (a, b) { + return this[a] + this[b]; +} + , o = { a: 3, b: 4 }; + +module.exports = function (t, a) { + a(t.call(f).call(o, ["a", "b"]), 7); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/to-string-tokens.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/to-string-tokens.js new file mode 100644 index 00000000..0691cc39 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/#/to-string-tokens.js @@ -0,0 +1,33 @@ +/* eslint no-eval: "off" */ + +"use strict"; + +module.exports = function (t, a) { + a.deep( + t.call(function (a, b) { + return this[a] + this[b]; + }), + { args: "a, b", body: "\n\t\t\treturn this[a] + this[b];\n\t\t" } + ); + a.deep(t.call(function () {}), { args: "", body: "" }); + // eslint-disable-next-line no-unused-vars + a.deep(t.call(function (raz) {}), { args: "raz", body: "" }); + a.deep( + t.call(function () { + Object(); + }), + { args: "", body: "\n\t\t\tObject();\n\t\t" } + ); + + try { + eval("(() => {})"); + } catch (e) { + // Non ES2015 env + return; + } + + a.deep(t.call(eval("(() => {})")), { args: "", body: "" }); + a.deep(t.call(eval("((elo) => foo)")), { args: "elo", body: "foo" }); + a.deep(t.call(eval("(elo => foo)")), { args: "elo", body: "foo" }); + a.deep(t.call(eval("((elo, bar) => foo())")), { args: "elo, bar", body: "foo()" }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/_define-length.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/_define-length.js new file mode 100644 index 00000000..324e273c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/_define-length.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + var foo = "raz", bar = "dwa" + , fn = function (a, b) { + return this + a + b + foo + bar; +} + , result; + + result = t(fn, 3); + a(result.call("marko", "el", "fe"), "markoelferazdwa", "Content"); + a(result.length, 3, "Length"); + a(result.prototype, fn.prototype, "Prototype"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/constant.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/constant.js new file mode 100644 index 00000000..4ba2d898 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/constant.js @@ -0,0 +1,7 @@ +"use strict"; + +var o = {}; + +module.exports = function (t, a) { + a(t(o)(), o); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/identity.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/identity.js new file mode 100644 index 00000000..a5b0b1bc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/identity.js @@ -0,0 +1,7 @@ +"use strict"; + +var o = {}; + +module.exports = function (t, a) { + a(t(o), o); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/invoke.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/invoke.js new file mode 100644 index 00000000..6268f47e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/invoke.js @@ -0,0 +1,9 @@ +"use strict"; + +var constant = require("../../function/constant") + + , o = { b: constant("c") }; + +module.exports = function (t, a) { + a(t("b")(o), "c"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/is-arguments.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/is-arguments.js new file mode 100644 index 00000000..5bd54ac7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/is-arguments.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var args, dummy; + args = (function () { + return arguments; +}()); + dummy = { 0: 1, 1: 2 }; + Object.defineProperty(dummy, "length", { value: 2 }); + a(t(args), true, "Arguments"); + a(t(dummy), false, "Dummy"); + a(t([]), false, "Array"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/is-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/is-function.js new file mode 100644 index 00000000..fe897985 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/is-function.js @@ -0,0 +1,8 @@ +"use strict"; + +var o = { call: Function.prototype.call, apply: Function.prototype.apply }; + +module.exports = function (t, a) { + a(t(function () {}), true, "Function is function"); + a(t(o), false, "Plain object is not function"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/noop.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/noop.js new file mode 100644 index 00000000..34de85ab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/noop.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(1, 2, 3), "undefined"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/pluck.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/pluck.js new file mode 100644 index 00000000..f8954c59 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/pluck.js @@ -0,0 +1,7 @@ +"use strict"; + +var o = { foo: "bar" }; + +module.exports = function (t, a) { + a(t("foo")(o), o.foo); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/valid-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/valid-function.js new file mode 100644 index 00000000..30c03608 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/function/valid-function.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function (t, a) { + var f = function () {}; + a(t(f), f, "Function"); + // eslint-disable-next-line no-new-func + f = new Function(); + a(t(f), f, "Function"); + a.throws(function () { + t({}); + }, "Object"); + a.throws(function () { + t(/re/); + }, "RegExp"); + a.throws(function () { + t({ + call: function () { + return 20; + } + }); + }, "Plain object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/global.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/global.js new file mode 100644 index 00000000..b29fbbb1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/global.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a.ok(t && typeof t === "object"); + a(typeof t.Array, "function"); + a("__global__" in Object.prototype, false); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/for-each.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/for-each.js new file mode 100644 index 00000000..d6c3872a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/for-each.js @@ -0,0 +1,42 @@ +"use strict"; + +var ArrayIterator = require("es6-iterator/array") + + , slice = Array.prototype.slice; + +module.exports = function (t, a) { + var i = 0, x = ["raz", "dwa", "trzy"], y = {}; + t(x, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); + a(this, y, "Array: context: " + i++ + "#"); + }, y); + i = 0; + t((function () { + return arguments; +}("raz", "dwa", "trzy")), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); + a(this, y, "Arguments: context: " + i++ + "#"); + }, y); + i = 0; + t({ 0: "raz", 1: "dwa", 2: "trzy", length: 3 }, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array-like" + i + "#"); + a(this, y, "Array-like: context: " + i++ + "#"); + }, y); + i = 0; + t(x = "foo", function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Regular String: context: " + i++ + "#"); + }, y); + i = 0; + x = ["r", "💩", "z"]; + t("r💩z", function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Unicode String: context: " + i++ + "#"); + }, y); + i = 0; + t(new ArrayIterator(x), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); + a(this, y, "Iterator: context: " + i++ + "#"); + }, y); + +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/is.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/is.js new file mode 100644 index 00000000..04d34a83 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/is.js @@ -0,0 +1,28 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (t, a) { + var x; + a(t([]), true, "Array"); + a(t(""), true, "String"); + a( + t( + (function () { + return arguments; + })() + ), + true, + "Arguments" + ); + a(t({ length: 0 }), true, "List object"); + a(t(function () {}), false, "Function"); + a(t({}), false, "Plain object"); + a(t(/raz/), false, "Regexp"); + a(t(), false, "No argument"); + a(t(null), false, "Null"); + a(t(undefined), false, "Undefined"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), true, "Iterable"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/validate-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/validate-object.js new file mode 100644 index 00000000..83a9ca15 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/validate-object.js @@ -0,0 +1,34 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (t, a) { + var x; + a.throws(function () { + t(0); +}, TypeError, "0"); + a.throws(function () { + t(false); +}, TypeError, "false"); + a.throws(function () { + t(""); +}, TypeError, "String"); + a.throws(function () { + t({}); +}, TypeError, "Plain Object"); + a.throws(function () { + t(function () {}); +}, TypeError, "Function"); + a(t(x = new String("raz")), x, "String object"); // Jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "null"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), x, "Iterable"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/validate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/validate.js new file mode 100644 index 00000000..61cab5d3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/iterable/validate.js @@ -0,0 +1,32 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (t, a) { + var x; + a.throws(function () { + t(0); +}, TypeError, "0"); + a.throws(function () { + t(false); +}, TypeError, "false"); + a(t(""), "", "''"); + a.throws(function () { + t({}); +}, TypeError, "Plain Object"); + a.throws(function () { + t(function () {}); +}, TypeError, "Function"); + a(t(x = new String("raz")), x, "String object"); // Jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "null"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), x, "Iterable"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/json/safe-stringify.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/json/safe-stringify.js new file mode 100644 index 00000000..2d13f3de --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/json/safe-stringify.js @@ -0,0 +1,26 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({ foo: "bar" }), JSON.stringify({ foo: "bar" })); + a(t({ foo: { elo: 12 } }), "{\"foo\":{\"elo\":12}}"); + a(t({ foo: { elo: 12, +mel: { + toJSON: function () { + throw new Error("Nu nu!"); +} + } } }), "{\"foo\":{\"elo\":12}}"); + a(t({ foo: { elo: 12 }, +mel: { + toJSON: function () { + throw new Error("Nu nu!"); +} + } }), "{\"foo\":{\"elo\":12}}"); + a(t({ foo: { elo: 12 }, +mel: [ +"raz", { + toJSON: function () { + throw new Error("Nu nu!"); +} + }, 0, 2 +] }), "{\"foo\":{\"elo\":12},\"mel\":[\"raz\",0,2]}"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_decimal-adjust.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_decimal-adjust.js new file mode 100644 index 00000000..6da15ecf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_decimal-adjust.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity check, as real tests are in 'round', 'ceil' and 'floor' variants + a(t("round")(55.55, -1), 55.6); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_pack-ieee754.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_pack-ieee754.js new file mode 100644 index 00000000..7e56f7f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_pack-ieee754.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t(1.337, 8, 23), [63, 171, 34, 209]); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_unpack-ieee754.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_unpack-ieee754.js new file mode 100644 index 00000000..52730f38 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/_unpack-ieee754.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t([63, 171, 34, 209], 8, 23), 1.3370000123977661); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/implement.js new file mode 100644 index 00000000..d7bcc28a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/acosh/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/shim.js new file mode 100644 index 00000000..17ac1819 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/acosh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-1), NaN, "Negative"); + a(t(0), NaN, "Zero"); + a(t(0.5), NaN, "Below 1"); + a(t(1), 0, "1"); + a(t(2), 1.3169578969248166, "Other"); + a(t(Infinity), Infinity, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/implement.js new file mode 100644 index 00000000..ab4b9691 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/asinh/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/shim.js new file mode 100644 index 00000000..a4328d2e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/asinh/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(-2), -1.4436354751788103, "Negative"); + a(t(2), 1.4436354751788103, "Positive"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/implement.js new file mode 100644 index 00000000..bcd3bd87 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/atanh/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/shim.js new file mode 100644 index 00000000..f58709cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/atanh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-2), NaN, "Less than -1"); + a(t(2), NaN, "Greater than 1"); + a(t(-1), -Infinity, "-1"); + a(t(1), Infinity, "1"); + a(t(0), 0, "Zero"); + a(Math.round(t(0.5) * 1e15), 549306144334055, "Other"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/implement.js new file mode 100644 index 00000000..132e9296 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/cbrt/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/shim.js new file mode 100644 index 00000000..fc1beee4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cbrt/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(-1), -1, "-1"); + a(t(1), 1, "1"); + a(t(2), 1.2599210498948732, "Ohter"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/ceil-10.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/ceil-10.js new file mode 100644 index 00000000..1c4a3866 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/ceil-10.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(55.51, -1), 55.6); + a(t(51, 1), 60); + a(t(-55.59, -1), -55.5); + a(t(-59, 1), -50); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/implement.js new file mode 100644 index 00000000..36f529f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/clz32/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/shim.js new file mode 100644 index 00000000..4d8dd2fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/clz32/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(1), 31, "1"); + a(t(1000), 22, "1000"); + a(t(), 32, "No arguments"); + a(t(Infinity), 32, "Infinity"); + a(t(-Infinity), 32, "-Infinity"); + a(t("foo"), 32, "String"); + a(t(true), 31, "Boolean"); + a(t(3.5), 30, "Float"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/implement.js new file mode 100644 index 00000000..6ad42efb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/cosh/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/shim.js new file mode 100644 index 00000000..0b917c70 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/cosh/shim.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 1, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), Infinity, "-Infinity"); + a(t(1), 1.5430806348152437, "1"); + a(t(Number.MAX_VALUE), Infinity); + a(t(-Number.MAX_VALUE), Infinity); + a(t(Number.MIN_VALUE), 1); + a(t(-Number.MIN_VALUE), 1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/implement.js new file mode 100644 index 00000000..7fb528a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/expm1/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/shim.js new file mode 100644 index 00000000..cebb063c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/expm1/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -1, "-Infinity"); + a(t(1).toFixed(15), "1.718281828459045", "1"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/floor-10.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/floor-10.js new file mode 100644 index 00000000..a086d80f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/floor-10.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(55.59, -1), 55.5); + a(t(59, 1), 50); + a(t(-55.51, -1), -55.6); + a(t(-51, 1), -60); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/implement.js new file mode 100644 index 00000000..c7b9ad4a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/fround/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/shim.js new file mode 100644 index 00000000..0525bfab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/fround/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(1.337), 1.3370000123977661, "1"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/implement.js new file mode 100644 index 00000000..29c87fe9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/hypot/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/shim.js new file mode 100644 index 00000000..89e4657c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/hypot/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), 0, "No arguments"); + a(t(0, -0, 0), 0, "Zeros"); + a(t(4, NaN, Infinity), Infinity, "Infinity"); + a(t(4, NaN, -Infinity), Infinity, "Infinity"); + a(t(4, NaN, 34), NaN, "NaN"); + a(t(3, 4), 5, "#1"); + a(t(3, 4, 5), 7.0710678118654755, "#2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/implement.js new file mode 100644 index 00000000..b633a72b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/imul/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/shim.js new file mode 100644 index 00000000..a8d4e906 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/imul/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), 0, "No arguments"); + a(t(0, 0), 0, "Zeros"); + a(t(2, 4), 8, "#1"); + a(t(-1, 8), -8, "#2"); + a(t(0xfffffffe, 5), -10, "#3"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/implement.js new file mode 100644 index 00000000..afc9dab1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/log10/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/shim.js new file mode 100644 index 00000000..d0696287 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log10/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-0.5), NaN, "Less than 0"); + a(t(0), -Infinity, "0"); + a(t(1), 0, "1"); + a(t(Infinity), Infinity, "Infinity"); + a(t(2), 0.3010299956639812, "Other"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/implement.js new file mode 100644 index 00000000..baa2ab15 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/log1p/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/shim.js new file mode 100644 index 00000000..66b400cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log1p/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-1.5), NaN, "Less than -1"); + a(t(-1), -Infinity, "-1"); + a(t(0), 0, "0"); + a(t(Infinity), Infinity, "Infinity"); + a(t(1), 0.6931471805599453, "Other"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/implement.js new file mode 100644 index 00000000..43bdf436 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/log2/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/shim.js new file mode 100644 index 00000000..f587e339 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/log2/shim.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-0.5), NaN, "Less than 0"); + a(t(0), -Infinity, "0"); + a(t(1), 0, "1"); + a(t(Infinity), Infinity, "Infinity"); + a(t(3).toFixed(15), "1.584962500721156", "Other"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/round-10.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/round-10.js new file mode 100644 index 00000000..c7ae38c4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/round-10.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(55.55, -1), 55.6); + a(t(55.549, -1), 55.5); + a(t(55, 1), 60); + a(t(54.9, 1), 50); + a(t(-55.55, -1), -55.5); + a(t(-55.551, -1), -55.6); + a(t(-55, 1), -50); + a(t(-55.1, 1), -60); + a(t(1.005, -2), 1.01); + a(t(-1.005, -2), -1.0); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/implement.js new file mode 100644 index 00000000..409beb1f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/sign/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/shim.js new file mode 100644 index 00000000..071ea07e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sign/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +var is = require("../../../object/is"); + +module.exports = function (t, a) { + a(is(t(0), +0), true, "+0"); + a(is(t(-0), -0), true, "-0"); + a(t({}), NaN, true, "NaN"); + a(t(-234234234), -1, "Negative"); + a(t(234234234), 1, "Positive"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/implement.js new file mode 100644 index 00000000..ca4b5e7b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/sinh/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/shim.js new file mode 100644 index 00000000..f168a7f7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/sinh/shim.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(1), 1.1752011936438014, "1"); + a(t(Number.MAX_VALUE), Infinity); + a(t(-Number.MAX_VALUE), -Infinity); + a(t(Number.MIN_VALUE), 5e-324); + a(t(-Number.MIN_VALUE), -5e-324); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/implement.js new file mode 100644 index 00000000..8503711f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/tanh/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/shim.js new file mode 100644 index 00000000..5da3c087 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/tanh/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), 1, "Infinity"); + a(t(-Infinity), -1, "-Infinity"); + a(t(1), 0.7615941559557649, "1"); + a(t(Number.MAX_VALUE), 1); + a(t(-Number.MAX_VALUE), -1); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/implement.js new file mode 100644 index 00000000..0d3374fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../math/trunc/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/shim.js new file mode 100644 index 00000000..b80e8683 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/math/trunc/shim.js @@ -0,0 +1,16 @@ +"use strict"; + +var is = require("../../../object/is"); + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(is(t(0.234), 0), true, "0"); + a(is(t(-0.234), -0), true, "-0"); + a(t(13.7), 13, "Positive #1"); + a(t(12.3), 12, "Positive #2"); + a(t(-12.3), -12, "Negative #1"); + a(t(-14.7), -14, "Negative #2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/#/pad.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/#/pad.js new file mode 100644 index 00000000..cc8aa5e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/#/pad.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(78, 4), "0078"); + a(t.call(65.12323, 4, 3), "0065.123", "Precision"); + a(t.call(65, 4, 3), "0065.000", "Precision integer"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/implement.js new file mode 100644 index 00000000..d387b7c1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../number/epsilon/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/index.js new file mode 100644 index 00000000..d20e5c3b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t, "number"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/epsilon/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/implement.js new file mode 100644 index 00000000..5300de62 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../number/is-finite/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/shim.js new file mode 100644 index 00000000..8fa004fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-finite/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/implement.js new file mode 100644 index 00000000..2290b250 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../number/is-integer/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/shim.js new file mode 100644 index 00000000..e367990b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-integer/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(2.34), false, "Float"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/implement.js new file mode 100644 index 00000000..10fa084e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../number/is-nan/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/shim.js new file mode 100644 index 00000000..31810474 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-nan/shim.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), false, "Number"); + a(t({}), false, "Not numeric"); + a(t(NaN), true, "NaN"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-natural.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-natural.js new file mode 100644 index 00000000..8fe4dcc4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-natural.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-number.js new file mode 100644 index 00000000..9cd670c1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-number.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(0), true, "Zero"); + a(t(NaN), true, "NaN"); + a(t(Infinity), true, "Infinity"); + a(t(12), true, "Number"); + a(t(false), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t("asdfaf"), false, "String"); + a(t(""), false, "Empty String"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/implement.js new file mode 100644 index 00000000..96f634b1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../number/is-safe-integer/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/shim.js new file mode 100644 index 00000000..a4ea6913 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/is-safe-integer/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(2.34), false, "Float"); + a(t(Math.pow(2, 53)), false, "Too large"); + a(t(Math.pow(2, 53) - 1), true, "Maximum"); + a(t("23"), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/implement.js new file mode 100644 index 00000000..1928f341 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../number/max-safe-integer/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/index.js new file mode 100644 index 00000000..d20e5c3b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t, "number"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/implement.js new file mode 100644 index 00000000..f8b309a8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../number/min-safe-integer/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/index.js new file mode 100644 index 00000000..d20e5c3b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t, "number"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-integer.js new file mode 100644 index 00000000..b7b975f5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-integer.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "NaN"); + a(t(20), 20, "Positive integer"); + a(t("-20"), -20, "String negative integer"); + a(t(Infinity), Infinity, "Infinity"); + a(t(15.343), 15, "Float"); + a(t(-15.343), -15, "Negative float"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-pos-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-pos-integer.js new file mode 100644 index 00000000..27c7cdfa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-pos-integer.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "NaN"); + a(t(20), 20, "Positive integer"); + a(t(-20), 0, "Negative integer"); + a(t(Infinity), Infinity, "Infinity"); + a(t(15.343), 15, "Float"); + a(t(-15.343), 0, "Negative float"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-uint32.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-uint32.js new file mode 100644 index 00000000..7eea42f5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/number/to-uint32.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "Not numeric"); + a(t(-4), 4294967292, "Negative"); + a(t(133432), 133432, "Positive"); + a(t(8589934592), 0, "Greater than maximum"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/_iterate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/_iterate.js new file mode 100644 index 00000000..d7728f42 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/_iterate.js @@ -0,0 +1,30 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { raz: 1, dwa: 2, trzy: 3 } + , o2 = {}, o3 = {}, arr, i = -1; + + t = t("forEach"); + t(o, function (value, name, self, index) { + o2[name] = value; + a(index, ++i, "Index"); + a(self, o, "Self"); + a(this, o3, "Scope"); + }, o3); + a.deep(o2, o); + + arr = []; + o2 = {}; + i = -1; + t(o, function (value, name, self, index) { + arr.push(value); + o2[name] = value; + a(index, ++i, "Index"); + a(self, o, "Self"); + a(this, o3, "Scope"); + }, o3, function (a, b) { + return o[b] - o[a]; + }); + a.deep(o2, o, "Sort by Values: Content"); + a.deep(arr, [3, 2, 1], "Sort by Values: Order"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign-deep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign-deep.js new file mode 100644 index 00000000..962ac40d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign-deep.js @@ -0,0 +1,27 @@ +"use strict"; + +module.exports = function (t, a) { + var o1 = { a: 1, b: 2 }, o2 = { b: 3, c: 4 }; + + a(t(o1, o2), o1, "Returns self"); + a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content"); + + a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument"); + + var obj1 = { foo: { bar: 3, marko: true } } + , obj2 = { foo: { elo: 12, marko: false }, miszka: [23] }; + + var copyObj1 = JSON.parse(JSON.stringify(obj1)), copyObj2 = JSON.parse(JSON.stringify(obj2)); + a.deep(t({}, obj1, obj2), { foo: { bar: 3, marko: false, elo: 12 }, miszka: [23] }); + // Ensure it's side effects free + a.deep(obj1, copyObj1); + a.deep(obj2, copyObj2); + + obj1 = [{ foo: "bar" }]; + var assignedObj = []; + t(assignedObj, obj1); + a.deep(assignedObj, [{ foo: "bar" }]); + // Ensure array items are copied and not passed + a.not(assignedObj[0], obj1[0]); + a(t(true), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/implement.js new file mode 100644 index 00000000..c3e0396b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../object/assign/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/shim.js new file mode 100644 index 00000000..36074907 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/assign/shim.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + var o1 = { a: 1, b: 2 } + , o2 = { b: 3, c: 4 }; + + a(t(o1, o2), o1, "Returns self"); + a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content"); + + a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/clear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/clear.js new file mode 100644 index 00000000..5735e796 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/clear.js @@ -0,0 +1,13 @@ +"use strict"; + +var isEmpty = require("../../object/is-empty"); + +module.exports = function (t, a) { + var x = {}; + a(t(x), x, "Empty: Returns same object"); + a(isEmpty(x), true, "Empty: Not changed"); + x.foo = "raz"; + x.bar = "dwa"; + a(t(x), x, "Same object"); + a(isEmpty(x), true, "Emptied"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/compact.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/compact.js new file mode 100644 index 00000000..353f6f32 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/compact.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = {}, z; + z = t(x); + a.not(z, x, "Returns different object"); + a.deep(z, {}, "Empty on empty"); + + x = { foo: "bar", +a: 0, +b: false, +c: "", +d: "0", +e: null, +bar: y, + elo: undefined }; + z = t(x); + a.deep(z, { foo: "bar", a: 0, b: false, c: "", d: "0", bar: y }, + "Cleared null values"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/compare.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/compare.js new file mode 100644 index 00000000..23cc5116 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/compare.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var d = new Date(); + + a.ok(t(12, 3) > 0, "Numbers"); + a.ok(t(2, 13) < 0, "Numbers #2"); + a.ok(t("aaa", "aa") > 0, "Strings"); + a.ok(t("aa", "ab") < 0, "Strings #2"); + a(t("aa", "aa"), 0, "Strings same"); + a(t(d, new Date(d.getTime())), 0, "Same date"); + a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/copy-deep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/copy-deep.js new file mode 100644 index 00000000..93813830 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/copy-deep.js @@ -0,0 +1,35 @@ +"use strict"; + +var stringify = JSON.stringify; + +module.exports = function (t, a) { + var o = { 1: "raz", 2: "dwa", 3: "trzy" }, no = t(o); + + a.not(no, o, "Return different object"); + a(stringify(no), stringify(o), "Match properties and values"); + + o = { + foo: "bar", + raz: { + dwa: "dwa", + trzy: { cztery: "pięć", sześć: "siedem" }, + osiem: {}, + dziewięć: function () {} + }, + dziesięć: 10, + jedenaście: ["raz", ["dwa", "trzy", { elo: "true" }]] + }; + o.raz.rec = o; + + no = t(o); + a.not(o.raz, no.raz, "Deep"); + a.not(o.raz.trzy, no.raz.trzy, "Deep #2"); + a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content"); + a(no.raz.rec, no, "Recursive"); + a.not(o.raz.osiem, no.raz.osiem, "Empty object"); + a(o.raz["dziewięć"], no.raz["dziewięć"], "Function"); + a.not(o["jedenaście"], no["jedenaście"]); + a.not(o["jedenaście"][1], no["jedenaście"][1]); + a.not(o["jedenaście"][1][2], no["jedenaście"][1][2]); + a(t(true), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/copy.js new file mode 100644 index 00000000..a5e2c348 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/copy.js @@ -0,0 +1,30 @@ +"use strict"; + +var stringify = JSON.stringify; + +module.exports = function (t, a) { + var o = { 1: "raz", 2: "dwa", 3: "trzy" }, no = t(o); + + a.not(no, o, "Return different object"); + a(stringify(no), stringify(o), "Match properties and values"); + + o = { + foo: "bar", + raz: { + dwa: "dwa", + trzy: { cztery: "pięć", sześć: "siedem" }, + osiem: {}, + dziewięć: function () {} + }, + dziesięć: 10 + }; + o.raz.rec = o; + + no = t(o); + a(o.raz, no.raz, "Shallow"); + + a.deep(t(o, ["foo"]), { foo: "bar" }); + a.deep(t(Object.create(o), ["foo"]), { foo: "bar" }); + a.deep(t(o, ["foo", "habla"]), { foo: "bar" }); + a.deep(t(o, ["foo", "habla"], { ensure: true }), { foo: "bar", habla: undefined }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/count.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/count.js new file mode 100644 index 00000000..ec1c5045 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/count.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), 0, "Empty"); + a(t({ raz: 1, dwa: null, trzy: undefined, cztery: 0 }), 4, + "Some properties"); + a(t(Object.defineProperties({}, { + raz: { value: "raz" }, + dwa: { value: "dwa", enumerable: true } + })), 1, "Some properties hidden"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/create.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/create.js new file mode 100644 index 00000000..c9f3029f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/create.js @@ -0,0 +1,22 @@ +"use strict"; + +var setPrototypeOf = require("../../object/set-prototype-of") + + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, obj; + + a(getPrototypeOf(t(x)), x, "Normal object"); + a(getPrototypeOf(t(null)), + (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null"); + + a.h1("Properties"); + a.h2("Normal object"); + a(getPrototypeOf(obj = t(x, { foo: { value: "bar" } })), x, "Prototype"); + a(obj.foo, "bar", "Property"); + a.h2("Null"); + a(getPrototypeOf(obj = t(null, { foo: { value: "bar2" } })), + (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype"); + a(obj.foo, "bar2", "Property"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-array.js new file mode 100644 index 00000000..fd3c32c9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-array.js @@ -0,0 +1,55 @@ +"use strict"; + +module.exports = function (t, a) { + var arr = []; + a(t(arr), arr, "Array"); + a(t(""), "", "String"); + var args = (function () { + return arguments; + }()); + a(t(args), args, "Arguments"); + var arrayLike = { length: 0 }; + a(t(arrayLike), arrayLike, "Array like"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Function" + ); + a.throws( + function () { + t({}); + }, + TypeError, + "Plain object" + ); + a.throws( + function () { + t(/raz/); + }, + TypeError, + "Regexp" + ); + a.throws( + function () { + t(); + }, + TypeError, + "No argument" + ); + a.throws( + function () { + t(null); + }, + TypeError, + "Null" + ); + a.throws( + function () { + t(undefined); + }, + TypeError, + "Undefined" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-finite-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-finite-number.js new file mode 100644 index 00000000..f1e6166b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-finite-number.js @@ -0,0 +1,54 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws( + function () { + t(undefined); + }, + TypeError, + "Undefined" + ); + a.throws( + function () { + t(null); + }, + TypeError, + "Null" + ); + a(t(0), 0, "Zero"); + a.throws( + function () { + t(NaN); + }, + TypeError, + "NaN" + ); + a.throws( + function () { + t(Infinity); + }, + TypeError, + "Infinity" + ); + a(t(12), 12, "Number"); + a(t(false), 0, "Boolean"); + a(t(new Date(1000000)), 1000000, "Date"); + a(t(new Number(2)), 2, "Number object"); + a.throws( + function () { + t("asdfaf"); + }, + TypeError, + "String" + ); + a(t(""), 0, "Empty String"); + if (typeof Symbol === "function") { + a.throws( + function () { + t(Symbol("test")); + }, + TypeError, + "Symbol" + ); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-integer.js new file mode 100644 index 00000000..03db9c36 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-integer.js @@ -0,0 +1,42 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws( + function () { + t(undefined); + }, + TypeError, + "Undefined" + ); + a.throws( + function () { + t(null); + }, + TypeError, + "Null" + ); + a(t(2), 2, "Number"); + a(t(-2), -2, "Negative"); + a.throws( + function () { + t(2.34); + }, + TypeError, + "Float" + ); + a(t("23"), 23, "Numeric string"); + a.throws( + function () { + t(NaN); + }, + TypeError, + "NaN" + ); + a.throws( + function () { + t(Infinity); + }, + TypeError, + "Infinity" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-natural-number-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-natural-number-value.js new file mode 100644 index 00000000..9aaae370 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-natural-number-value.js @@ -0,0 +1,24 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { + t(undefined); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { + t(-2); +}, TypeError, "Negative"); + a.throws(function () { + t(2.34); +}, TypeError, "Float"); + a(t("23"), 23, "Numeric string"); + a.throws(function () { + t(NaN); +}, TypeError, "NaN"); + a.throws(function () { + t(Infinity); +}, TypeError, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-natural-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-natural-number.js new file mode 100644 index 00000000..ff0e836a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-natural-number.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { + t(undefined); +}, TypeError, "Undefined"); + a(t(null), 0, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { + t(-2); +}, TypeError, "Negative"); + a.throws(function () { + t(2.34); +}, TypeError, "Float"); + a(t("23"), 23, "Numeric string"); + a.throws(function () { + t(NaN); +}, TypeError, "NaN"); + a.throws(function () { + t(Infinity); +}, TypeError, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-plain-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-plain-function.js new file mode 100644 index 00000000..3306d3a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-plain-function.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity checks, as logic is tested at isPlainFunction + var fn = function () {}; + a(t(fn), fn, "Function"); + a.throws( + function () { + t({}); + }, + TypeError, + "Error" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-plain-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-plain-object.js new file mode 100644 index 00000000..cc1d1fae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-plain-object.js @@ -0,0 +1,16 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity checks, as logic is tested at isPlainFunction + var obj = {}; + a(t(obj), obj, "Reguar object instance"); + obj = Object.create(null); + a(t(obj), obj, "Null prototype"); + a.throws( + function () { + t(function () {}); + }, + TypeError, + "Error" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-promise.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-promise.js new file mode 100644 index 00000000..1af15bab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-promise.js @@ -0,0 +1,32 @@ +"use strict"; + +module.exports = function (t, a) { + var promise; + a.throws(function () { + t(); +}, TypeError); + a.throws(function () { + t(null); +}, TypeError); + a.throws(function () { + t("promise"); +}, TypeError); + a.throws(function () { + t({}); +}, TypeError); + a.throws(function () { + t(function () {}); +}, TypeError); + a.throws(function () { + t({ then: {} }); +}, TypeError); + promise = { then: function () {} }; + a(t(promise), promise); + promise = function () {}; + promise.then = {}; + a.throws(function () { + t(promise); +}, TypeError); + promise.then = function () {}; + a(t(promise), promise); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-thenable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-thenable.js new file mode 100644 index 00000000..151238ba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/ensure-thenable.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + // Just sanity checks as proper tests are at isThenable + var thenable = { then: function () {} }; + + a.throws(function () { + t({}); + }, TypeError); + a(t(thenable), thenable); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/implement.js new file mode 100644 index 00000000..c367ee44 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../object/entries/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/shim.js new file mode 100644 index 00000000..eb7285a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/entries/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ foo: "bar" }), [["foo", "bar"]], "Object"); + a.deep(t("raz"), [["0", "r"], ["1", "a"], ["2", "z"]], "Primitive"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Undefined"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/eq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/eq.js new file mode 100644 index 00000000..8cad90ae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/eq.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var o = {}; + a(t(o, {}), false, "Different objects"); + a(t(o, o), true, "Same objects"); + a(t("1", "1"), true, "Same primitive"); + a(t("1", 1), false, "Different primitive types"); + a(t(NaN, NaN), true, "NaN"); + a(t(0, 0), true, "0,0"); + a(t(0, -0), true, "0,-0"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/every.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/every.js new file mode 100644 index 00000000..7e837d22 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/every.js @@ -0,0 +1,21 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}; + t(o, function (value, name) { + o2[name] = value; + return true; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + return true; + }), true, "Succeeds"); + + a(t(o, function () { + return false; + }), false, "Fails"); + +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/filter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/filter.js new file mode 100644 index 00000000..c714d237 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/filter.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ 1: 1, 2: 2, 3: 3, 4: 4 }, + function (value) { + return Boolean(value % 2); +}), { 1: 1, 3: 3 }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/find-key.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/find-key.js new file mode 100644 index 00000000..d4a578ff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/find-key.js @@ -0,0 +1,23 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), "1", "Finds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), undefined, "Fails"); + +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/find.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/find.js new file mode 100644 index 00000000..eea51247 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/find.js @@ -0,0 +1,23 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), 1, "Finds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), undefined, "Fails"); + +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/first-key.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/first-key.js new file mode 100644 index 00000000..6010ba11 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/first-key.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = Object.create(null); + a(t(x), null, "Normal: Empty"); + a(t(y), null, "Null extension: Empty"); + x.foo = "raz"; + x.bar = 343; + a(["foo", "bar"].indexOf(t(x)) !== -1, true, "Normal"); + y.elo = "foo"; + y.mar = "wew"; + a(["elo", "mar"].indexOf(t(y)) !== -1, true, "Null extension"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/flatten.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/flatten.js new file mode 100644 index 00000000..277a97cf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/flatten.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }), + { aa: 1, ab: 2, ba: 3, bb: 4 }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/for-each.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/for-each.js new file mode 100644 index 00000000..97c6399a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/for-each.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { raz: 1, dwa: 2, trzy: 3 } + , o2 = {}; + a(t(o, function (value, name) { + o2[name] = value; + }), undefined, "Return"); + a.deep(o2, o); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/get-property-names.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/get-property-names.js new file mode 100644 index 00000000..a1d6377f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/get-property-names.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { first: 1, second: 4 }, r1, r2; + o = Object.create(o, { + third: { value: null } + }); + o.first = 2; + o = Object.create(o); + o.fourth = 3; + + r1 = t(o); + r1.sort(); + r2 = ["first", "second", "third", "fourth"] + .concat(Object.getOwnPropertyNames(Object.prototype)); + r2.sort(); + a.deep(r1, r2); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-array-like.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-array-like.js new file mode 100644 index 00000000..50f5ce59 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-array-like.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function (t, a) { + a(t([]), true, "Array"); + a(t(""), true, "String"); + a( + t( + (function () { + return arguments; + })() + ), + true, + "Arguments" + ); + a(t({ length: 0 }), true, "List object"); + a(t(function () {}), false, "Function"); + a(t({}), false, "Plain object"); + a(t(/raz/), false, "Regexp"); + a(t(), false, "No argument"); + a(t(null), false, "Null"); + a(t(undefined), false, "Undefined"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-callable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-callable.js new file mode 100644 index 00000000..415023e3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-callable.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(function () {}), true, "Function"); + a(t({}), false, "Object"); + a(t(), false, "Undefined"); + a(t(null), false, "Null"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-copy-deep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-copy-deep.js new file mode 100644 index 00000000..9c8ad925 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-copy-deep.js @@ -0,0 +1,46 @@ +"use strict"; + +module.exports = function (t, a) { + var x, y; + + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, + "Different property value"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, + "Property only in source"); + a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, + "Property only in target"); + + a(t("raz", "dwa"), false, "String: diff"); + a(t("raz", "raz"), true, "String: same"); + a(t("32", 32), false, "String & Number"); + + a(t([1, "raz", true], [1, "raz", true]), true, "Array: same"); + a(t([1, "raz", undefined], [1, "raz"]), false, "Array: diff"); + a(t(["foo"], ["one"]), false, "Array: One value comparision"); + + x = { foo: { bar: { mar: {} } } }; + y = { foo: { bar: { mar: {} } } }; + a(t(x, y), true, "Deep"); + + a(t({ foo: { bar: { mar: "foo" } } }, { foo: { bar: { mar: {} } } }), + false, "Deep: false"); + + x = { foo: { bar: { mar: {} } } }; + x.rec = { foo: x }; + + y = { foo: { bar: { mar: {} } } }; + y.rec = { foo: x }; + + a(t(x, y), true, "Object: Infinite Recursion: Same #1"); + + x.rec.foo = y; + a(t(x, y), true, "Object: Infinite Recursion: Same #2"); + + x.rec.foo = x; + y.rec.foo = y; + a(t(x, y), true, "Object: Infinite Recursion: Same #3"); + + y.foo.bar.mar = "raz"; + a(t(x, y), false, "Object: Infinite Recursion: Diff"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-copy.js new file mode 100644 index 00000000..6052bb05 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-copy.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, + "Different property value"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, + "Property only in source"); + a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, + "Property only in target"); + + a(t("raz", "dwa"), false, "String: diff"); + a(t("raz", "raz"), true, "String: same"); + a(t("32", 32), false, "String & Number"); + + a(t([1, "raz", true], [1, "raz", true]), true, "Array: same"); + a(t([1, "raz", undefined], [1, "raz"]), false, "Array: diff"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-empty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-empty.js new file mode 100644 index 00000000..067b1621 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-empty.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), true, "Empty"); + a(t({ 1: 1 }), false, "Not empty"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-finite-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-finite-number.js new file mode 100644 index 00000000..6475fb66 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-finite-number.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(0), true, "Zero"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); + a(t(12), true, "Number"); + a(t(false), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t("asdfaf"), false, "String"); + a(t(""), true, "Empty String"); + if (typeof Symbol === "function") { + a(t(Symbol("test")), false, "Symbol"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-integer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-integer.js new file mode 100644 index 00000000..a0bcd5cd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-integer.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(2), true, "Number"); + a(t(-2), true, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), true, "Numeric string"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-natural-number-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-natural-number-value.js new file mode 100644 index 00000000..2bc2b1c8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-natural-number-value.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), true, "Numeric string"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-natural-number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-natural-number.js new file mode 100644 index 00000000..bb110e60 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-natural-number.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), true, "Null"); + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t("23"), true, "Numeric string"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-number-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-number-value.js new file mode 100644 index 00000000..2c09d251 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-number-value.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(0), true, "Zero"); + a(t(NaN), false, "NaN"); + a(t(Infinity), true, "Infinity"); + a(t(12), true, "Number"); + a(t(false), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t("asdfaf"), false, "String"); + a(t(""), true, "Empty String"); + if (typeof Symbol === "function") { + a(t(Symbol("test")), false, "Symbol"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-object.js new file mode 100644 index 00000000..0b835997 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-object.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(null), false, "Null"); + a(t(new Date()), true, "Date"); + a(t(new String("raz")), true, "String object"); + a(t({}), true, "Plain object"); + a(t(/a/), true, "Regular expression"); + a(t(function () {}), true, "Function"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-plain-function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-plain-function.js new file mode 100644 index 00000000..9c1f5ed3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-plain-function.js @@ -0,0 +1,42 @@ +"use strict"; + +var setPrototypeOf = require("../../object/set-prototype-of"); + +module.exports = function (t, a) { + a(t(function () {}), true, "Function"); + a(t({}), false, "Object"); + a(t(), false, "Undefined"); + a(t(null), false, "Null"); + if (setPrototypeOf) { + a( + t(Object.setPrototypeOf(function () {}, Object.prototype)), + false, + "Function with non-function prototype" + ); + } + var arrowfn; + try { + arrowfn = eval("(() => {})"); + } catch (e) {} + if (arrowfn) { + a(t(arrowfn), true, "Arrow function"); + } + + var classFn; + try { + classFn = eval("(class {})"); + } catch (e) {} + if (classFn) { + a(t(classFn), false, "Class"); + } + + var commentedClassFn; + try { + // Follows issue reported to ljhard/is-callable project: + // https://github.com/ljharb/is-callable/issues/4 + commentedClassFn = eval("(class/*kkk*/\n//blah\n Bar\n//blah\n {})"); + } catch (e) {} + if (commentedClassFn) { + a(t(commentedClassFn, false, "Class"), false, "Class with comments"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-plain-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-plain-object.js new file mode 100644 index 00000000..7324438d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-plain-object.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + a(t({}), true, "Empty {} is plain object"); + a(t({ a: true }), true, "{} with property is plain object"); + a(t({ prototype: 1, constructor: 2, __proto__: 3 }), true, + "{} with any property keys is plain object"); + a(t(null), false, "Null is not plain object"); + a(t("string"), false, "Primitive is not plain object"); + a(t(function () {}), false, "Function is not plain object"); + a(t(Object.create({})), false, + "Object whose prototype is not Object.prototype is not plain object"); + a(t(Object.create(Object.prototype)), true, + "Object whose prototype is Object.prototype is plain object"); + a(t(Object.create(null)), true, + "Object whose prototype is null is plain object"); + a(t(Object.prototype), false, "Object.prototype"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-promise.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-promise.js new file mode 100644 index 00000000..18bf934d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-promise.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var promise; + a(t(), false); + a(t(null), false); + a(t("promise"), false); + a(t({}), false); + a(t(function () {}), false); + a(t({ then: {} }), false); + a(t({ then: function () {} }), true); + promise = function () {}; + promise.then = {}; + a(t(promise), false); + promise.then = function () {}; + a(t(promise), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-thenable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-thenable.js new file mode 100644 index 00000000..18bf934d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-thenable.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var promise; + a(t(), false); + a(t(null), false); + a(t("promise"), false); + a(t({}), false); + a(t(function () {}), false); + a(t({ then: {} }), false); + a(t({ then: function () {} }), true); + promise = function () {}; + promise.then = {}; + a(t(promise), false); + promise.then = function () {}; + a(t(promise), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-value.js new file mode 100644 index 00000000..c97722d0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is-value.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), false); + a(t(undefined), false); + a(t(null), false); + a(t(NaN), true); + a(t(0), true); + a(t(false), true); + a(t("null"), true); + a(t(""), true); + a(t({}), true); + a(t(Object.prototype), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is.js new file mode 100644 index 00000000..c94ed41c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/is.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var o = {}; + a(t(o, {}), false, "Different objects"); + a(t(o, o), true, "Same objects"); + a(t("1", "1"), true, "Same primitive"); + a(t("1", 1), false, "Different primitive types"); + a(t(NaN, NaN), true, "NaN"); + a(t(0, 0), true, "0,0"); + a(t(0, -0), false, "0,-0"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/key-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/key-of.js new file mode 100644 index 00000000..bf10ca03 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/key-of.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + var x = {}, y = {} + , o = { foo: "bar", raz: x, trzy: "cztery", five: "6" }; + + a(t(o, "bar"), "foo", "First property"); + a(t(o, 6), null, "Primitive that's not there"); + a(t(o, x), "raz", "Object"); + a(t(o, y), null, "Object that's not there"); + a(t(o, "6"), "five", "Last property"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/implement.js new file mode 100644 index 00000000..3134886d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/implement.js @@ -0,0 +1,5 @@ +"use strict"; + +var isImplemented = require("../../../object/keys/is-implemented"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/is-implemented.js new file mode 100644 index 00000000..566411ce --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/is-implemented.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = function (t, a) { a(typeof t(), "boolean"); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/shim.js new file mode 100644 index 00000000..dc09f46b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/keys/shim.js @@ -0,0 +1,8 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ foo: "bar" }), ["foo"], "Object"); + a.deep(t("raz"), ["0", "1", "2"], "Primitive"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Undefined"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/map-keys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/map-keys.js new file mode 100644 index 00000000..4598db21 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/map-keys.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t({ 1: 1, 2: 2, 3: 3 }, function (key, value) { + return "x" + (key + value); + }), { x11: 1, x22: 2, x33: 3 }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/map.js new file mode 100644 index 00000000..78c1ed34 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/map.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + var obj = { 1: 1, 2: 2, 3: 3 }; + a.deep(t(obj, function (value, key, context) { + a(context, obj, "Context argument"); + return (value + 1) + key; + }), { 1: "21", 2: "32", 3: "43" }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/mixin-prototypes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/mixin-prototypes.js new file mode 100644 index 00000000..f510afb4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/mixin-prototypes.js @@ -0,0 +1,68 @@ +"use strict"; + +module.exports = function (t, a) { + var o, o1, o2, x, y = {}, z = {}; + o = { inherited: true, visible: 23 }; + o1 = Object.create(o); + o1.visible = z; + o1.nonremovable = "raz"; + Object.defineProperty(o1, "hidden", { value: "hidden" }); + + o2 = Object.defineProperties({}, { nonremovable: { value: y } }); + o2.other = "other"; + + try { t(o2, o1); } + catch (ignore) {} + + a(o2.visible, z, "Enumerable"); + a(o1.hidden, "hidden", "Not Enumerable"); + a(o2.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(o2.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable"); + + a(o2.inherited, true, "Extend deep"); + + a(o2.nonremovable, y, "Do not overwrite non configurable"); + a(o2.other, "other", "Own kept"); + + x = {}; + t(x, o2); + try { t(x, o1); } + catch (ignore) {} + + a(x.visible, z, "Enumerable"); + a(x.hidden, "hidden", "Not Enumerable"); + a(x.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(x.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable"); + + a(x.inherited, true, "Extend deep"); + + a(x.nonremovable, y, "Ignored non configurable"); + a(x.other, "other", "Other"); + + x.visible = 3; + a(x.visible, 3, "Writable is writable"); + + x = {}; + t(x, o1); + a.throws(function () { x.hidden = 3; }, "Not writable is not writable"); + + x = {}; + t(x, o1); + delete x.visible; + a.ok(!x.hasOwnProperty("visible"), "Configurable is configurable"); + + x = {}; + t(x, o1); + a.throws(function () { delete x.hidden; }, "Not configurable is not configurable"); + + x = Object.defineProperty({}, "foo", { + configurable: false, + writable: true, + enumerable: false, + value: "bar" + }); + + try { t(x, { foo: "lorem" }); } + catch (ignore) {} + a(x.foo, "bar", "Writable, not enumerable"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/mixin.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/mixin.js new file mode 100644 index 00000000..d1905c17 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/mixin.js @@ -0,0 +1,75 @@ +"use strict"; + +module.exports = function (t, a) { + var o, o1, o2, x, y = {}, z = {}; + o = { inherited: true }; + o1 = Object.create(o); + o1.visible = z; + o1.nonremovable = "raz"; + Object.defineProperty(o1, "hidden", { value: "hidden" }); + + o2 = Object.defineProperties({}, { nonremovable: { value: y } }); + o2.other = "other"; + + try { + t(o2, o1); +} catch (ignore) {} + + a(o2.visible, z, "Enumerable"); + a(o1.hidden, "hidden", "Not Enumerable"); + a(o2.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(o2.propertyIsEnumerable("hidden"), false, + "Not enumerable is not enumerable"); + + a(o2.hasOwnProperty("inherited"), false, "Extend only own"); + a(o2.inherited, undefined, "Extend ony own: value"); + + a(o2.nonremovable, y, "Do not overwrite non configurable"); + a(o2.other, "other", "Own kept"); + + x = {}; + t(x, o2); + try { + t(x, o1); +} catch (ignore) {} + + a(x.visible, z, "Enumerable"); + a(x.hidden, "hidden", "Not Enumerable"); + a(x.propertyIsEnumerable("visible"), true, "Enumerable is enumerable"); + a(x.propertyIsEnumerable("hidden"), false, + "Not enumerable is not enumerable"); + + a(x.hasOwnProperty("inherited"), false, "Extend only own"); + a(x.inherited, undefined, "Extend ony own: value"); + + a(x.nonremovable, y, "Ignored non configurable"); + a(x.other, "other", "Other"); + + x.visible = 3; + a(x.visible, 3, "Writable is writable"); + + x = {}; + t(x, o1); + a.throws(function () { + x.hidden = 3; + }, "Not writable is not writable"); + + x = {}; + t(x, o1); + delete x.visible; + a.ok(!x.hasOwnProperty("visible"), "Configurable is configurable"); + + x = {}; + t(x, o1); + a.throws(function () { + delete x.hidden; + }, "Not configurable is not configurable"); + + x = Object.defineProperty({}, "foo", + { configurable: false, writable: true, enumerable: false, value: "bar" }); + + try { + t(x, { foo: "lorem" }); +} catch (ignore) {} + a(x.foo, "bar", "Writable, not enumerable"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/normalize-options.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/normalize-options.js new file mode 100644 index 00000000..028864fe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/normalize-options.js @@ -0,0 +1,46 @@ +"use strict"; + +var create = Object.create, defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var x = { foo: "raz", bar: "dwa" }, y; + y = t(x); + a.not(y, x, "Returns copy"); + a.deep(y, x, "Plain"); + + x = { raz: "one", dwa: "two" }; + defineProperty(x, "get", { + configurable: true, + enumerable: true, + get: function () { + return this.dwa; +} + }); + x = create(x); + x.trzy = "three"; + x.cztery = "four"; + x = create(x); + x.dwa = "two!"; + x.trzy = "three!"; + x.piec = "five"; + x.szesc = "six"; + + a.deep(t(x), { raz: "one", +dwa: "two!", +trzy: "three!", +cztery: "four", + piec: "five", +szesc: "six", +get: "two!" }, "Deep object"); + + a.deep(t({ marko: "raz", raz: "foo" }, x, { szesc: "elo", siedem: "bibg" }), + { marko: "raz", +raz: "one", +dwa: "two!", +trzy: "three!", +cztery: "four", + piec: "five", +szesc: "elo", +siedem: "bibg", +get: "two!" }, "Multiple options"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/primitive-set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/primitive-set.js new file mode 100644 index 00000000..b5083d5c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/primitive-set.js @@ -0,0 +1,15 @@ +"use strict"; + +var getPropertyNames = require("../../object/get-property-names") + , isPlainObject = require("../../object/is-plain-object"); + +module.exports = function (t, a) { + var x = t(); + a(isPlainObject(x), true, "Plain object"); + a.deep(getPropertyNames(x), [], "No properties"); + x.foo = "bar"; + a.deep(getPropertyNames(x), ["foo"], "Extensible"); + + a.deep(t("raz", "dwa", 3), { raz: true, dwa: true, 3: true }, + "Arguments handling"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/safe-traverse.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/safe-traverse.js new file mode 100644 index 00000000..acf49c0e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/safe-traverse.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + var obj = { foo: { bar: { lorem: 12 } } }; + a(t(obj), obj, "No props"); + a(t(obj, "foo"), obj.foo, "One"); + a(t(obj, "raz"), undefined, "One: Fail"); + a(t(obj, "foo", "bar"), obj.foo.bar, "Two"); + a(t(obj, "dsd", "raz"), undefined, "Two: Fail #1"); + a(t(obj, "foo", "raz"), undefined, "Two: Fail #2"); + a(t(obj, "foo", "bar", "lorem"), obj.foo.bar.lorem, "Three"); + a(t(obj, "dsd", "raz", "fef"), undefined, "Three: Fail #1"); + a(t(obj, "foo", "raz", "asdf"), undefined, "Three: Fail #2"); + a(t(obj, "foo", "bar", "asd"), undefined, "Three: Fail #3"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/serialize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/serialize.js new file mode 100644 index 00000000..f0ca800c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/serialize.js @@ -0,0 +1,45 @@ +"use strict"; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { + return raz + dwa; + }; + a(t(), "undefined", "Undefined"); + a(t(null), "null", "Null"); + a(t(null), "null", "Null"); + a(t("raz"), "\"raz\"", "String"); + a(t("raz\"ddwa\ntrzy"), "\"raz\\\"ddwa\\ntrzy\"", "String with escape"); + a(t(false), "false", "Booelean"); + a(t(fn), String(fn), "Function"); + + a(t(/raz-dwa/g), "/raz-dwa/g", "RegExp"); + a(t(new Date(1234567)), "new Date(1234567)", "Date"); + a(t([]), "[]", "Empty array"); + a( + t([undefined, false, null, "raz\"ddwa\ntrzy", fn, /raz/g, new Date(1234567), ["foo"]]), + "[undefined,false,null,\"raz\\\"ddwa\\ntrzy\"," + + String(fn) + + ",/raz/g,new Date(1234567),[\"foo\"]]", + "Rich Array" + ); + a(t({}), "{}", "Empty object"); + a( + t({ + raz: undefined, + dwa: false, + trzy: null, + cztery: "raz\"ddwa\ntrzy", + piec: fn, + szesc: /raz/g, + siedem: new Date(1234567), + osiem: ["foo", 32], + dziewiec: { foo: "bar", dwa: 343 } + }), + "{\"raz\":undefined,\"dwa\":false,\"trzy\":null,\"cztery\":\"raz\\\"ddwa\\ntrzy\"," + + "\"piec\":" + + String(fn) + + ",\"szesc\":/raz/g,\"siedem\":new Date(1234567),\"osiem\":[\"foo\",32]," + + "\"dziewiec\":{\"foo\":\"bar\",\"dwa\":343}}", + "Rich object" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/implement.js new file mode 100644 index 00000000..5b8fb9e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +var create = require("../../../object/create") + , isImplemented = require("../../../object/set-prototype-of/is-implemented"); + +module.exports = function (a) { + a(isImplemented(create), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/index.js new file mode 100644 index 00000000..23619b07 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/index.js @@ -0,0 +1,27 @@ +"use strict"; + +var create = require("../../../object/create") + + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, y = {}; + + if (t === null) return; + a(t(x, y), x, "Return self object"); + a(getPrototypeOf(x), y, "Object"); + a.throws(function () { + t(x); +}, TypeError, "Undefined"); + a.throws(function () { + t("foo"); +}, TypeError, "Primitive"); + a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); + x = create(null); + a.h1("Change null prototype"); + a(t(x, y), x, "Result"); + a(getPrototypeOf(x), y, "Prototype"); + a.h1("Set null prototype"); + a(t(y, null), y, "Result"); + a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/shim.js new file mode 100644 index 00000000..23619b07 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/set-prototype-of/shim.js @@ -0,0 +1,27 @@ +"use strict"; + +var create = require("../../../object/create") + + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, y = {}; + + if (t === null) return; + a(t(x, y), x, "Return self object"); + a(getPrototypeOf(x), y, "Object"); + a.throws(function () { + t(x); +}, TypeError, "Undefined"); + a.throws(function () { + t("foo"); +}, TypeError, "Primitive"); + a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); + x = create(null); + a.h1("Change null prototype"); + a(t(x, y), x, "Result"); + a(getPrototypeOf(x), y, "Prototype"); + a.h1("Set null prototype"); + a(t(y, null), y, "Result"); + a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/some.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/some.js new file mode 100644 index 00000000..97e5d772 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/some.js @@ -0,0 +1,23 @@ +"use strict"; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), true, "Succeeds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), false, "Fails"); + +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/to-array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/to-array.js new file mode 100644 index 00000000..cd11a05f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/to-array.js @@ -0,0 +1,15 @@ +"use strict"; + +module.exports = function (t, a) { + var o = { 1: 1, 2: 2, 3: 3 }, o1 = {} + , o2 = t(o, function (value, name, self) { + a(self, o, "Self"); + a(this, o1, "Scope"); + return value + Number(name); + }, o1); + a.deep(o2, [2, 4, 6]); + + t(o).sort().forEach(function (item) { + a.deep(item, [item[0], o[item[0]]], "Default"); + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/unserialize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/unserialize.js new file mode 100644 index 00000000..5af3c77f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/unserialize.js @@ -0,0 +1,41 @@ +"use strict"; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { + return raz + dwa; + }; + a(t("undefined"), undefined, "Undefined"); + a(t("null"), null, "Null"); + a(t("\"raz\""), "raz", "String"); + a(t("\"raz\\\"ddwa\\ntrzy\""), "raz\"ddwa\ntrzy", "String with escape"); + a(t("false"), false, "Booelean"); + a(String(t(String(fn))), String(fn), "Function"); + + a.deep(t("/raz-dwa/g"), /raz-dwa/g, "RegExp"); + a.deep(t("new Date(1234567)"), new Date(1234567), "Date"); + a.deep(t("[]"), [], "Empty array"); + a.deep( + t("[undefined,false,null,\"raz\\\"ddwa\\ntrzy\",/raz/g,new Date(1234567),[\"foo\"]]"), + [undefined, false, null, "raz\"ddwa\ntrzy", /raz/g, new Date(1234567), ["foo"]], + "Rich Array" + ); + a.deep(t("{}"), {}, "Empty object"); + a.deep( + t( + "{\"raz\":undefined,\"dwa\":false,\"trzy\":null,\"cztery\":\"raz\\\"ddwa\\ntrzy\"," + + "\"szesc\":/raz/g,\"siedem\":new Date(1234567),\"osiem\":[\"foo\",32]," + + "\"dziewiec\":{\"foo\":\"bar\",\"dwa\":343}}" + ), + { + raz: undefined, + dwa: false, + trzy: null, + cztery: "raz\"ddwa\ntrzy", + szesc: /raz/g, + siedem: new Date(1234567), + osiem: ["foo", 32], + dziewiec: { foo: "bar", dwa: 343 } + }, + "Rich object" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-callable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-callable.js new file mode 100644 index 00000000..fb7310c8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-callable.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + var f = function () {}; + a(t(f), f, "Function"); + a.throws(function () { + t({}); + }, "Not Function"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-object.js new file mode 100644 index 00000000..b33be977 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-object.js @@ -0,0 +1,25 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { + t(0); +}, TypeError, "0"); + a.throws(function () { + t(false); +}, TypeError, "false"); + a.throws(function () { + t(""); +}, TypeError, "''"); + a(t(x = {}), x, "Object"); + a(t(x = function () {}), x, "Function"); + a(t(x = new String("raz")), x, "String object"); // Jslint: ignore + a(t(x = new Date()), x, "Date"); + + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "null"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-value.js new file mode 100644 index 00000000..394f89f7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/valid-value.js @@ -0,0 +1,19 @@ +"use strict"; + +var numIsNaN = require("../../number/is-nan"); + +module.exports = function (t, a) { + var x; + a(t(0), 0, "0"); + a(t(false), false, "false"); + a(t(""), "", "''"); + a(numIsNaN(t(NaN)), true, "NaN"); + a(t(x = {}), x, "{}"); + + a.throws(function () { + t(); + }, "Undefined"); + a.throws(function () { + t(null); + }, "null"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-array-like-object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-array-like-object.js new file mode 100644 index 00000000..b10ec69b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-array-like-object.js @@ -0,0 +1,29 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { + t(0); +}, TypeError, "0"); + a.throws(function () { + t(false); +}, TypeError, "false"); + a.throws(function () { + t(""); +}, TypeError, "String"); + a.throws(function () { + t({}); +}, TypeError, "Plain Object"); + a.throws(function () { + t(function () {}); +}, TypeError, "Function"); + a(t(x = new String("raz")), x, "String object"); // Jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "null"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-array-like.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-array-like.js new file mode 100644 index 00000000..6da6b191 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-array-like.js @@ -0,0 +1,27 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { + t(0); +}, TypeError, "0"); + a.throws(function () { + t(false); +}, TypeError, "false"); + a(t(""), "", "''"); + a.throws(function () { + t({}); +}, TypeError, "Plain Object"); + a.throws(function () { + t(function () {}); +}, TypeError, "Function"); + a(t(x = new String("raz")), x, "String object"); // Jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "null"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-stringifiable-value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-stringifiable-value.js new file mode 100644 index 00000000..8283814a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-stringifiable-value.js @@ -0,0 +1,22 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t(null); +}, TypeError, "Null"); + a(t(0), "0"); + a(t(false), "false"); + a(t(""), ""); + a(t({}), String({}), "Object"); + a(t(x = function () {}), String(x), "Function"); + a(t(x = new String("raz")), String(x), "String object"); // Jslint: ignore + a(t(x = new Date()), String(x), "Date"); + + a.throws(function () { + t(Object.create(null)); +}, TypeError, "Null prototype object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-stringifiable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-stringifiable.js new file mode 100644 index 00000000..e75a4157 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/object/validate-stringifiable.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = function (t, a) { + var x; + a(t(), "undefined", "Undefined"); + a(t(null), "null", "Null"); + a(t(0), "0"); + a(t(false), "false"); + a(t(""), ""); + a(t({}), String({}), "Object"); + a(t(x = function () {}), String(x), "Function"); + a(t(x = new String("raz")), String(x), "String object"); // Jslint: ignore + a(t(x = new Date()), String(x), "Date"); + + a.throws(function () { + t(Object.create(null)); +}, TypeError, "Null prototype object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/optional-chaining.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/optional-chaining.js new file mode 100644 index 00000000..1f7d4056 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/optional-chaining.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (t, a) { + var obj = { foo: { bar: "elo", par: null } }; + a(t(), undefined); + a(t(null), null); + a(t(obj), obj); + a(t(obj, "foo"), obj.foo); + a(t(obj, "foo", "bar"), "elo"); + a(t(obj, "foo", "bar", "slice"), String.prototype.slice); + a(t(obj, "foo", "par"), null); + a(t(obj, "foo", "par", "marko"), undefined); + a(t(obj, "marko"), undefined); + a(t(""), ""); + a(t("", "foo"), undefined); + a(t("", "slice"), String.prototype.slice); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/as-callback.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/as-callback.js new file mode 100644 index 00000000..528d766a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/as-callback.js @@ -0,0 +1,32 @@ +"use strict"; + +module.exports = function (t, a) { + if (typeof Promise !== "function") return null; + return { + Success: function (d) { + t.call( + new Promise(function (resolve) { + resolve("foo"); + }), + function (error, value) { + a(error, null); + a(value, "foo"); + d(); + } + ); + }, + Failure: function (d) { + var error = new Error("Rejection"); + t.call( + new Promise(function (resolve, reject) { + reject(error); + }), + function (passedError, value) { + a(passedError, error); + a(value, undefined); + d(); + } + ); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/implement.js new file mode 100644 index 00000000..94401862 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../promise/#/finally/is-implemented"); + +if (typeof Promise !== "function") global.Promise = require("plain-promise"); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/shim.js new file mode 100644 index 00000000..a92fab85 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/#/finally/shim.js @@ -0,0 +1,75 @@ +"use strict"; + +var microtaskDelay = require("../../../../function/#/microtask-delay"); + +if (typeof Promise !== "function") global.Promise = require("plain-promise"); + +module.exports = function (t, a) { + return { + Success: function (d) { + var invoked; + t.call(Promise.resolve("foo"), function () { + invoked = true; + return "bar"; + }).then( + microtaskDelay.call(function (result) { + a(result, "foo"); + a(invoked, true); + d(); + }, microtaskDelay.call(d)) + ); + }, + Failure: function (d) { + var invoked; + var error = new Error("Some error"); + t.call(Promise.reject(error), function () { + invoked = true; + return "bar"; + }).then( + microtaskDelay.call(function () { + a.never(); + d(); + }), + microtaskDelay.call(function (result) { + a(result, error); + a(invoked, true); + d(); + }) + ); + }, + SuccessFinallyError: function (d) { + var invoked, finallyError = new Error("Finally error"); + t.call(Promise.resolve("foo"), function () { + invoked = true; + throw finallyError; + }).then( + microtaskDelay.call(function () { + a.never(); + d(); + }), + microtaskDelay.call(function (result) { + a(result, finallyError); + a(invoked, true); + d(); + }) + ); + }, + FailureFinallyError: function (d) { + var invoked, finallyError = new Error("Finally error"); + t.call(Promise.reject(new Error("Some error")), function () { + invoked = true; + throw finallyError; + }).then( + microtaskDelay.call(function () { + a.never(); + d(); + }), + microtaskDelay.call(function (result) { + a(result, finallyError); + a(invoked, true); + d(); + }) + ); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/.eslintrc.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/.eslintrc.json new file mode 100644 index 00000000..b8acafa7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "globals": { "Promise": true, "setTimeout": true } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/lazy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/lazy.js new file mode 100644 index 00000000..8c7a5bfa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/promise/lazy.js @@ -0,0 +1,52 @@ +"use strict"; + +module.exports = function (t) { + if (typeof Promise !== "function") return null; // Run tests only in ES2015+ env + + return { + "Delays execution": function (a, d) { + var invoked = false; + var promise = t(function (resolve) { + invoked = true; + setTimeout(function () { + resolve(20); + }, 10); + }); + + a(invoked, false); + + setTimeout(function () { + a(invoked, false); + promise.then(function (value) { + a(value, 20); + setTimeout(d, 0); // Escape error swallowing + }); + a(invoked, true); + }, 15); + }, + "Passes rejection": function (a, d) { + var promise = t(function (resolve, reject) { + setTimeout(function () { + reject(new Error("Stop")); + }, 10); + }); + + promise.catch(function (error) { + a(error instanceof Error, true); + a(error.message, "Stop"); + setTimeout(d, 0); // Escape error swallowing + }); + }, + "Passes sync exception": function (a, d) { + var promise = t(function () { + throw new Error("Stop"); + }); + + promise.catch(function (error) { + a(error instanceof Error, true); + a(error.message, "Stop"); + setTimeout(d, 0); // Escape error swallowing + }); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/index.js new file mode 100644 index 00000000..7ab9ab8a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/index.js @@ -0,0 +1,15 @@ +/* eslint-env node */ + +"use strict"; + +var indexTest = require("tad/lib/utils/index-test") + , path = require("path").resolve(__dirname, "../../../reg-exp/#"); + +module.exports = function (t, a, d) { + indexTest( + indexTest.readDir(path).aside(function (data) { + delete data.sticky; + delete data.unicode; + }) + )(t, a, d); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/is-sticky.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/is-sticky.js new file mode 100644 index 00000000..e65740e7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/is-sticky.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var re; + a(t.call(/raz/), false, "Normal"); + a(t.call(/raz/g), false, "Global"); + try { + // eslint-disable-next-line no-invalid-regexp + re = new RegExp("raz", "y"); + } catch (ignore) {} + if (!re) return; + a(t.call(re), true, "Sticky"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/is-unicode.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/is-unicode.js new file mode 100644 index 00000000..86217aa0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/is-unicode.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = function (t, a) { + var re; + a(t.call(/raz/), false, "Normal"); + a(t.call(/raz/g), false, "Global"); + try { + // eslint-disable-next-line no-invalid-regexp + re = new RegExp("raz", "u"); + } catch (ignore) {} + if (!re) return; + a(t.call(re), true, "Unicode"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/implement.js new file mode 100644 index 00000000..633d9bb6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/match/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/shim.js new file mode 100644 index 00000000..c6fedb57 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/match/shim.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + var result = "foobar".match(/foo/); + a.deep(t.call(/foo/, "foobar"), result); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/implement.js new file mode 100644 index 00000000..7da5e669 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/replace/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/shim.js new file mode 100644 index 00000000..4178065d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/replace/shim.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(/foo/, "foobar", "mar"), "marbar"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/implement.js new file mode 100644 index 00000000..ded73e27 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/search/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/shim.js new file mode 100644 index 00000000..779b1327 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/search/shim.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(/foo/, "barfoo"), 3); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/implement.js new file mode 100644 index 00000000..4ef532bd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/split/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/shim.js new file mode 100644 index 00000000..a01250e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/split/shim.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a.deep(t.call(/\|/, "bar|foo"), ["bar", "foo"]); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js new file mode 100644 index 00000000..d7e59bf9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/sticky/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js new file mode 100644 index 00000000..9cb2b379 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../reg-exp/#/unicode/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/escape.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/escape.js new file mode 100644 index 00000000..9478f523 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/escape.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + var str = "(?:^te|er)s{2}t\\[raz]+$"; + a(RegExp("^" + t(str) + "$").test(str), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/is-reg-exp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/is-reg-exp.js new file mode 100644 index 00000000..7727eaba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/is-reg-exp.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t("arar"), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new String("raz")), false, "String object"); + a(t({}), false, "Plain object"); + a(t(/a/), true, "Regular expression"); + a(t(new RegExp("a")), true, "Regular expression via constructor"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js new file mode 100644 index 00000000..2f99441b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js @@ -0,0 +1,19 @@ +"use strict"; + +module.exports = function (t, a) { + var r = /raz/; + a(t(r), r, "Direct"); + r = new RegExp("foo"); + a(t(r), r, "Constructor"); + a.throws(function () { + t({}); + }, "Object"); + a.throws(function () { + t(function () {}); + }, "Function"); + a.throws(function () { + t({ exec: function () { + return 20; +} }); + }, "Plain object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/safe-to-string.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/safe-to-string.js new file mode 100644 index 00000000..8f545e5b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/safe-to-string.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(), "undefined"); + a(t(null), "null"); + a(t(10), "10"); + a(t("str"), "str"); + a(t({ toString: function () { return "miszka"; } }), "miszka"); + // eslint-disable-next-line symbol-description + if (typeof Symbol === "function") a(t(Symbol()), "Symbol()"); + a(t(Object.create(null)), ""); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/implement.js new file mode 100644 index 00000000..c984fb26 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/@@iterator/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/shim.js new file mode 100644 index 00000000..467cdc35 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/@@iterator/shim.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + var it = t.call("r💩z"); + a.deep(it.next(), { done: false, value: "r" }, "#1"); + a.deep(it.next(), { done: false, value: "💩" }, "#2"); + a.deep(it.next(), { done: false, value: "z" }, "#3"); + a.deep(it.next(), { done: true, value: undefined }, "End"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/at.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/at.js new file mode 100644 index 00000000..a614f938 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/at.js @@ -0,0 +1,132 @@ +/* eslint no-useless-call: "off" */ +// See tests at https://github.com/mathiasbynens/String.prototype.at + +"use strict"; + +module.exports = function (t, a) { + a(t.length, 1, "Length"); + + a.h1("BMP"); + a(t.call("abc\uD834\uDF06def", -Infinity), "", "-Infinity"); + a(t.call("abc\uD834\uDF06def", -1), "", "-1"); + a(t.call("abc\uD834\uDF06def", -0), "a", "-0"); + a(t.call("abc\uD834\uDF06def", +0), "a", "+0"); + a(t.call("abc\uD834\uDF06def", 1), "b", "1"); + a(t.call("abc\uD834\uDF06def", 3), "\uD834\uDF06", "3"); + a(t.call("abc\uD834\uDF06def", 4), "\uDF06", "4"); + a(t.call("abc\uD834\uDF06def", 5), "d", "5"); + a(t.call("abc\uD834\uDF06def", 42), "", "42"); + a(t.call("abc\uD834\uDF06def", Number(Infinity)), "", "+Infinity"); + a(t.call("abc\uD834\uDF06def", null), "a", "null"); + a(t.call("abc\uD834\uDF06def", undefined), "a", "undefined"); + a(t.call("abc\uD834\uDF06def"), "a", "No argument"); + a(t.call("abc\uD834\uDF06def", false), "a", "false"); + a(t.call("abc\uD834\uDF06def", NaN), "a", "NaN"); + a(t.call("abc\uD834\uDF06def", ""), "a", "Empty string"); + a(t.call("abc\uD834\uDF06def", "_"), "a", "_"); + a(t.call("abc\uD834\uDF06def", "1"), "b", "'1'"); + a(t.call("abc\uD834\uDF06def", []), "a", "[]"); + a(t.call("abc\uD834\uDF06def", {}), "a", "{}"); + a(t.call("abc\uD834\uDF06def", -0.9), "a", "-0.9"); + a(t.call("abc\uD834\uDF06def", 1.9), "b", "1.9"); + a(t.call("abc\uD834\uDF06def", 7.9), "f", "7.9"); + a(t.call("abc\uD834\uDF06def", Math.pow(2, 32)), "", "Big number"); + + a.h1("Astral symbol"); + a(t.call("\uD834\uDF06def", -Infinity), "", "-Infinity"); + a(t.call("\uD834\uDF06def", -1), "", "-1"); + a(t.call("\uD834\uDF06def", -0), "\uD834\uDF06", "-0"); + a(t.call("\uD834\uDF06def", +0), "\uD834\uDF06", "+0"); + a(t.call("\uD834\uDF06def", 1), "\uDF06", "1"); + a(t.call("\uD834\uDF06def", 2), "d", "2"); + a(t.call("\uD834\uDF06def", 3), "e", "3"); + a(t.call("\uD834\uDF06def", 4), "f", "4"); + a(t.call("\uD834\uDF06def", 42), "", "42"); + a(t.call("\uD834\uDF06def", Number(Infinity)), "", "+Infinity"); + a(t.call("\uD834\uDF06def", null), "\uD834\uDF06", "null"); + a(t.call("\uD834\uDF06def", undefined), "\uD834\uDF06", "undefined"); + a(t.call("\uD834\uDF06def"), "\uD834\uDF06", "No arguments"); + a(t.call("\uD834\uDF06def", false), "\uD834\uDF06", "false"); + a(t.call("\uD834\uDF06def", NaN), "\uD834\uDF06", "NaN"); + a(t.call("\uD834\uDF06def", ""), "\uD834\uDF06", "Empty string"); + a(t.call("\uD834\uDF06def", "_"), "\uD834\uDF06", "_"); + a(t.call("\uD834\uDF06def", "1"), "\uDF06", "'1'"); + + a.h1("Lone high surrogates"); + a(t.call("\uD834abc", -Infinity), "", "-Infinity"); + a(t.call("\uD834abc", -1), "", "-1"); + a(t.call("\uD834abc", -0), "\uD834", "-0"); + a(t.call("\uD834abc", +0), "\uD834", "+0"); + a(t.call("\uD834abc", 1), "a", "1"); + a(t.call("\uD834abc", 42), "", "42"); + a(t.call("\uD834abc", Number(Infinity)), "", "Infinity"); + a(t.call("\uD834abc", null), "\uD834", "null"); + a(t.call("\uD834abc", undefined), "\uD834", "undefined"); + a(t.call("\uD834abc"), "\uD834", "No arguments"); + a(t.call("\uD834abc", false), "\uD834", "false"); + a(t.call("\uD834abc", NaN), "\uD834", "NaN"); + a(t.call("\uD834abc", ""), "\uD834", "Empty string"); + a(t.call("\uD834abc", "_"), "\uD834", "_"); + a(t.call("\uD834abc", "1"), "a", "'a'"); + + a.h1("Lone low surrogates"); + a(t.call("\uDF06abc", -Infinity), "", "-Infinity"); + a(t.call("\uDF06abc", -1), "", "-1"); + a(t.call("\uDF06abc", -0), "\uDF06", "-0"); + a(t.call("\uDF06abc", +0), "\uDF06", "+0"); + a(t.call("\uDF06abc", 1), "a", "1"); + a(t.call("\uDF06abc", 42), "", "42"); + a(t.call("\uDF06abc", Number(Infinity)), "", "+Infinity"); + a(t.call("\uDF06abc", null), "\uDF06", "null"); + a(t.call("\uDF06abc", undefined), "\uDF06", "undefined"); + a(t.call("\uDF06abc"), "\uDF06", "No arguments"); + a(t.call("\uDF06abc", false), "\uDF06", "false"); + a(t.call("\uDF06abc", NaN), "\uDF06", "NaN"); + a(t.call("\uDF06abc", ""), "\uDF06", "Empty string"); + a(t.call("\uDF06abc", "_"), "\uDF06", "_"); + a(t.call("\uDF06abc", "1"), "a", "'1'"); + + a.h1("Context"); + a.throws( + function () { + t.call(undefined); + }, + TypeError, + "Undefined" + ); + a.throws( + function () { + t.call(undefined, 4); + }, + TypeError, + "Undefined + argument" + ); + a.throws( + function () { + t.call(null); + }, + TypeError, + "Null" + ); + a.throws( + function () { + t.call(null, 4); + }, + TypeError, + "Null + argument" + ); + a(t.call(42, 0), "4", "Number #1"); + a(t.call(42, 1), "2", "Number #2"); + a( + t.call( + { + toString: function () { + return "abc"; + } + }, + 2 + ), + "c", + "Object" + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/camel-to-hyphen.js new file mode 100644 index 00000000..bbf9ae48 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/camel-to-hyphen.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("razDwaTRzy4yFoo45My"), "raz-dwa-t-rzy4y-foo45-my"); + a(t.call("razDwaTRzy4yFoo45My-"), "raz-dwa-t-rzy4y-foo45-my-"); + a(t.call("razDwaTRzy4yFoo45My--"), "raz-dwa-t-rzy4y-foo45-my--"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/capitalize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/capitalize.js new file mode 100644 index 00000000..884ae9cb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/capitalize.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz"), "Raz", "Word"); + a(t.call("BLA"), "BLA", "Uppercase"); + a(t.call(""), "", "Empty"); + a(t.call("a"), "A", "One letter"); + a(t.call("this is a test"), "This is a test", "Sentence"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/case-insensitive-compare.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/case-insensitive-compare.js new file mode 100644 index 00000000..8117f920 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/case-insensitive-compare.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("AA", "aa"), 0, "Same"); + a.ok(t.call("Amber", "zebra") < 0, "Less"); + a.ok(t.call("Zebra", "amber") > 0, "Greater"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/implement.js new file mode 100644 index 00000000..f966c535 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/implement.js @@ -0,0 +1,8 @@ +"use strict"; + +var isImplemented = + require("../../../../string/#/code-point-at/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/shim.js new file mode 100644 index 00000000..40d62766 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/code-point-at/shim.js @@ -0,0 +1,119 @@ +/* eslint no-useless-call: "off" */ + +// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt +// /blob/master/tests/tests.js + +"use strict"; + +module.exports = function (t, a) { + a(t.length, 1, "Length"); + + // String that starts with a BMP symbol + a(t.call("abc\uD834\uDF06def", ""), 0x61); + a(t.call("abc\uD834\uDF06def", "_"), 0x61); + a(t.call("abc\uD834\uDF06def"), 0x61); + a(t.call("abc\uD834\uDF06def", -Infinity), undefined); + a(t.call("abc\uD834\uDF06def", -1), undefined); + a(t.call("abc\uD834\uDF06def", -0), 0x61); + a(t.call("abc\uD834\uDF06def", 0), 0x61); + a(t.call("abc\uD834\uDF06def", 3), 0x1d306); + a(t.call("abc\uD834\uDF06def", 4), 0xdf06); + a(t.call("abc\uD834\uDF06def", 5), 0x64); + a(t.call("abc\uD834\uDF06def", 42), undefined); + a(t.call("abc\uD834\uDF06def", Infinity), undefined); + a(t.call("abc\uD834\uDF06def", Infinity), undefined); + a(t.call("abc\uD834\uDF06def", NaN), 0x61); + a(t.call("abc\uD834\uDF06def", false), 0x61); + a(t.call("abc\uD834\uDF06def", null), 0x61); + a(t.call("abc\uD834\uDF06def", undefined), 0x61); + + // String that starts with an astral symbol + a(t.call("\uD834\uDF06def", ""), 0x1d306); + a(t.call("\uD834\uDF06def", "1"), 0xdf06); + a(t.call("\uD834\uDF06def", "_"), 0x1d306); + a(t.call("\uD834\uDF06def"), 0x1d306); + a(t.call("\uD834\uDF06def", -1), undefined); + a(t.call("\uD834\uDF06def", -0), 0x1d306); + a(t.call("\uD834\uDF06def", 0), 0x1d306); + a(t.call("\uD834\uDF06def", 1), 0xdf06); + a(t.call("\uD834\uDF06def", 42), undefined); + a(t.call("\uD834\uDF06def", false), 0x1d306); + a(t.call("\uD834\uDF06def", null), 0x1d306); + a(t.call("\uD834\uDF06def", undefined), 0x1d306); + + // Lone high surrogates + a(t.call("\uD834abc", ""), 0xd834); + a(t.call("\uD834abc", "_"), 0xd834); + a(t.call("\uD834abc"), 0xd834); + a(t.call("\uD834abc", -1), undefined); + a(t.call("\uD834abc", -0), 0xd834); + a(t.call("\uD834abc", 0), 0xd834); + a(t.call("\uD834abc", false), 0xd834); + a(t.call("\uD834abc", NaN), 0xd834); + a(t.call("\uD834abc", null), 0xd834); + a(t.call("\uD834abc", undefined), 0xd834); + + // Lone low surrogates + a(t.call("\uDF06abc", ""), 0xdf06); + a(t.call("\uDF06abc", "_"), 0xdf06); + a(t.call("\uDF06abc"), 0xdf06); + a(t.call("\uDF06abc", -1), undefined); + a(t.call("\uDF06abc", -0), 0xdf06); + a(t.call("\uDF06abc", 0), 0xdf06); + a(t.call("\uDF06abc", false), 0xdf06); + a(t.call("\uDF06abc", NaN), 0xdf06); + a(t.call("\uDF06abc", null), 0xdf06); + a(t.call("\uDF06abc", undefined), 0xdf06); + + a.throws(function () { + t.call(undefined); + }, TypeError); + a.throws(function () { + t.call(undefined, 4); + }, TypeError); + a.throws(function () { + t.call(null); + }, TypeError); + a.throws(function () { + t.call(null, 4); + }, TypeError); + a(t.call(42, 0), 0x34); + a(t.call(42, 1), 0x32); + a( + t.call( + { + toString: function () { + return "abc"; + } + }, + 2 + ), + 0x63 + ); + + a.throws(function () { + t.apply(undefined); + }, TypeError); + a.throws(function () { + t.apply(undefined, [4]); + }, TypeError); + a.throws(function () { + t.apply(null); + }, TypeError); + a.throws(function () { + t.apply(null, [4]); + }, TypeError); + a(t.apply(42, [0]), 0x34); + a(t.apply(42, [1]), 0x32); + a( + t.apply( + { + toString: function () { + return "abc"; + } + }, + [2] + ), + 0x63 + ); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/implement.js new file mode 100644 index 00000000..297a832f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/contains/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/shim.js new file mode 100644 index 00000000..0a73671d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/contains/shim.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz", ""), true, "Empty"); + a(t.call("", ""), true, "Both Empty"); + a(t.call("raz", "raz"), true, "Same"); + a(t.call("razdwa", "raz"), true, "Starts with"); + a(t.call("razdwa", "dwa"), true, "Ends with"); + a(t.call("razdwa", "zdw"), true, "In middle"); + a(t.call("", "raz"), false, "Something in empty"); + a(t.call("az", "raz"), false, "Longer"); + a(t.call("azasdfasdf", "azff"), false, "Not found"); + a(t.call("razdwa", "raz", 1), false, "Position"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/count.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/count.js new file mode 100644 index 00000000..d259c901 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/count.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + a.throws(function () { + t.call("", ""); + }); + a(t.call("x", "x"), 1); + a(t.call("xx", "x"), 2); + a(t.call("xxx", "xx"), 1); + a(t.call("xxxx", "xx"), 2); + a(t.call("xx", "xxx"), 0); + a(t.call("", "elo"), 0); + a(t.call("fooo", "foofooo"), 0); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/implement.js new file mode 100644 index 00000000..5a2ca3cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/ends-with/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/shim.js new file mode 100644 index 00000000..75398833 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/ends-with/shim.js @@ -0,0 +1,16 @@ +// In some parts copied from: +// http://closure-library.googlecode.com/svn/trunk/closure/goog/ +// string/string_test.html + +"use strict"; + +module.exports = function (t, a) { + a(t.call("abc", ""), true, "Empty needle"); + a(t.call("abcd", "cd"), true, "Ends with needle"); + a(t.call("abcd", "abcd"), true, "Needle equals haystack"); + a(t.call("abcd", "ab"), false, "Doesn't end with needle"); + a(t.call("abc", "defg"), false, "Length trick"); + a(t.call("razdwa", "zd", 3), false, "Position: false"); + a(t.call("razdwa", "zd", 4), true, "Position: true"); + a(t.call("razdwa", "zd", 5), false, "Position: false #2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/hyphen-to-camel.js new file mode 100644 index 00000000..89c8161c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/hyphen-to-camel.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa"), "razDwaTRzy4yRtr4Tiu45Pa"); + a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa-"), "razDwaTRzy4yRtr4Tiu45Pa-"); + a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa--"), "razDwaTRzy4yRtr4Tiu45Pa--"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/indent.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/indent.js new file mode 100644 index 00000000..6b1dd895 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/indent.js @@ -0,0 +1,9 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("ra\nzz", ""), "ra\nzz", "Empty"); + a(t.call("ra\nzz", "\t", 3), "\t\t\tra\n\t\t\tzz", "String repeat"); + a(t.call("ra\nzz\nsss\nfff\n", "\t"), "\tra\n\tzz\n\tsss\n\tfff\n", + "Multi-line"); + a(t.call("ra\n\nzz\n", "\t"), "\tra\n\n\tzz\n", "Don't touch empty lines"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/last.js new file mode 100644 index 00000000..fea798d6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/last.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call(""), null, "Null"); + a(t.call("abcdef"), "f", "String"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/_data.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/_data.js new file mode 100644 index 00000000..96312119 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/_data.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t[0], "object"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/implement.js new file mode 100644 index 00000000..b053aa89 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/normalize/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/shim.js new file mode 100644 index 00000000..0c80aa40 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/normalize/shim.js @@ -0,0 +1,13 @@ +// Taken from: https://github.com/walling/unorm/blob/master/test/es6-shim.js + +"use strict"; + +var str = "äiti"; + +module.exports = function (t, a) { + a(t.call(str), "\u00e4iti"); + a(t.call(str, "NFC"), "\u00e4iti"); + a(t.call(str, "NFD"), "a\u0308iti"); + a(t.call(str, "NFKC"), "\u00e4iti"); + a(t.call(str, "NFKD"), "a\u0308iti"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/pad.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/pad.js new file mode 100644 index 00000000..e573453f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/pad.js @@ -0,0 +1,24 @@ +"use strict"; + +var partial = require("../../../function/#/partial"); + +module.exports = { + Left: function (t, a) { + t = partial.call(t, "x", 5); + + a(t.call("yy"), "xxxyy"); + a(t.call(""), "xxxxx", "Empty string"); + + a(t.call("yyyyy"), "yyyyy", "Equal length"); + a(t.call("yyyyyyy"), "yyyyyyy", "Longer"); + }, + Right: function (t, a) { + t = partial.call(t, "x", -5); + + a(t.call("yy"), "yyxxx"); + a(t.call(""), "xxxxx", "Empty string"); + + a(t.call("yyyyy"), "yyyyy", "Equal length"); + a(t.call("yyyyyyy"), "yyyyyyy", "Longer"); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/plain-replace-all.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/plain-replace-all.js new file mode 100644 index 00000000..e5f801c6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/plain-replace-all.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic"); + a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts"); + a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace"); + + a(t.call("$raz$$dwa$trzy$", "$", "&&"), "&&raz&&&&dwa&&trzy&&", "Multi"); + a(t.call("$raz$$dwa$$$$trzy$", "$$", "&"), "$raz&dwa&&trzy$", + "Multi many chars"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/plain-replace.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/plain-replace.js new file mode 100644 index 00000000..9f6c2bee --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/plain-replace.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic"); + a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts"); + a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/implement.js new file mode 100644 index 00000000..27096289 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/repeat/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/shim.js new file mode 100644 index 00000000..c5848840 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/repeat/shim.js @@ -0,0 +1,12 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("a", 0), "", "Empty"); + a(t.call("a", 1), "a", "1"); + a(t.call("a", 2), "aa", "2"); + a(t.call("\t", 5), "\t\t\t\t\t", "Whitespace"); + a(t.call("raz", 3), "razrazraz", "Many chars"); + a(t.call("raz", 3), "razrazraz", "Many chars"); + a(t.call("razfoobar", 5), "razfoobarrazfoobarrazfoobarrazfoobarrazfoobar", "Many chars"); + a(t.call("a", 300).length, 300); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/implement.js new file mode 100644 index 00000000..d1f1ce25 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../../string/#/starts-with/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/shim.js new file mode 100644 index 00000000..4b5e4e40 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/starts-with/shim.js @@ -0,0 +1,14 @@ +// Inspired and in some parts copied from: +// http://closure-library.googlecode.com/svn/trunk/closure/goog +// /string/string_test.html + +"use strict"; + +module.exports = function (t, a) { + a(t.call("abc", ""), true, "Empty needle"); + a(t.call("abcd", "ab"), true, "Starts with needle"); + a(t.call("abcd", "abcd"), true, "Needle equals haystack"); + a(t.call("abcd", "bcde", 1), false, "Needle larger than haystack"); + a(!t.call("abcd", "cd"), true, "Doesn't start with needle"); + a(t.call("abcd", "bc", 1), true, "Position"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/uncapitalize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/uncapitalize.js new file mode 100644 index 00000000..cddd847c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/#/uncapitalize.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = function (t, a) { + a(t.call("raz"), "raz", "Word"); + a(t.call("BLA"), "bLA", "Uppercase"); + a(t.call(""), "", "Empty"); + a(t.call("a"), "a", "One letter"); + a(t.call("this is a test"), "this is a test", "Sentence"); + a(t.call("This is a test"), "this is a test", "Capitalized sentence"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/format-method.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/format-method.js new file mode 100644 index 00000000..d0c216b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/format-method.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = function (t, a) { + t = t({ + a: "A", + aa: "B", + ab: "C", + b: "D", + c: function () { + return ++this.a; + } + }); + a(t.call({ a: 0 }, " %a%aab%abb%b\\%aa%ab%c%c "), " ABbCbD%aaC12 "); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/implement.js new file mode 100644 index 00000000..31ed7b5b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../string/from-code-point/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/shim.js new file mode 100644 index 00000000..023931f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/from-code-point/shim.js @@ -0,0 +1,73 @@ +// Taken from: https://github.com/mathiasbynens/String.fromCodePoint/blob/master +// /tests/tests.js + +"use strict"; + +var pow = Math.pow; + +module.exports = function (t, a) { + var counter, result; + + a(t.length, 1, "Length"); + a(String.propertyIsEnumerable("fromCodePoint"), false, "Not enumerable"); + + a(t(""), "\0", "Empty string"); + a(t(), "", "No arguments"); + a(t(-0), "\0", "-0"); + a(t(0), "\0", "0"); + a(t(0x1D306), "\uD834\uDF06", "Unicode"); + a(t(0x1D306, 0x61, 0x1D307), "\uD834\uDF06a\uD834\uDF07", "Complex unicode"); + a(t(0x61, 0x62, 0x1D307), "ab\uD834\uDF07", "Complex"); + a(t(false), "\0", "false"); + a(t(null), "\0", "null"); + + a.throws(function () { + t("_"); +}, RangeError, "_"); + a.throws(function () { + t(Infinity); +}, RangeError, "Infinity"); + a.throws(function () { + t(-Infinity); +}, RangeError, "-Infinity"); + a.throws(function () { + t(-1); +}, RangeError, "-1"); + a.throws(function () { + t(0x10FFFF + 1); +}, RangeError, "Range error #1"); + a.throws(function () { + t(3.14); +}, RangeError, "Range error #2"); + a.throws(function () { + t(3e-2); +}, RangeError, "Range error #3"); + a.throws(function () { + t(-Infinity); +}, RangeError, "Range error #4"); + a.throws(function () { + t(Number(Infinity)); +}, RangeError, "Range error #5"); + a.throws(function () { + t(NaN); +}, RangeError, "Range error #6"); + a.throws(function () { + t(undefined); +}, RangeError, "Range error #7"); + a.throws(function () { + t({}); +}, RangeError, "Range error #8"); + a.throws(function () { + t(/re/); +}, RangeError, "Range error #9"); + + counter = pow(2, 15) * 3 / 2; + result = []; + while (--counter >= 0) result.push(0); // One code unit per symbol + t.apply(null, result); // Must not throw + + counter = pow(2, 15) * 3 / 2; + result = []; + while (--counter >= 0) result.push(0xFFFF + 1); // Two code units per symbol + t.apply(null, result); // Must not throw +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/is-string.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/is-string.js new file mode 100644 index 00000000..0e831221 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/is-string.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (t, a) { + a(t(null), false, "Null"); + a(t(""), true, "Empty string"); + a(t(12), false, "Number"); + a(t(false), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new String("raz")), true, "String object"); + a(t("asdfaf"), true, "String"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/random-uniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/random-uniq.js new file mode 100644 index 00000000..3b6d889a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/random-uniq.js @@ -0,0 +1,14 @@ +"use strict"; + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +module.exports = function (t, a) { + a(typeof t(), "string"); + a.ok(t().length > 7); + a.not(t(), t()); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/random.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/random.js new file mode 100644 index 00000000..3fa44ca5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/random.js @@ -0,0 +1,13 @@ +"use strict"; + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +module.exports = function (t, a) { + a(typeof t(), "string"); + a.ok(t().length > 7); + a.not(t({ isUnique: true }), t({ isUnique: true })); + a.ok(isValidFormat(t())); + a(t({ length: 1 }).length, 1); + a(t({ length: 100 }).length, 100); + a(t({ length: 0 }), ""); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/implement.js new file mode 100644 index 00000000..25b624e8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/implement.js @@ -0,0 +1,7 @@ +"use strict"; + +var isImplemented = require("../../../string/raw/is-implemented"); + +module.exports = function (a) { + a(isImplemented(), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/index.js new file mode 100644 index 00000000..10bb8f65 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/index.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("./shim"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/is-implemented.js new file mode 100644 index 00000000..5003e7e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/is-implemented.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function (t, a) { + a(typeof t(), "boolean"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/shim.js new file mode 100644 index 00000000..17a11ac5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/string/raw/shim.js @@ -0,0 +1,15 @@ +// Partially taken from: +// https://github.com/paulmillr/es6-shim/blob/master/test/string.js + +"use strict"; + +module.exports = function (t, a) { + var callSite = []; + + callSite.raw = ["The total is ", " ($", " with tax)"]; + a(t(callSite, "{total}", "{total * 1.01}"), + "The total is {total} (${total * 1.01} with tax)"); + + callSite.raw = []; + a(t(callSite, "{total}", "{total * 1.01}"), ""); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/to-short-string-representation.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/to-short-string-representation.js new file mode 100644 index 00000000..cac8d870 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/test/to-short-string-representation.js @@ -0,0 +1,16 @@ +"use strict"; + +var repeat = require("../string/#/repeat"); + +module.exports = function (t, a) { + a(t(), "undefined"); + a(t(null), "null"); + a(t(10), "10"); + a(t("str"), "str"); + a(t({ toString: function () { return "miszka"; } }), "miszka"); + // eslint-disable-next-line symbol-description + if (typeof Symbol === "function") a(t(Symbol()), "Symbol()"); + a(t(Object.create(null)), ""); + a(t(repeat.call("a", 300)), repeat.call("a", 99) + "…"); + a(t("mar\ntoo\nfar"), "mar\\ntoo\\nfar"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/to-short-string-representation.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/to-short-string-representation.js new file mode 100644 index 00000000..5aede538 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext/to-short-string-representation.js @@ -0,0 +1,16 @@ +"use strict"; + +var safeToString = require("./safe-to-string"); + +var reNewLine = /[\n\r\u2028\u2029]/g; + +module.exports = function (value) { + var string = safeToString(value); + // Trim if too long + if (string.length > 100) string = string.slice(0, 99) + "…"; + // Replace eventual new lines + string = string.replace(reNewLine, function (char) { + return JSON.stringify(char).slice(1, -1); + }); + return string; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/#/chain.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/#/chain.js new file mode 100644 index 00000000..190a3464 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/#/chain.js @@ -0,0 +1,40 @@ +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , d = require("d") + , Iterator = require("../") + , validIterable = require("../valid-iterable") + + , push = Array.prototype.push + , defineProperties = Object.defineProperties + , IteratorChain; + +IteratorChain = function (iterators) { + defineProperties(this, { + __iterators__: d("", iterators), + __current__: d("w", iterators.shift()) + }); +}; +if (setPrototypeOf) setPrototypeOf(IteratorChain, Iterator); + +IteratorChain.prototype = Object.create(Iterator.prototype, { + constructor: d(IteratorChain), + next: d(function () { + var result; + if (!this.__current__) return { done: true, value: undefined }; + result = this.__current__.next(); + while (result.done) { + this.__current__ = this.__iterators__.shift(); + if (!this.__current__) return { done: true, value: undefined }; + result = this.__current__.next(); + } + return result; + }) +}); + +module.exports = function () { + var iterators = [this]; + push.apply(iterators, arguments); + iterators.forEach(validIterable); + return new IteratorChain(iterators); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/.editorconfig b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/.editorconfig new file mode 100644 index 00000000..c24a6cd1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +indent_style = tab + +[{*.json,*.yml}] +indent_style = space +indent_size = 2 diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/.npmignore new file mode 100644 index 00000000..a91db655 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/.npmignore @@ -0,0 +1,12 @@ +.DS_Store +Thumbs.db +/.idea +/.vscode +npm-debug.log +/wallaby.js +/node_modules +/.travis.yml +/.gitignore +/.circle.yml +/.circleci +/.appveyor.yml diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/CHANGES b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/CHANGES new file mode 100644 index 00000000..83095f7c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/CHANGES @@ -0,0 +1,42 @@ +For recent changelog see CHANGELOG.md + +----- + +v2.0.1 -- 2017.03.15 +* Update dependencies + +v2.0.0 -- 2015.10.02 +* Use es6-symbol at v3 + +v1.0.0 -- 2015.06.23 +* Implement support for arguments object +* Drop support for v0.8 node ('^' in package.json dependencies) + +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 +* Fix es6-symbol dependency version + +v0.1.0 -- 2014.04.29 +* Assure strictly npm hosted dependencies +* Remove sparse arrays dedicated handling (as per spec) +* Add: isIterable, validIterable and chain (method) +* Remove toArray, it's addressed by Array.from (polyfil can be found in es5-ext/array/from) +* Add break possiblity to 'forOf' via 'doBreak' function argument +* Provide dedicated iterator for array-likes (ArrayIterator) and for strings (StringIterator) +* Provide @@toStringTag symbol +* When available rely on @@iterator symbol +* Remove 32bit integer maximum list length restriction +* Improve Iterator internals +* Update to use latest version of dependencies + +v0.0.0 -- 2013.10.12 +Initial (dev version) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/LICENSE new file mode 100644 index 00000000..d7c36d55 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (C) 2013-2017 Mariusz Nowak (www.medikoo.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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/README.md new file mode 100644 index 00000000..288373da --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/README.md @@ -0,0 +1,148 @@ +# es6-iterator +## ECMAScript 6 Iterator interface + +### Installation + + $ npm install es6-iterator + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## API + +### Constructors + +#### Iterator(list) _(es6-iterator)_ + +Abstract Iterator interface. Meant for extensions and not to be used on its own. + +Accepts any _list_ object (technically object with numeric _length_ property). + +_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_ + +```javascript +var Iterator = require('es6-iterator') +var iterator = new Iterator([1, 2, 3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + + +#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_ + +Dedicated for arrays and array-likes. Supports three iteration kinds: +* __value__ _(default)_ - Iterates values +* __key__ - Iterates indexes +* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form. + + +```javascript +var ArrayIterator = require('es6-iterator/array') +var iterator = new ArrayIterator([1, 2, 3], 'key+value'); + +iterator.next(); // { value: [0, 1], done: false } +iterator.next(); // { value: [1, 2], done: false } +iterator.next(); // { value: [2, 3], done: false } +iterator.next(); // { value: undefined, done: true } +``` + +May also be used for _arguments_ objects: + +```javascript +(function () { + var iterator = new ArrayIterator(arguments); + + iterator.next(); // { value: 1, done: false } + iterator.next(); // { value: 2, done: false } + iterator.next(); // { value: 3, done: false } + iterator.next(); // { value: undefined, done: true } +}(1, 2, 3)); +``` + +#### StringIterator(str) _(es6-iterator/string)_ + +Assures proper iteration over unicode symbols. +See: http://mathiasbynens.be/notes/javascript-unicode + +```javascript +var StringIterator = require('es6-iterator/string'); +var iterator = new StringIterator('f🙈o🙉o🙊'); + +iterator.next(); // { value: 'f', done: false } +iterator.next(); // { value: '🙈', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙉', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙊', done: false } +iterator.next(); // { value: undefined, done: true } +``` + +### Function utilities + +#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_ + +Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement. + +``` +var forOf = require('es6-iterator/for-of'); +var result = []; + +forOf('🙈🙉🙊', function (monkey) { result.push(monkey); }); +console.log(result); // ['🙈', '🙉', '🙊']; +``` + +Optionally you can break iteration at any point: + +```javascript +var result = []; + +forOf([1,2,3,4]', function (val, doBreak) { + result.push(monkey); + if (val >= 3) doBreak(); +}); +console.log(result); // [1, 2, 3]; +``` + +#### get(obj) _(es6-iterator/get)_ + +Return iterator for any iterable object. + +```javascript +var getIterator = require('es6-iterator/get'); +var iterator = get([1,2,3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + +#### isIterable(obj) _(es6-iterator/is-iterable)_ + +Whether _obj_ is iterable + +```javascript +var isIterable = require('es6-iterator/is-iterable'); + +isIterable(null); // false +isIterable(true); // false +isIterable('str'); // true +isIterable(['a', 'r', 'r']); // true +isIterable(new ArrayIterator([])); // true +``` + +#### validIterable(obj) _(es6-iterator/valid-iterable)_ + +If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown. + +### Method extensions + +#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_ + +Chain multiple iterators into one. + +### Tests [![Build Status](https://travis-ci.org/medikoo/es6-iterator.png)](https://travis-ci.org/medikoo/es6-iterator) + + $ npm test diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/appveyor.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/appveyor.yml new file mode 100644 index 00000000..942ab827 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/appveyor.yml @@ -0,0 +1,26 @@ +# Test against the latest version of this Node.js version +environment: + matrix: + # node.js + - nodejs_version: "0.12" + - nodejs_version: "4" + - nodejs_version: "6" + - nodejs_version: "8" + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm test + +# Don't actually build. +build: off diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/array.js new file mode 100644 index 00000000..d7a46a48 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/array.js @@ -0,0 +1,32 @@ +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , contains = require("es5-ext/string/#/contains") + , d = require("d") + , Symbol = require("es6-symbol") + , Iterator = require("./"); + +var defineProperty = Object.defineProperty, ArrayIterator; + +ArrayIterator = module.exports = function (arr, kind) { + if (!(this instanceof ArrayIterator)) throw new TypeError("Constructor requires 'new'"); + Iterator.call(this, arr); + if (!kind) kind = "value"; + else if (contains.call(kind, "key+value")) kind = "key+value"; + else if (contains.call(kind, "key")) kind = "key"; + else kind = "value"; + defineProperty(this, "__kind__", d("", kind)); +}; +if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator); + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete ArrayIterator.prototype.constructor; + +ArrayIterator.prototype = Object.create(Iterator.prototype, { + _resolve: d(function (i) { + if (this.__kind__ === "value") return this.__list__[i]; + if (this.__kind__ === "key+value") return [i, this.__list__[i]]; + return i; + }) +}); +defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator")); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/for-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/for-of.js new file mode 100644 index 00000000..5d15c349 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/for-of.js @@ -0,0 +1,47 @@ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , callable = require("es5-ext/object/valid-callable") + , isString = require("es5-ext/string/is-string") + , get = require("./get"); + +var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some; + +module.exports = function (iterable, cb /*, thisArg*/) { + var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code; + if (isArray(iterable) || isArguments(iterable)) mode = "array"; + else if (isString(iterable)) mode = "string"; + else iterable = get(iterable); + + callable(cb); + doBreak = function () { + broken = true; + }; + if (mode === "array") { + some.call(iterable, function (value) { + call.call(cb, thisArg, value, doBreak); + return broken; + }); + return; + } + if (mode === "string") { + length = iterable.length; + for (i = 0; i < length; ++i) { + char = iterable[i]; + if (i + 1 < length) { + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i]; + } + call.call(cb, thisArg, char, doBreak); + if (broken) break; + } + return; + } + result = iterable.next(); + + while (!result.done) { + call.call(cb, thisArg, result.value, doBreak); + if (broken) return; + result = iterable.next(); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/get.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/get.js new file mode 100644 index 00000000..d36c9e24 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/get.js @@ -0,0 +1,15 @@ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , isString = require("es5-ext/string/is-string") + , ArrayIterator = require("./array") + , StringIterator = require("./string") + , iterable = require("./valid-iterable") + , iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (obj) { + if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol](); + if (isArguments(obj)) return new ArrayIterator(obj); + if (isString(obj)) return new StringIterator(obj); + return new ArrayIterator(obj); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/index.js new file mode 100644 index 00000000..790475fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/index.js @@ -0,0 +1,106 @@ +"use strict"; + +var clear = require("es5-ext/array/#/clear") + , assign = require("es5-ext/object/assign") + , callable = require("es5-ext/object/valid-callable") + , value = require("es5-ext/object/valid-value") + , d = require("d") + , autoBind = require("d/auto-bind") + , Symbol = require("es6-symbol"); + +var defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, Iterator; + +module.exports = Iterator = function (list, context) { + if (!(this instanceof Iterator)) throw new TypeError("Constructor requires 'new'"); + defineProperties(this, { + __list__: d("w", value(list)), + __context__: d("w", context), + __nextIndex__: d("w", 0) + }); + if (!context) return; + callable(context.on); + context.on("_add", this._onAdd); + context.on("_delete", this._onDelete); + context.on("_clear", this._onClear); +}; + +// Internal %IteratorPrototype% doesn't expose its constructor +delete Iterator.prototype.constructor; + +defineProperties( + Iterator.prototype, + assign( + { + _next: d(function () { + var i; + if (!this.__list__) return undefined; + if (this.__redo__) { + i = this.__redo__.shift(); + if (i !== undefined) return i; + } + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; + this._unBind(); + return undefined; + }), + next: d(function () { + return this._createResult(this._next()); + }), + _createResult: d(function (i) { + if (i === undefined) return { done: true, value: undefined }; + return { done: false, value: this._resolve(i) }; + }), + _resolve: d(function (i) { + return this.__list__[i]; + }), + _unBind: d(function () { + this.__list__ = null; + delete this.__redo__; + if (!this.__context__) return; + this.__context__.off("_add", this._onAdd); + this.__context__.off("_delete", this._onDelete); + this.__context__.off("_clear", this._onClear); + this.__context__ = null; + }), + toString: d(function () { + return "[object " + (this[Symbol.toStringTag] || "Object") + "]"; + }) + }, + autoBind({ + _onAdd: d(function (index) { + if (index >= this.__nextIndex__) return; + ++this.__nextIndex__; + if (!this.__redo__) { + defineProperty(this, "__redo__", d("c", [index])); + return; + } + this.__redo__.forEach(function (redo, i) { + if (redo >= index) this.__redo__[i] = ++redo; + }, this); + this.__redo__.push(index); + }), + _onDelete: d(function (index) { + var i; + if (index >= this.__nextIndex__) return; + --this.__nextIndex__; + if (!this.__redo__) return; + i = this.__redo__.indexOf(index); + if (i !== -1) this.__redo__.splice(i, 1); + this.__redo__.forEach(function (redo, j) { + if (redo > index) this.__redo__[j] = --redo; + }, this); + }), + _onClear: d(function () { + if (this.__redo__) clear.call(this.__redo__); + this.__nextIndex__ = 0; + }) + }) + ) +); + +defineProperty( + Iterator.prototype, + Symbol.iterator, + d(function () { + return this; + }) +); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/is-iterable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/is-iterable.js new file mode 100644 index 00000000..cda7dfeb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/is-iterable.js @@ -0,0 +1,16 @@ +"use strict"; + +var isArguments = require("es5-ext/function/is-arguments") + , isValue = require("es5-ext/object/is-value") + , isString = require("es5-ext/string/is-string"); + +var iteratorSymbol = require("es6-symbol").iterator + , isArray = Array.isArray; + +module.exports = function (value) { + if (!isValue(value)) return false; + if (isArray(value)) return true; + if (isString(value)) return true; + if (isArguments(value)) return true; + return typeof value[iteratorSymbol] === "function"; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/package.json new file mode 100644 index 00000000..515d8a66 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/package.json @@ -0,0 +1,76 @@ +{ + "_from": "es6-iterator@~2.0.1", + "_id": "es6-iterator@2.0.3", + "_inBundle": false, + "_integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "_location": "/node-red-contrib-johnny-five/es6-iterator", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-iterator@~2.0.1", + "name": "es6-iterator", + "escapedName": "es6-iterator", + "rawSpec": "~2.0.1", + "saveSpec": null, + "fetchSpec": "~2.0.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/es5-ext", + "/node-red-contrib-johnny-five/es6-map", + "/node-red-contrib-johnny-five/es6-set" + ], + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "_shasum": "a7de889141a05a94b0854403b2d0a0fbfa98f3b7", + "_spec": "es6-iterator@~2.0.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/es6-map", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-iterator/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + }, + "deprecated": false, + "description": "Iterator abstraction based on ES6 specification", + "devDependencies": { + "eslint": "^4.9", + "eslint-config-medikoo-es5": "^1.4.4", + "event-emitter": "^0.3.5", + "tad": "^0.2.7" + }, + "eslintConfig": { + "extends": "medikoo-es5", + "root": true, + "rules": { + "no-extend-native": "off" + } + }, + "homepage": "https://github.com/medikoo/es6-iterator#readme", + "keywords": [ + "iterator", + "array", + "list", + "set", + "map", + "generator" + ], + "license": "MIT", + "name": "es6-iterator", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-iterator.git" + }, + "scripts": { + "lint": "eslint --ignore-path=.gitignore .", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "2.0.3" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/string.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/string.js new file mode 100644 index 00000000..48882252 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/string.js @@ -0,0 +1,39 @@ +// Thanks @mathiasbynens +// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols + +"use strict"; + +var setPrototypeOf = require("es5-ext/object/set-prototype-of") + , d = require("d") + , Symbol = require("es6-symbol") + , Iterator = require("./"); + +var defineProperty = Object.defineProperty, StringIterator; + +StringIterator = module.exports = function (str) { + if (!(this instanceof StringIterator)) throw new TypeError("Constructor requires 'new'"); + str = String(str); + Iterator.call(this, str); + defineProperty(this, "__length__", d("", str.length)); +}; +if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator); + +// Internal %ArrayIteratorPrototype% doesn't expose its constructor +delete StringIterator.prototype.constructor; + +StringIterator.prototype = Object.create(Iterator.prototype, { + _next: d(function () { + if (!this.__list__) return undefined; + if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++; + this._unBind(); + return undefined; + }), + _resolve: d(function (i) { + var char = this.__list__[i], code; + if (this.__nextIndex__ === this.__length__) return char; + code = char.charCodeAt(0); + if (code >= 0xd800 && code <= 0xdbff) return char + this.__list__[this.__nextIndex__++]; + return char; + }) +}); +defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator")); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/#/chain.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/#/chain.js new file mode 100644 index 00000000..457356f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/#/chain.js @@ -0,0 +1,23 @@ +"use strict"; + +var Iterator = require("../../"); + +module.exports = function (t, a) { + var i1 = new Iterator(["raz", "dwa", "trzy"]) + , i2 = new Iterator(["cztery", "pięć", "sześć"]) + , i3 = new Iterator(["siedem", "osiem", "dziewięć"]) + + , iterator = t.call(i1, i2, i3); + + a.deep(iterator.next(), { done: false, value: "raz" }, "#1"); + a.deep(iterator.next(), { done: false, value: "dwa" }, "#2"); + a.deep(iterator.next(), { done: false, value: "trzy" }, "#3"); + a.deep(iterator.next(), { done: false, value: "cztery" }, "#4"); + a.deep(iterator.next(), { done: false, value: "pięć" }, "#5"); + a.deep(iterator.next(), { done: false, value: "sześć" }, "#6"); + a.deep(iterator.next(), { done: false, value: "siedem" }, "#7"); + a.deep(iterator.next(), { done: false, value: "osiem" }, "#8"); + a.deep(iterator.next(), { done: false, value: "dziewięć" }, "#9"); + a.deep(iterator.next(), { done: true, value: undefined }, "Done #1"); + a.deep(iterator.next(), { done: true, value: undefined }, "Done #2"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/.eslintrc.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/.eslintrc.json new file mode 100644 index 00000000..99f0b655 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "rules": { + "id-length": "off" + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/array.js new file mode 100644 index 00000000..447dfa73 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/array.js @@ -0,0 +1,67 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (T) { + return { + "Values": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it; + + it = new T(x); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.splice(1, 0, "elo"); + a.deep(it.next(), { done: false, value: "dwa" }, "Insert"); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: "pięć" }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Keys & Values": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it; + + it = new T(x, "key+value"); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: [0, "raz"] }, "#1"); + a.deep(it.next(), { done: false, value: [1, "dwa"] }, "#2"); + x.splice(1, 0, "elo"); + a.deep(it.next(), { done: false, value: [2, "dwa"] }, "Insert"); + a.deep(it.next(), { done: false, value: [3, "trzy"] }, "#3"); + a.deep(it.next(), { done: false, value: [4, "cztery"] }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: [5, "pięć"] }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Keys": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it; + + it = new T(x, "key"); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: 0 }, "#1"); + a.deep(it.next(), { done: false, value: 1 }, "#2"); + x.splice(1, 0, "elo"); + a.deep(it.next(), { done: false, value: 2 }, "Insert"); + a.deep(it.next(), { done: false, value: 3 }, "#3"); + a.deep(it.next(), { done: false, value: 4 }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: 5 }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Sparse": function (a) { + var x = new Array(6), it; + + x[2] = "raz"; + x[4] = "dwa"; + it = new T(x); + a.deep(it.next(), { done: false, value: undefined }, "#1"); + a.deep(it.next(), { done: false, value: undefined }, "#2"); + a.deep(it.next(), { done: false, value: "raz" }, "#3"); + a.deep(it.next(), { done: false, value: undefined }, "#4"); + a.deep(it.next(), { done: false, value: "dwa" }, "#5"); + a.deep(it.next(), { done: false, value: undefined }, "#6"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/for-of.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/for-of.js new file mode 100644 index 00000000..9b47e979 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/for-of.js @@ -0,0 +1,42 @@ +"use strict"; + +var ArrayIterator = require("../array") + + , slice = Array.prototype.slice; + +module.exports = function (t, a) { + var i = 0, x = ["raz", "dwa", "trzy"], y = {}, called = 0; + t(x, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); + a(this, y, "Array: context: " + i++ + "#"); + }, y); + i = 0; + t((function () { + return arguments; +}("raz", "dwa", "trzy")), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); + a(this, y, "Arguments: context: " + i++ + "#"); + }, y); + i = 0; + t(x = "foo", function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Regular String: context: " + i++ + "#"); + }, y); + i = 0; + x = ["r", "💩", "z"]; + t("r💩z", function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Unicode String: context: " + i++ + "#"); + }, y); + i = 0; + t(new ArrayIterator(x), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); + a(this, y, "Iterator: context: " + i++ + "#"); + }, y); + + t(x = ["raz", "dwa", "trzy"], function (value, doBreak) { + ++called; + return doBreak(); + }); + a(called, 1, "Break"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/get.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/get.js new file mode 100644 index 00000000..c5947d3e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/get.js @@ -0,0 +1,27 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , Iterator = require("../"); + +module.exports = function (t, a) { + var iterator; + a.throws(function () { + t(); +}, TypeError, "Null"); + a.throws(function () { + t({}); +}, TypeError, "Plain object"); + a.throws(function () { + t({ length: 0 }); +}, TypeError, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { + return new Iterator([]); +}; + a(t(iterator) instanceof Iterator, true, "Iterator"); + a(String(t([])), "[object Array Iterator]", " Array"); + a(String(t(function () { + return arguments; +}())), "[object Array Iterator]", " Arguments"); + a(String(t("foo")), "[object String Iterator]", "String"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/index.js new file mode 100644 index 00000000..48982185 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/index.js @@ -0,0 +1,99 @@ +"use strict"; + +var ee = require("event-emitter") + , iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (T) { + return { + "": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć"], it, y, z; + + it = new T(x); + a(it[iteratorSymbol](), it, "@@iterator"); + y = it.next(); + a.deep(y, { done: false, value: "raz" }, "#1"); + z = it.next(); + a.not(y, z, "Recreate result"); + a.deep(z, { done: false, value: "dwa" }, "#2"); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + a.deep(it.next(), { done: false, value: "pięć" }, "#5"); + a.deep(y = it.next(), { done: true, value: undefined }, "End"); + a.not(y, it.next(), "Recreate result on dead"); + }, + "Emited": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + y.emit("_add", x.push("sześć") - 1); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + x.splice(1, 0, "półtora"); + y.emit("_add", 1); + a.deep(it.next(), { done: false, value: "półtora" }, "Insert"); + x.splice(5, 1); + y.emit("_delete", 5); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + a.deep(it.next(), { done: false, value: "sześć" }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited #2": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.splice(1, 0, "półtora"); + y.emit("_add", 1); + x.splice(1, 0, "1.25"); + y.emit("_add", 1); + x.splice(0, 1); + y.emit("_delete", 0); + a.deep(it.next(), { done: false, value: "półtora" }, "Insert"); + a.deep(it.next(), { done: false, value: "1.25" }, "Insert #2"); + a.deep(it.next(), { done: false, value: "trzy" }, "#3"); + a.deep(it.next(), { done: false, value: "cztery" }, "#4"); + x.splice(5, 1); + y.emit("_delete", 5); + a.deep(it.next(), { done: false, value: "sześć" }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #1": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.length = 0; + y.emit("_clear"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #2": function (a) { + var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: "raz" }, "#1"); + a.deep(it.next(), { done: false, value: "dwa" }, "#2"); + x.length = 0; + y.emit("_clear"); + x.push("foo"); + x.push("bar"); + a.deep(it.next(), { done: false, value: "foo" }, "#3"); + a.deep(it.next(), { done: false, value: "bar" }, "#4"); + x.splice(1, 0, "półtora"); + y.emit("_add", 1); + x.splice(1, 0, "1.25"); + y.emit("_add", 1); + x.splice(0, 1); + y.emit("_delete", 0); + a.deep(it.next(), { done: false, value: "półtora" }, "Insert"); + a.deep(it.next(), { done: false, value: "1.25" }, "Insert #2"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/is-iterable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/is-iterable.js new file mode 100644 index 00000000..5787351a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/is-iterable.js @@ -0,0 +1,23 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , Iterator = require("../"); + +module.exports = function (t, a) { + var iterator; + a(t(), false, "Undefined"); + a(t(123), false, "Number"); + a(t({}), false, "Plain object"); + a(t({ length: 0 }), false, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { + return new Iterator([]); +}; + a(t(iterator), true, "Iterator"); + a(t([]), true, "Array"); + a(t("foo"), true, "String"); + a(t(""), true, "Empty string"); + a(t(function () { + return arguments; +}()), true, "Arguments"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/string.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/string.js new file mode 100644 index 00000000..3f2a5b67 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/string.js @@ -0,0 +1,23 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator; + +module.exports = function (T, a) { + var it = new T("foobar"); + + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: "f" }, "#1"); + a.deep(it.next(), { done: false, value: "o" }, "#2"); + a.deep(it.next(), { done: false, value: "o" }, "#3"); + a.deep(it.next(), { done: false, value: "b" }, "#4"); + a.deep(it.next(), { done: false, value: "a" }, "#5"); + a.deep(it.next(), { done: false, value: "r" }, "#6"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + + a.h1("Outside of BMP"); + it = new T("r💩z"); + a.deep(it.next(), { done: false, value: "r" }, "#1"); + a.deep(it.next(), { done: false, value: "💩" }, "#2"); + a.deep(it.next(), { done: false, value: "z" }, "#3"); + a.deep(it.next(), { done: true, value: undefined }, "End"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/valid-iterable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/valid-iterable.js new file mode 100644 index 00000000..b8b2a8a6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/test/valid-iterable.js @@ -0,0 +1,28 @@ +"use strict"; + +var iteratorSymbol = require("es6-symbol").iterator + , Iterator = require("../"); + +module.exports = function (t, a) { + var obj; + a.throws(function () { + t(); +}, TypeError, "Undefined"); + a.throws(function () { + t({}); +}, TypeError, "Plain object"); + a.throws(function () { + t({ length: 0 }); +}, TypeError, "Array-like"); + obj = {}; + obj[iteratorSymbol] = function () { + return new Iterator([]); +}; + a(t(obj), obj, "Iterator"); + obj = []; + a(t(obj), obj, "Array"); + obj = (function () { + return arguments; +}()); + a(t(obj), obj, "Arguments"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/valid-iterable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/valid-iterable.js new file mode 100644 index 00000000..8c6e0715 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-iterator/valid-iterable.js @@ -0,0 +1,8 @@ +"use strict"; + +var isIterable = require("./is-iterable"); + +module.exports = function (value) { + if (!isIterable(value)) throw new TypeError(value + " is not iterable"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.lint b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.lint new file mode 100644 index 00000000..fa861e07 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.lint @@ -0,0 +1,13 @@ +@root + +module + +indent 2 +maxlen 100 +tabs + +ass +nomen +plusplus + +predef+ Map diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.npmignore new file mode 100644 index 00000000..155e41f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.travis.yml new file mode 100644 index 00000000..7560f749 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/.travis.yml @@ -0,0 +1,13 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + - 6 + - 7 + +notifications: + email: + - medikoo+es6-map@medikoo.com + +script: "npm test && npm run lint" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/CHANGES b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/CHANGES new file mode 100644 index 00000000..0205ad41 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/CHANGES @@ -0,0 +1,33 @@ +v0.1.5 -- 2017.03.17 +* Update dependencies +* Improve documentation + +v0.1.4 -- 2016.06.03 +* Update dependencies + +v0.1.3 -- 2015.11.18 +* Relax validation of native implementation (do not require proper stringification of Map.prototype) + +v0.1.2 -- 2015.10.15 +* Improve native detection +* Ensure proper inheritance +* Update up to specification +* Fix spelling of LICENSE +* Update dependencies + +v0.1.1 -- 2014.10.07 +* Fix isImplemented so native Maps are detected properly +* Configure lint scripts + +v0.1.0 -- 2014.04.29 +* Assure strictly npm hosted dependencies +* Update to use latest versions of dependencies + +v0.0.1 -- 2014.04.25 +* Provide @@toStringTag symbol, and use other ES 6 symbols +* Fix iterators handling +* Fix isImplemented so it doesn't crash +* Update up to changes in dependencies + +v0.0.0 -- 2013.11.10 +- Initial (dev) version diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/LICENSE new file mode 100644 index 00000000..aaf35282 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013 Mariusz Nowak (www.medikoo.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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/README.md new file mode 100644 index 00000000..d132981b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/README.md @@ -0,0 +1,79 @@ +# es6-map +## Map collection as specified in ECMAScript6 + +__Warning: +v0.1 version does not ensure O(1) algorithm complexity (but O(n)). This shortcoming will be addressed in v1.0__ + + +### Usage + +It’s safest to use *es6-map* as a [ponyfill](https://ponyfill.com) – a polyfill which doesn’t touch global objects: + +```javascript +var Map = require('es6-map'); +``` + +If you want to make sure your environment implements `Map` globally, do: + +```javascript +require('es6-map/implement'); +``` + +If you strictly want to use the polyfill even if the native `Map` exists, do: + +```javascript +var Map = require('es6-map/polyfill'); +``` + +### Installation + + $ npm install es6-map + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects). Still if you want quick look, follow examples: + +```javascript +var Map = require('es6-map'); + +var x = {}, y = {}, map = new Map([['raz', 'one'], ['dwa', 'two'], [x, y]]); + +map.size; // 3 +map.get('raz'); // 'one' +map.get(x); // y +map.has('raz'); // true +map.has(x); // true +map.has('foo'); // false +map.set('trzy', 'three'); // map +map.size // 4 +map.get('trzy'); // 'three' +map.has('trzy'); // true +map.has('dwa'); // true +map.delete('dwa'); // true +map.size; // 3 + +map.forEach(function (value, key) { + // { 'raz', 'one' }, { x, y }, { 'trzy', 'three' } iterated +}); + +// FF nightly only: +for (value of map) { + // ['raz', 'one'], [x, y], ['trzy', 'three'] iterated +} + +var iterator = map.values(); + +iterator.next(); // { done: false, value: 'one' } +iterator.next(); // { done: false, value: y } +iterator.next(); // { done: false, value: 'three' } +iterator.next(); // { done: true, value: undefined } + +map.clear(); // undefined +map.size; // 0 +``` + +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-map.png)](https://travis-ci.org/medikoo/es6-map) + + $ npm test diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/implement.js new file mode 100644 index 00000000..ff3ebacc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(require('es5-ext/global'), 'Map', + { value: require('./polyfill'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/index.js new file mode 100644 index 00000000..3e27caac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? Map : require('./polyfill'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-implemented.js new file mode 100644 index 00000000..cd3b8f23 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-implemented.js @@ -0,0 +1,32 @@ +'use strict'; + +module.exports = function () { + var map, iterator, result; + if (typeof Map !== 'function') return false; + try { + // WebKit doesn't support arguments and crashes + map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]); + } catch (e) { + return false; + } + if (String(map) !== '[object Map]') return false; + if (map.size !== 3) return false; + if (typeof map.clear !== 'function') return false; + if (typeof map.delete !== 'function') return false; + if (typeof map.entries !== 'function') return false; + if (typeof map.forEach !== 'function') return false; + if (typeof map.get !== 'function') return false; + if (typeof map.has !== 'function') return false; + if (typeof map.keys !== 'function') return false; + if (typeof map.set !== 'function') return false; + if (typeof map.values !== 'function') return false; + + iterator = map.entries(); + result = iterator.next(); + if (result.done !== false) return false; + if (!result.value) return false; + if (result.value[0] !== 'raz') return false; + if (result.value[1] !== 'one') return false; + + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-map.js new file mode 100644 index 00000000..1e1fa823 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-map.js @@ -0,0 +1,12 @@ +'use strict'; + +var toStringTagSymbol = require('es6-symbol').toStringTag + + , toString = Object.prototype.toString + , id = '[object Map]' + , Global = (typeof Map === 'undefined') ? null : Map; + +module.exports = function (x) { + return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) || + (toString.call(x) === id) || (x[toStringTagSymbol] === 'Map'))) || false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-native-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-native-implemented.js new file mode 100644 index 00000000..b0b7a191 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/is-native-implemented.js @@ -0,0 +1,9 @@ +// Exports true if environment provides native `Map` implementation, +// whatever that is. + +'use strict'; + +module.exports = (function () { + if (typeof Map === 'undefined') return false; + return (Object.prototype.toString.call(new Map()) === '[object Map]'); +}()); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/iterator-kinds.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/iterator-kinds.js new file mode 100644 index 00000000..5367b38d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/iterator-kinds.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('es5-ext/object/primitive-set')('key', + 'value', 'key+value'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/iterator.js new file mode 100644 index 00000000..60f1e8c9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/iterator.js @@ -0,0 +1,38 @@ +'use strict'; + +var setPrototypeOf = require('es5-ext/object/set-prototype-of') + , d = require('d') + , Iterator = require('es6-iterator') + , toStringTagSymbol = require('es6-symbol').toStringTag + , kinds = require('./iterator-kinds') + + , defineProperties = Object.defineProperties + , unBind = Iterator.prototype._unBind + , MapIterator; + +MapIterator = module.exports = function (map, kind) { + if (!(this instanceof MapIterator)) return new MapIterator(map, kind); + Iterator.call(this, map.__mapKeysData__, map); + if (!kind || !kinds[kind]) kind = 'key+value'; + defineProperties(this, { + __kind__: d('', kind), + __values__: d('w', map.__mapValuesData__) + }); +}; +if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator); + +MapIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(MapIterator), + _resolve: d(function (i) { + if (this.__kind__ === 'value') return this.__values__[i]; + if (this.__kind__ === 'key') return this.__list__[i]; + return [this.__list__[i], this.__values__[i]]; + }), + _unBind: d(function () { + this.__values__ = null; + unBind.call(this); + }), + toString: d(function () { return '[object Map Iterator]'; }) +}); +Object.defineProperty(MapIterator.prototype, toStringTagSymbol, + d('c', 'Map Iterator')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/primitive-iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/primitive-iterator.js new file mode 100644 index 00000000..b9eada37 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/lib/primitive-iterator.js @@ -0,0 +1,57 @@ +'use strict'; + +var clear = require('es5-ext/array/#/clear') + , assign = require('es5-ext/object/assign') + , setPrototypeOf = require('es5-ext/object/set-prototype-of') + , toStringTagSymbol = require('es6-symbol').toStringTag + , d = require('d') + , autoBind = require('d/auto-bind') + , Iterator = require('es6-iterator') + , kinds = require('./iterator-kinds') + + , defineProperties = Object.defineProperties, keys = Object.keys + , unBind = Iterator.prototype._unBind + , PrimitiveMapIterator; + +PrimitiveMapIterator = module.exports = function (map, kind) { + if (!(this instanceof PrimitiveMapIterator)) { + return new PrimitiveMapIterator(map, kind); + } + Iterator.call(this, keys(map.__mapKeysData__), map); + if (!kind || !kinds[kind]) kind = 'key+value'; + defineProperties(this, { + __kind__: d('', kind), + __keysData__: d('w', map.__mapKeysData__), + __valuesData__: d('w', map.__mapValuesData__) + }); +}; +if (setPrototypeOf) setPrototypeOf(PrimitiveMapIterator, Iterator); + +PrimitiveMapIterator.prototype = Object.create(Iterator.prototype, assign({ + constructor: d(PrimitiveMapIterator), + _resolve: d(function (i) { + if (this.__kind__ === 'value') return this.__valuesData__[this.__list__[i]]; + if (this.__kind__ === 'key') return this.__keysData__[this.__list__[i]]; + return [this.__keysData__[this.__list__[i]], + this.__valuesData__[this.__list__[i]]]; + }), + _unBind: d(function () { + this.__keysData__ = null; + this.__valuesData__ = null; + unBind.call(this); + }), + toString: d(function () { return '[object Map Iterator]'; }) +}, autoBind({ + _onAdd: d(function (key) { this.__list__.push(key); }), + _onDelete: d(function (key) { + var index = this.__list__.lastIndexOf(key); + if (index < this.__nextIndex__) return; + this.__list__.splice(index, 1); + }), + _onClear: d(function () { + clear.call(this.__list__); + this.__nextIndex__ = 0; + }) +}))); +Object.defineProperty(PrimitiveMapIterator.prototype, toStringTagSymbol, + d('c', 'Map Iterator')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/package.json new file mode 100644 index 00000000..46dc40a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/package.json @@ -0,0 +1,74 @@ +{ + "_from": "es6-map@^0.1.5", + "_id": "es6-map@0.1.5", + "_inBundle": false, + "_integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "_location": "/node-red-contrib-johnny-five/es6-map", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-map@^0.1.5", + "name": "es6-map", + "escapedName": "es6-map", + "rawSpec": "^0.1.5", + "saveSpec": null, + "fetchSpec": "^0.1.5" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/mqtt" + ], + "_resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "_shasum": "9136e0503dcc06a301690f0bb14ff4e364e949f0", + "_spec": "es6-map@^0.1.5", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/mqtt", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-map/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" + }, + "deprecated": false, + "description": "ECMAScript6 Map polyfill", + "devDependencies": { + "tad": "~0.2.7", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "homepage": "https://github.com/medikoo/es6-map#readme", + "keywords": [ + "collection", + "es6", + "shim", + "harmony", + "list", + "hash", + "map", + "polyfill", + "ponyfill", + "ecmascript" + ], + "license": "MIT", + "name": "es6-map", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-map.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "0.1.5" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/polyfill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/polyfill.js new file mode 100644 index 00000000..c638e760 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/polyfill.js @@ -0,0 +1,104 @@ +'use strict'; + +var clear = require('es5-ext/array/#/clear') + , eIndexOf = require('es5-ext/array/#/e-index-of') + , setPrototypeOf = require('es5-ext/object/set-prototype-of') + , callable = require('es5-ext/object/valid-callable') + , validValue = require('es5-ext/object/valid-value') + , d = require('d') + , ee = require('event-emitter') + , Symbol = require('es6-symbol') + , iterator = require('es6-iterator/valid-iterable') + , forOf = require('es6-iterator/for-of') + , Iterator = require('./lib/iterator') + , isNative = require('./is-native-implemented') + + , call = Function.prototype.call + , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf + , MapPoly; + +module.exports = MapPoly = function (/*iterable*/) { + var iterable = arguments[0], keys, values, self; + if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\''); + if (isNative && setPrototypeOf && (Map !== MapPoly)) { + self = setPrototypeOf(new Map(), getPrototypeOf(this)); + } else { + self = this; + } + if (iterable != null) iterator(iterable); + defineProperties(self, { + __mapKeysData__: d('c', keys = []), + __mapValuesData__: d('c', values = []) + }); + if (!iterable) return self; + forOf(iterable, function (value) { + var key = validValue(value)[0]; + value = value[1]; + if (eIndexOf.call(keys, key) !== -1) return; + keys.push(key); + values.push(value); + }, self); + return self; +}; + +if (isNative) { + if (setPrototypeOf) setPrototypeOf(MapPoly, Map); + MapPoly.prototype = Object.create(Map.prototype, { + constructor: d(MapPoly) + }); +} + +ee(defineProperties(MapPoly.prototype, { + clear: d(function () { + if (!this.__mapKeysData__.length) return; + clear.call(this.__mapKeysData__); + clear.call(this.__mapValuesData__); + this.emit('_clear'); + }), + delete: d(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) return false; + this.__mapKeysData__.splice(index, 1); + this.__mapValuesData__.splice(index, 1); + this.emit('_delete', index, key); + return true; + }), + entries: d(function () { return new Iterator(this, 'key+value'); }), + forEach: d(function (cb/*, thisArg*/) { + var thisArg = arguments[1], iterator, result; + callable(cb); + iterator = this.entries(); + result = iterator._next(); + while (result !== undefined) { + call.call(cb, thisArg, this.__mapValuesData__[result], + this.__mapKeysData__[result], this); + result = iterator._next(); + } + }), + get: d(function (key) { + var index = eIndexOf.call(this.__mapKeysData__, key); + if (index === -1) return; + return this.__mapValuesData__[index]; + }), + has: d(function (key) { + return (eIndexOf.call(this.__mapKeysData__, key) !== -1); + }), + keys: d(function () { return new Iterator(this, 'key'); }), + set: d(function (key, value) { + var index = eIndexOf.call(this.__mapKeysData__, key), emit; + if (index === -1) { + index = this.__mapKeysData__.push(key) - 1; + emit = true; + } + this.__mapValuesData__[index] = value; + if (emit) this.emit('_add', index, key); + return this; + }), + size: d.gs(function () { return this.__mapKeysData__.length; }), + values: d(function () { return new Iterator(this, 'value'); }), + toString: d(function () { return '[object Map]'; }) +})); +Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () { + return this.entries(); +})); +Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/primitive/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/primitive/index.js new file mode 100644 index 00000000..8ac21432 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/primitive/index.js @@ -0,0 +1,117 @@ +'use strict'; + +var clear = require('es5-ext/object/clear') + , setPrototypeOf = require('es5-ext/object/set-prototype-of') + , validValue = require('es5-ext/object/valid-value') + , callable = require('es5-ext/object/valid-callable') + , d = require('d') + , iterator = require('es6-iterator/valid-iterable') + , forOf = require('es6-iterator/for-of') + , isNative = require('../is-native-implemented') + , MapPolyfill = require('../polyfill') + , Iterator = require('../lib/primitive-iterator') + + , call = Function.prototype.call + , create = Object.create, defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf + , hasOwnProperty = Object.prototype.hasOwnProperty + , PrimitiveMap; + +module.exports = PrimitiveMap = function (/*iterable, serialize*/) { + var iterable = arguments[0], serialize = arguments[1], self; + if (!(this instanceof PrimitiveMap)) throw new TypeError('Constructor requires \'new\''); + if (isNative && setPrototypeOf && (Map !== MapPolyfill)) { + self = setPrototypeOf(new Map(), getPrototypeOf(this)); + } else { + self = this; + } + if (iterable != null) iterator(iterable); + if (serialize !== undefined) { + callable(serialize); + defineProperty(self, '_serialize', d('', serialize)); + } + defineProperties(self, { + __mapKeysData__: d('c', create(null)), + __mapValuesData__: d('c', create(null)), + __size__: d('w', 0) + }); + if (!iterable) return self; + forOf(iterable, function (value) { + var key = validValue(value)[0], sKey = self._serialize(key); + if (sKey == null) throw new TypeError(key + " cannot be serialized"); + value = value[1]; + if (hasOwnProperty.call(self.__mapKeysData__, sKey)) { + if (self.__mapValuesData__[sKey] === value) return; + } else { + ++self.__size__; + } + self.__mapKeysData__[sKey] = key; + self.__mapValuesData__[sKey] = value; + }); + return self; +}; +if (setPrototypeOf) setPrototypeOf(PrimitiveMap, MapPolyfill); + +PrimitiveMap.prototype = create(MapPolyfill.prototype, { + constructor: d(PrimitiveMap), + _serialize: d(function (value) { + if (value && (typeof value.toString !== 'function')) return null; + return String(value); + }), + clear: d(function () { + if (!this.__size__) return; + clear(this.__mapKeysData__); + clear(this.__mapValuesData__); + this.__size__ = 0; + this.emit('_clear'); + }), + delete: d(function (key) { + var sKey = this._serialize(key); + if (sKey == null) return false; + if (!hasOwnProperty.call(this.__mapKeysData__, sKey)) return false; + delete this.__mapKeysData__[sKey]; + delete this.__mapValuesData__[sKey]; + --this.__size__; + this.emit('_delete', sKey); + return true; + }), + entries: d(function () { return new Iterator(this, 'key+value'); }), + forEach: d(function (cb/*, thisArg*/) { + var thisArg = arguments[1], iterator, result, sKey; + callable(cb); + iterator = this.entries(); + result = iterator._next(); + while (result !== undefined) { + sKey = iterator.__list__[result]; + call.call(cb, thisArg, this.__mapValuesData__[sKey], + this.__mapKeysData__[sKey], this); + result = iterator._next(); + } + }), + get: d(function (key) { + var sKey = this._serialize(key); + if (sKey == null) return; + return this.__mapValuesData__[sKey]; + }), + has: d(function (key) { + var sKey = this._serialize(key); + if (sKey == null) return false; + return hasOwnProperty.call(this.__mapKeysData__, sKey); + }), + keys: d(function () { return new Iterator(this, 'key'); }), + size: d.gs(function () { return this.__size__; }), + set: d(function (key, value) { + var sKey = this._serialize(key); + if (sKey == null) throw new TypeError(key + " cannot be serialized"); + if (hasOwnProperty.call(this.__mapKeysData__, sKey)) { + if (this.__mapValuesData__[sKey] === value) return this; + } else { + ++this.__size__; + } + this.__mapKeysData__[sKey] = key; + this.__mapValuesData__[sKey] = value; + this.emit('_add', sKey); + return this; + }), + values: d(function () { return new Iterator(this, 'value'); }) +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/implement.js new file mode 100644 index 00000000..3569df61 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/implement.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof Map, 'function'); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/index.js new file mode 100644 index 00000000..907b8c5a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (T, a) { + a((new T([['raz', 1], ['dwa', 2]])).size, 2); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-implemented.js new file mode 100644 index 00000000..06df91cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +var global = require('es5-ext/global') + , polyfill = require('../polyfill'); + +module.exports = function (t, a) { + var cache; + a(typeof t(), 'boolean'); + cache = global.Map; + global.Map = polyfill; + a(t(), true); + if (cache === undefined) delete global.Map; + else global.Map = cache; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-map.js new file mode 100644 index 00000000..f600b229 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-map.js @@ -0,0 +1,16 @@ +'use strict'; + +var MapPoly = require('../polyfill'); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t('raz'), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof Map !== 'undefined') { + a(t(new Map()), true, "Native"); + } + a(t(new MapPoly()), true, "Polyfill"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-native-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-native-implemented.js new file mode 100644 index 00000000..df8ba032 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/is-native-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/iterator-kinds.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/iterator-kinds.js new file mode 100644 index 00000000..41ea10c5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/iterator-kinds.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t, { key: true, value: true, 'key+value': true }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/iterator.js new file mode 100644 index 00000000..2688ed26 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/iterator.js @@ -0,0 +1,13 @@ +'use strict'; + +var Map = require('../../polyfill') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr); + + a.deep(toArray(new T(map)), arr, "Default"); + a.deep(toArray(new T(map, 'key+value')), arr, "Key & Value"); + a.deep(toArray(new T(map, 'value')), ['one', 'two'], "Value"); + a.deep(toArray(new T(map, 'key')), ['raz', 'dwa'], "Value"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/primitive-iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/primitive-iterator.js new file mode 100644 index 00000000..ed2790de --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/lib/primitive-iterator.js @@ -0,0 +1,130 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , toArray = require('es5-ext/array/to-array') + , Map = require('../../primitive') + + , compare, mapToResults; + +compare = function (a, b) { + if (!a.value) return -1; + if (!b.value) return 1; + return a.value[0].localeCompare(b.value[0]); +}; + +mapToResults = function (arr) { + return arr.sort().map(function (value) { + return { done: false, value: value }; + }); +}; + +module.exports = function (T) { + return { + "": function (a) { + var arr, it, y, z, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five']]; + map = new Map(arr); + + it = new T(map); + a(it[iteratorSymbol](), it, "@@iterator"); + y = it.next(); + result.push(y); + z = it.next(); + a.not(y, z, "Recreate result"); + result.push(z); + result.push(it.next()); + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(y = it.next(), { done: true, value: undefined }, "End"); + a.not(y, it.next(), "Recreate result on dead"); + }, + Emited: function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + map.set('sześć', 'six'); + arr.push(['sześć', 'six']); + result.push(it.next()); + map.delete('pięć'); + arr.splice(4, 1); + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited #2": function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + map.set('siedem', 'seven'); + map.delete('siedem'); + result.push(it.next()); + result.push(it.next()); + map.delete('pięć'); + arr.splice(4, 1); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #1": function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + arr = [['raz', 'one'], ['dwa', 'two']]; + map.clear(); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #2": function (a) { + var arr, it, map, result = []; + + arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'], + ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']]; + map = new Map(arr); + + it = new T(map); + result.push(it.next()); + result.push(it.next()); + map.clear(); + map.set('foo', 'bru'); + map.set('bar', 'far'); + arr = [['raz', 'one'], ['dwa', 'two'], ['foo', 'bru'], ['bar', 'far']]; + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), mapToResults(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + Kinds: function (a) { + var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr); + + a.deep(toArray(new T(map)).sort(), arr.sort(), "Default"); + a.deep(toArray(new T(map, 'key+value')).sort(), arr.sort(), + "Key + Value"); + a.deep(toArray(new T(map, 'value')).sort(), ['one', 'two'].sort(), + "Value"); + a.deep(toArray(new T(map, 'key')).sort(), ['raz', 'dwa'].sort(), + "Key"); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/polyfill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/polyfill.js new file mode 100644 index 00000000..6816cb04 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/polyfill.js @@ -0,0 +1,60 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']] + , map = new T(arr), x = {}, y = {}, i = 0; + + a(map instanceof T, true, "Map"); + a(map.size, 3, "Size"); + a(map.get('raz'), 'one', "Get: contained"); + a(map.get(x), undefined, "Get: not contained"); + a(map.has('raz'), true, "Has: contained"); + a(map.has(x), false, "Has: not contained"); + a(map.set(x, y), map, "Set: return"); + a(map.has(x), true, "Set: has"); + a(map.get(x), y, "Set: get"); + a(map.size, 4, "Set: Size"); + map.set('dwa', x); + a(map.get('dwa'), x, "Overwrite: get"); + a(map.size, 4, "Overwrite: size"); + + a(map.delete({}), false, "Delete: false"); + + arr.push([x, y]); + arr[1][1] = x; + map.forEach(function () { + a.deep(aFrom(arguments), [arr[i][1], arr[i][0], map], + "ForEach: Arguments: #" + i); + a(this, y, "ForEach: Context: #" + i); + if (i === 0) { + a(map.delete('raz'), true, "Delete: true"); + a(map.has('raz'), false, "Delete"); + a(map.size, 3, "Delete: size"); + map.set('cztery', 'four'); + arr.push(['cztery', 'four']); + } + i++; + }, y); + arr.splice(0, 1); + + a.deep(toArray(map.entries()), [['dwa', x], ['trzy', 'three'], [x, y], + ['cztery', 'four']], "Entries"); + a.deep(toArray(map.keys()), ['dwa', 'trzy', x, 'cztery'], "Keys"); + a.deep(toArray(map.values()), [x, 'three', y, 'four'], "Values"); + a.deep(toArray(map), [['dwa', x], ['trzy', 'three'], [x, y], + ['cztery', 'four']], "Iterator"); + + map.clear(); + a(map.size, 0, "Clear: size"); + a(map.has('trzy'), false, "Clear: has"); + a.deep(toArray(map), [], "Clear: Values"); + + a.h1("Empty initialization"); + map = new T(); + map.set('foo', 'bar'); + a(map.size, 1); + a(map.get('foo'), 'bar'); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/primitive/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/primitive/index.js new file mode 100644 index 00000000..a99c6852 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/primitive/index.js @@ -0,0 +1,59 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + , getIterator = require('es6-iterator/get') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']] + , map = new T(arr), x = 'other', y = 'other2' + , i = 0, result = []; + + a(map instanceof T, true, "Map"); + a(map.size, 3, "Size"); + a(map.get('raz'), 'one', "Get: contained"); + a(map.get(x), undefined, "Get: not contained"); + a(map.has('raz'), true, "Has: true"); + a(map.has(x), false, "Has: false"); + a(map.set(x, y), map, "Add: return"); + a(map.has(x), true, "Add"); + a(map.size, 4, "Add: Size"); + map.set('dwa', x); + a(map.get('dwa'), x, "Overwrite: get"); + a(map.size, 4, "Overwrite: size"); + + a(map.delete('else'), false, "Delete: false"); + + arr.push([x, y]); + arr[1][1] = x; + map.forEach(function () { + result.push(aFrom(arguments)); + a(this, y, "ForEach: Context: #" + i); + }, y); + + a.deep(result.sort(function (a, b) { + return String([a[1], a[0]]).localeCompare([b[1], b[0]]); + }), arr.sort().map(function (val) { return [val[1], val[0], map]; }), + "ForEach: Arguments"); + + a.deep(toArray(map.entries()).sort(), [['dwa', x], ['trzy', 'three'], + [x, y], ['raz', 'one']].sort(), "Entries"); + a.deep(toArray(map.keys()).sort(), ['dwa', 'trzy', x, 'raz'].sort(), + "Keys"); + a.deep(toArray(map.values()).sort(), [x, 'three', y, 'one'].sort(), + "Values"); + a.deep(toArray(getIterator(map)).sort(), [['dwa', x], ['trzy', 'three'], + [x, y], ['raz', 'one']].sort(), + "Iterator"); + + map.clear(); + a(map.size, 0, "Clear: size"); + a(map.has('trzy'), false, "Clear: has"); + a.deep(toArray(map.values()), [], "Clear: Values"); + + a.h1("Empty initialization"); + map = new T(); + map.set('foo', 'bar'); + a(map.size, 1); + a(map.get('foo'), 'bar'); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/valid-map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/valid-map.js new file mode 100644 index 00000000..ac031494 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/test/valid-map.js @@ -0,0 +1,19 @@ +'use strict'; + +var MapPoly = require('../polyfill'); + +module.exports = function (t, a) { + var map; + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(true); }, TypeError, "Primitive"); + a.throws(function () { t('raz'); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t([]); }, TypeError, "Array"); + if (typeof Map !== 'undefined') { + map = new Map(); + a(t(map), map, "Native"); + } + map = new MapPoly(); + a(t(map), map, "Polyfill"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/valid-map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/valid-map.js new file mode 100644 index 00000000..e2aca87a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-map/valid-map.js @@ -0,0 +1,8 @@ +'use strict'; + +var isMap = require('./is-map'); + +module.exports = function (x) { + if (!isMap(x)) throw new TypeError(x + " is not a Map"); + return x; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.lint b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.lint new file mode 100644 index 00000000..89386b35 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.lint @@ -0,0 +1,13 @@ +@root + +module + +tabs +indent 2 +maxlen 100 + +ass +nomen +plusplus + +predef+ Set diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.npmignore new file mode 100644 index 00000000..155e41f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.travis.yml new file mode 100644 index 00000000..09a917c0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/.travis.yml @@ -0,0 +1,13 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + - 6 + - 7 + +notifications: + email: + - medikoo+es6-set@medikoo.com + +script: "npm test && npm run lint" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/CHANGES b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/CHANGES new file mode 100644 index 00000000..21ad4bf3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/CHANGES @@ -0,0 +1,34 @@ +v0.1.5 -- 2017.03.16 +* Improve documentation +* Update dependencies + +v0.1.4 -- 2016.01.19 +* Ensure Set polyfill function name is `Set` (#2) + +v0.1.3 -- 2015.11.18 +* Relax validation of native implementation (do not require proper stringification of Set.prototype) + +v0.1.2 -- 2015.10.02 +* Improve native Set detection +* Fix spelling of LICENSE +* Set.prototype.filter extension +* Update dependencies + +v0.1.1 -- 2014.10.07 +* Fix isImplemented so it validates native Set properly +* Add getFirst and getLast extensions +* Configure linter scripts + +v0.1.0 -- 2014.04.29 +* Assure strictly npm hosted dependencies +* Introduce faster 'primitive' alternative (doesn't guarantee order of iteration) +* Add isNativeImplemented, and some, every and copy method extensions +* If native Set is provided polyfill extends it +* Optimize forEach iteration +* Remove comparator support (as it was removed from spec) +* Provide @@toStringTag symbol, ad @@iterator symbols on iterators +* Update to use latest dependencies versions +* Improve interals + +v0.0.0 -- 2013.10.12 +Initial (dev) version diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/LICENSE new file mode 100644 index 00000000..aaf35282 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013 Mariusz Nowak (www.medikoo.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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/README.md new file mode 100644 index 00000000..4ec0a005 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/README.md @@ -0,0 +1,74 @@ +# es6-set +## Set collection as specified in ECMAScript6 + +__Warning: +v0.1 version does not ensure O(1) algorithm complexity (but O(n)). This shortcoming will be addressed in v1.0__ + +### Usage + +If you want to make sure your environment implements `Set`, do: + +```javascript +require('es6-set/implement'); +``` + +If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Set` on global scope, do: + +```javascript +var Set = require('es6-set'); +``` + +If you strictly want to use polyfill even if native `Set` exists, do: + +```javascript +var Set = require('es6-set/polyfill'); +``` + +### Installation + + $ npm install es6-set + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-set-objects). Still if you want quick look, follow examples: + +```javascript +var Set = require('es6-set'); + +var set = new Set(['raz', 'dwa', {}]); + +set.size; // 3 +set.has('raz'); // true +set.has('foo'); // false +set.add('foo'); // set +set.size // 4 +set.has('foo'); // true +set.has('dwa'); // true +set.delete('dwa'); // true +set.size; // 3 + +set.forEach(function (value) { + // 'raz', {}, 'foo' iterated +}); + +// FF nightly only: +for (value of set) { + // 'raz', {}, 'foo' iterated +} + +var iterator = set.values(); + +iterator.next(); // { done: false, value: 'raz' } +iterator.next(); // { done: false, value: {} } +iterator.next(); // { done: false, value: 'foo' } +iterator.next(); // { done: true, value: undefined } + +set.clear(); // undefined +set.size; // 0 +``` + +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-set.png)](https://travis-ci.org/medikoo/es6-set) + + $ npm test diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/copy.js new file mode 100644 index 00000000..a8fd5c20 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/copy.js @@ -0,0 +1,5 @@ +'use strict'; + +var Set = require('../'); + +module.exports = function () { return new Set(this); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/every.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/every.js new file mode 100644 index 00000000..ea64ebc5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/every.js @@ -0,0 +1,18 @@ +'use strict'; + +var callable = require('es5-ext/object/valid-callable') + , forOf = require('es6-iterator/for-of') + + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var thisArg = arguments[1], result = true; + callable(cb); + forOf(this, function (value, doBreak) { + if (!call.call(cb, thisArg, value)) { + result = false; + doBreak(); + } + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/filter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/filter.js new file mode 100644 index 00000000..1178fc59 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/filter.js @@ -0,0 +1,18 @@ +'use strict'; + +var callable = require('es5-ext/object/valid-callable') + , forOf = require('es6-iterator/for-of') + , isSet = require('../is-set') + , Set = require('../') + + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var thisArg = arguments[1], result; + callable(cb); + result = isSet(this) ? new this.constructor() : new Set(); + forOf(this, function (value) { + if (call.call(cb, thisArg, value)) result.add(value); + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/get-first.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/get-first.js new file mode 100644 index 00000000..b5d89fc1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/get-first.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function () { + return this.values().next().value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/get-last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/get-last.js new file mode 100644 index 00000000..d22ce737 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/get-last.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function () { + var value, iterator = this.values(), item; + while (true) { + item = iterator.next(); + if (item.done) break; + value = item.value; + } + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/some.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/some.js new file mode 100644 index 00000000..400a5a0c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/ext/some.js @@ -0,0 +1,18 @@ +'use strict'; + +var callable = require('es5-ext/object/valid-callable') + , forOf = require('es6-iterator/for-of') + + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var thisArg = arguments[1], result = false; + callable(cb); + forOf(this, function (value, doBreak) { + if (call.call(cb, thisArg, value)) { + result = true; + doBreak(); + } + }); + return result; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/implement.js new file mode 100644 index 00000000..f03362e0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(require('es5-ext/global'), 'Set', + { value: require('./polyfill'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/index.js new file mode 100644 index 00000000..daa78861 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? Set : require('./polyfill'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-implemented.js new file mode 100644 index 00000000..7f1bfbb7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-implemented.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = function () { + var set, iterator, result; + if (typeof Set !== 'function') return false; + set = new Set(['raz', 'dwa', 'trzy']); + if (String(set) !== '[object Set]') return false; + if (set.size !== 3) return false; + if (typeof set.add !== 'function') return false; + if (typeof set.clear !== 'function') return false; + if (typeof set.delete !== 'function') return false; + if (typeof set.entries !== 'function') return false; + if (typeof set.forEach !== 'function') return false; + if (typeof set.has !== 'function') return false; + if (typeof set.keys !== 'function') return false; + if (typeof set.values !== 'function') return false; + + iterator = set.values(); + result = iterator.next(); + if (result.done !== false) return false; + if (result.value !== 'raz') return false; + + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-native-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-native-implemented.js new file mode 100644 index 00000000..e8b0160e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-native-implemented.js @@ -0,0 +1,9 @@ +// Exports true if environment provides native `Set` implementation, +// whatever that is. + +'use strict'; + +module.exports = (function () { + if (typeof Set === 'undefined') return false; + return (Object.prototype.toString.call(Set.prototype) === '[object Set]'); +}()); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-set.js new file mode 100644 index 00000000..6b491dde --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/is-set.js @@ -0,0 +1,12 @@ +'use strict'; + +var toString = Object.prototype.toString + , toStringTagSymbol = require('es6-symbol').toStringTag + + , id = '[object Set]' + , Global = (typeof Set === 'undefined') ? null : Set; + +module.exports = function (x) { + return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) || + (toString.call(x) === id) || (x[toStringTagSymbol] === 'Set'))) || false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/lib/iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/lib/iterator.js new file mode 100644 index 00000000..6069a8a1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/lib/iterator.js @@ -0,0 +1,30 @@ +'use strict'; + +var setPrototypeOf = require('es5-ext/object/set-prototype-of') + , contains = require('es5-ext/string/#/contains') + , d = require('d') + , Iterator = require('es6-iterator') + , toStringTagSymbol = require('es6-symbol').toStringTag + + , defineProperty = Object.defineProperty + , SetIterator; + +SetIterator = module.exports = function (set, kind) { + if (!(this instanceof SetIterator)) return new SetIterator(set, kind); + Iterator.call(this, set.__setData__, set); + if (!kind) kind = 'value'; + else if (contains.call(kind, 'key+value')) kind = 'key+value'; + else kind = 'value'; + defineProperty(this, '__kind__', d('', kind)); +}; +if (setPrototypeOf) setPrototypeOf(SetIterator, Iterator); + +SetIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(SetIterator), + _resolve: d(function (i) { + if (this.__kind__ === 'value') return this.__list__[i]; + return [this.__list__[i], this.__list__[i]]; + }), + toString: d(function () { return '[object Set Iterator]'; }) +}); +defineProperty(SetIterator.prototype, toStringTagSymbol, d('c', 'Set Iterator')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/lib/primitive-iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/lib/primitive-iterator.js new file mode 100644 index 00000000..1f0326a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/lib/primitive-iterator.js @@ -0,0 +1,53 @@ +'use strict'; + +var clear = require('es5-ext/array/#/clear') + , assign = require('es5-ext/object/assign') + , setPrototypeOf = require('es5-ext/object/set-prototype-of') + , contains = require('es5-ext/string/#/contains') + , d = require('d') + , autoBind = require('d/auto-bind') + , Iterator = require('es6-iterator') + , toStringTagSymbol = require('es6-symbol').toStringTag + + , defineProperties = Object.defineProperties, keys = Object.keys + , unBind = Iterator.prototype._unBind + , PrimitiveSetIterator; + +PrimitiveSetIterator = module.exports = function (set, kind) { + if (!(this instanceof PrimitiveSetIterator)) { + return new PrimitiveSetIterator(set, kind); + } + Iterator.call(this, keys(set.__setData__), set); + kind = (!kind || !contains.call(kind, 'key+value')) ? 'value' : 'key+value'; + defineProperties(this, { + __kind__: d('', kind), + __data__: d('w', set.__setData__) + }); +}; +if (setPrototypeOf) setPrototypeOf(PrimitiveSetIterator, Iterator); + +PrimitiveSetIterator.prototype = Object.create(Iterator.prototype, assign({ + constructor: d(PrimitiveSetIterator), + _resolve: d(function (i) { + var value = this.__data__[this.__list__[i]]; + return (this.__kind__ === 'value') ? value : [value, value]; + }), + _unBind: d(function () { + this.__data__ = null; + unBind.call(this); + }), + toString: d(function () { return '[object Set Iterator]'; }) +}, autoBind({ + _onAdd: d(function (key) { this.__list__.push(key); }), + _onDelete: d(function (key) { + var index = this.__list__.lastIndexOf(key); + if (index < this.__nextIndex__) return; + this.__list__.splice(index, 1); + }), + _onClear: d(function () { + clear.call(this.__list__); + this.__nextIndex__ = 0; + }) +}))); +Object.defineProperty(PrimitiveSetIterator.prototype, toStringTagSymbol, + d('c', 'Set Iterator')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/package.json new file mode 100644 index 00000000..d102533c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/package.json @@ -0,0 +1,69 @@ +{ + "_from": "es6-set@~0.1.5", + "_id": "es6-set@0.1.5", + "_inBundle": false, + "_integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "_location": "/node-red-contrib-johnny-five/es6-set", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-set@~0.1.5", + "name": "es6-set", + "escapedName": "es6-set", + "rawSpec": "~0.1.5", + "saveSpec": null, + "fetchSpec": "~0.1.5" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/es6-map" + ], + "_resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "_shasum": "d2b3ec5d4d800ced818db538d28974db0a73ccb1", + "_spec": "es6-set@~0.1.5", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/es6-map", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-set/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-symbol": "3.1.1", + "event-emitter": "~0.3.5" + }, + "deprecated": false, + "description": "ECMAScript6 Set polyfill", + "devDependencies": { + "tad": "~0.2.7", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "homepage": "https://github.com/medikoo/es6-set#readme", + "keywords": [ + "set", + "collection", + "es6", + "harmony", + "list", + "hash" + ], + "license": "MIT", + "name": "es6-set", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-set.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "0.1.5" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/polyfill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/polyfill.js new file mode 100644 index 00000000..51b1e630 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/polyfill.js @@ -0,0 +1,80 @@ +'use strict'; + +var clear = require('es5-ext/array/#/clear') + , eIndexOf = require('es5-ext/array/#/e-index-of') + , setPrototypeOf = require('es5-ext/object/set-prototype-of') + , callable = require('es5-ext/object/valid-callable') + , d = require('d') + , ee = require('event-emitter') + , Symbol = require('es6-symbol') + , iterator = require('es6-iterator/valid-iterable') + , forOf = require('es6-iterator/for-of') + , Iterator = require('./lib/iterator') + , isNative = require('./is-native-implemented') + + , call = Function.prototype.call + , defineProperty = Object.defineProperty, getPrototypeOf = Object.getPrototypeOf + , SetPoly, getValues, NativeSet; + +if (isNative) NativeSet = Set; + +module.exports = SetPoly = function Set(/*iterable*/) { + var iterable = arguments[0], self; + if (!(this instanceof SetPoly)) throw new TypeError('Constructor requires \'new\''); + if (isNative && setPrototypeOf) self = setPrototypeOf(new NativeSet(), getPrototypeOf(this)); + else self = this; + if (iterable != null) iterator(iterable); + defineProperty(self, '__setData__', d('c', [])); + if (!iterable) return self; + forOf(iterable, function (value) { + if (eIndexOf.call(this, value) !== -1) return; + this.push(value); + }, self.__setData__); + return self; +}; + +if (isNative) { + if (setPrototypeOf) setPrototypeOf(SetPoly, NativeSet); + SetPoly.prototype = Object.create(NativeSet.prototype, { constructor: d(SetPoly) }); +} + +ee(Object.defineProperties(SetPoly.prototype, { + add: d(function (value) { + if (this.has(value)) return this; + this.emit('_add', this.__setData__.push(value) - 1, value); + return this; + }), + clear: d(function () { + if (!this.__setData__.length) return; + clear.call(this.__setData__); + this.emit('_clear'); + }), + delete: d(function (value) { + var index = eIndexOf.call(this.__setData__, value); + if (index === -1) return false; + this.__setData__.splice(index, 1); + this.emit('_delete', index, value); + return true; + }), + entries: d(function () { return new Iterator(this, 'key+value'); }), + forEach: d(function (cb/*, thisArg*/) { + var thisArg = arguments[1], iterator, result, value; + callable(cb); + iterator = this.values(); + result = iterator._next(); + while (result !== undefined) { + value = iterator._resolve(result); + call.call(cb, thisArg, value, value, this); + result = iterator._next(); + } + }), + has: d(function (value) { + return (eIndexOf.call(this.__setData__, value) !== -1); + }), + keys: d(getValues = function () { return this.values(); }), + size: d.gs(function () { return this.__setData__.length; }), + values: d(function () { return new Iterator(this); }), + toString: d(function () { return '[object Set]'; }) +})); +defineProperty(SetPoly.prototype, Symbol.iterator, d(getValues)); +defineProperty(SetPoly.prototype, Symbol.toStringTag, d('c', 'Set')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/primitive/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/primitive/index.js new file mode 100644 index 00000000..6bcad18d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/primitive/index.js @@ -0,0 +1,87 @@ +'use strict'; + +var callable = require('es5-ext/object/valid-callable') + , clear = require('es5-ext/object/clear') + , setPrototypeOf = require('es5-ext/object/set-prototype-of') + , d = require('d') + , iterator = require('es6-iterator/valid-iterable') + , forOf = require('es6-iterator/for-of') + , Set = require('../polyfill') + , Iterator = require('../lib/primitive-iterator') + , isNative = require('../is-native-implemented') + + , create = Object.create, defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty, getPrototypeOf = Object.getPrototypeOf + , hasOwnProperty = Object.prototype.hasOwnProperty + , PrimitiveSet; + +module.exports = PrimitiveSet = function (/*iterable, serialize*/) { + var iterable = arguments[0], serialize = arguments[1], self; + if (!(this instanceof PrimitiveSet)) throw new TypeError('Constructor requires \'new\''); + if (isNative && setPrototypeOf) self = setPrototypeOf(new Set(), getPrototypeOf(this)); + else self = this; + if (iterable != null) iterator(iterable); + if (serialize !== undefined) { + callable(serialize); + defineProperty(self, '_serialize', d('', serialize)); + } + defineProperties(self, { + __setData__: d('c', create(null)), + __size__: d('w', 0) + }); + if (!iterable) return self; + forOf(iterable, function (value) { + var key = self._serialize(value); + if (key == null) throw new TypeError(value + " cannot be serialized"); + if (hasOwnProperty.call(self.__setData__, key)) return; + self.__setData__[key] = value; + ++self.__size__; + }); + return self; +}; +if (setPrototypeOf) setPrototypeOf(PrimitiveSet, Set); + +PrimitiveSet.prototype = create(Set.prototype, { + constructor: d(PrimitiveSet), + _serialize: d(function (value) { + if (value && (typeof value.toString !== 'function')) return null; + return String(value); + }), + add: d(function (value) { + var key = this._serialize(value); + if (key == null) throw new TypeError(value + " cannot be serialized"); + if (hasOwnProperty.call(this.__setData__, key)) return this; + this.__setData__[key] = value; + ++this.__size__; + this.emit('_add', key); + return this; + }), + clear: d(function () { + if (!this.__size__) return; + clear(this.__setData__); + this.__size__ = 0; + this.emit('_clear'); + }), + delete: d(function (value) { + var key = this._serialize(value); + if (key == null) return false; + if (!hasOwnProperty.call(this.__setData__, key)) return false; + delete this.__setData__[key]; + --this.__size__; + this.emit('_delete', key); + return true; + }), + entries: d(function () { return new Iterator(this, 'key+value'); }), + get: d(function (key) { + key = this._serialize(key); + if (key == null) return; + return this.__setData__[key]; + }), + has: d(function (value) { + var key = this._serialize(value); + if (key == null) return false; + return hasOwnProperty.call(this.__setData__, key); + }), + size: d.gs(function () { return this.__size__; }), + values: d(function () { return new Iterator(this); }) +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/copy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/copy.js new file mode 100644 index 00000000..84fe912a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/copy.js @@ -0,0 +1,12 @@ +'use strict'; + +var toArray = require('es5-ext/array/to-array') + , Set = require('../../'); + +module.exports = function (t, a) { + var content = ['raz', 2, true], set = new Set(content), copy; + + copy = t.call(set); + a.not(copy, set, "Copy"); + a.deep(toArray(copy), content, "Content"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/every.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/every.js new file mode 100644 index 00000000..f56ca385 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/every.js @@ -0,0 +1,9 @@ +'use strict'; + +var Set = require('../../'); + +module.exports = function (t, a) { + a(t.call(new Set(), Boolean), true, "Empty set"); + a(t.call(new Set([2, 3, 4]), Boolean), true, "Truthy"); + a(t.call(new Set([2, 0, 4]), Boolean), false, "Falsy"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/filter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/filter.js new file mode 100644 index 00000000..46981859 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/filter.js @@ -0,0 +1,12 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + + , Set = require('../../'); + +module.exports = function (t, a) { + a.deep(aFrom(t.call(new Set(), Boolean)), [], "Empty set"); + a.deep(aFrom(t.call(new Set([2, 3, 4]), Boolean)), [2, 3, 4], "All true"); + a.deep(aFrom(t.call(new Set([0, false, 4]), Boolean)), [4], "Some false"); + a.deep(aFrom(t.call(new Set([0, false, null]), Boolean)), [], "All false"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/get-first.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/get-first.js new file mode 100644 index 00000000..f99829e5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/get-first.js @@ -0,0 +1,12 @@ +'use strict'; + +var Set = require('../../'); + +module.exports = function (t, a) { + var content = ['raz', 2, true], set = new Set(content); + + a(t.call(set), 'raz'); + + set = new Set(); + a(t.call(set), undefined); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/get-last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/get-last.js new file mode 100644 index 00000000..1dcc993e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/get-last.js @@ -0,0 +1,12 @@ +'use strict'; + +var Set = require('../../'); + +module.exports = function (t, a) { + var content = ['raz', 2, true], set = new Set(content); + + a(t.call(set), true); + + set = new Set(); + a(t.call(set), undefined); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/some.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/some.js new file mode 100644 index 00000000..84ce1191 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/ext/some.js @@ -0,0 +1,10 @@ +'use strict'; + +var Set = require('../../'); + +module.exports = function (t, a) { + a(t.call(new Set(), Boolean), false, "Empty set"); + a(t.call(new Set([2, 3, 4]), Boolean), true, "All true"); + a(t.call(new Set([0, false, 4]), Boolean), true, "Some false"); + a(t.call(new Set([0, false, null]), Boolean), false, "All false"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/implement.js new file mode 100644 index 00000000..4882d378 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/implement.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof Set, 'function'); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/index.js new file mode 100644 index 00000000..19c64865 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (T, a) { a((new T(['raz', 'dwa'])).size, 2); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-implemented.js new file mode 100644 index 00000000..124793e7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +var global = require('es5-ext/global') + , polyfill = require('../polyfill'); + +module.exports = function (t, a) { + var cache; + a(typeof t(), 'boolean'); + cache = global.Set; + global.Set = polyfill; + a(t(), true); + if (cache === undefined) delete global.Set; + else global.Set = cache; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-native-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-native-implemented.js new file mode 100644 index 00000000..df8ba032 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-native-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-set.js new file mode 100644 index 00000000..c969cce2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/is-set.js @@ -0,0 +1,16 @@ +'use strict'; + +var SetPoly = require('../polyfill'); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t('raz'), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof Set !== 'undefined') { + a(t(new Set()), true, "Native"); + } + a(t(new SetPoly()), true, "Polyfill"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/lib/iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/lib/iterator.js new file mode 100644 index 00000000..9e5cfb91 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/lib/iterator.js @@ -0,0 +1,13 @@ +'use strict'; + +var Set = require('../../polyfill') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var set = new Set(['raz', 'dwa']); + + a.deep(toArray(new T(set)), ['raz', 'dwa'], "Default"); + a.deep(toArray(new T(set, 'key+value')), [['raz', 'raz'], ['dwa', 'dwa']], + "Key & Value"); + a.deep(toArray(new T(set, 'value')), ['raz', 'dwa'], "Other"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/lib/primitive-iterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/lib/primitive-iterator.js new file mode 100644 index 00000000..2a4956b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/lib/primitive-iterator.js @@ -0,0 +1,113 @@ +'use strict'; + +var Set = require('../../primitive') + , toArray = require('es5-ext/array/to-array') + , iteratorSymbol = require('es6-symbol').iterator + + , compare, map; + +compare = function (a, b) { + if (!a.value) return -1; + if (!b.value) return 1; + return a.value.localeCompare(b.value); +}; + +map = function (arr) { + return arr.sort().map(function (value) { + return { done: false, value: value }; + }); +}; + +module.exports = function (T) { + return { + "": function (a) { + var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it, y, z + , set = new Set(arr), result = []; + + it = new T(set); + a(it[iteratorSymbol](), it, "@@iterator"); + y = it.next(); + result.push(y); + z = it.next(); + a.not(y, z, "Recreate result"); + result.push(z); + result.push(it.next()); + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), map(arr)); + a.deep(y = it.next(), { done: true, value: undefined }, "End"); + a.not(y, it.next(), "Recreate result on dead"); + }, + Emited: function (a) { + var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it + , set = new Set(arr), result = []; + + it = new T(set); + result.push(it.next()); + result.push(it.next()); + set.add('sześć'); + arr.push('sześć'); + result.push(it.next()); + set.delete('pięć'); + arr.splice(4, 1); + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), map(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited #2": function (a) { + var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it + , set = new Set(arr), result = []; + + it = new T(set); + result.push(it.next()); + result.push(it.next()); + set.add('siedem'); + set.delete('siedem'); + result.push(it.next()); + result.push(it.next()); + set.delete('pięć'); + arr.splice(4, 1); + result.push(it.next()); + a.deep(result.sort(compare), map(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #1": function (a) { + var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it + , set = new Set(arr), result = []; + + it = new T(set); + result.push(it.next()); + result.push(it.next()); + arr = ['raz', 'dwa']; + set.clear(); + a.deep(result.sort(compare), map(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #2": function (a) { + var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it + , set = new Set(arr), result = []; + + it = new T(set); + result.push(it.next()); + result.push(it.next()); + set.clear(); + set.add('foo'); + set.add('bar'); + arr = ['raz', 'dwa', 'foo', 'bar']; + result.push(it.next()); + result.push(it.next()); + a.deep(result.sort(compare), map(arr)); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + Kinds: function (a) { + var set = new Set(['raz', 'dwa']); + + a.deep(toArray(new T(set)).sort(), ['raz', 'dwa'].sort(), "Default"); + a.deep(toArray(new T(set, 'key+value')).sort(), + [['raz', 'raz'], ['dwa', 'dwa']].sort(), "Key & Value"); + a.deep(toArray(new T(set, 'value')).sort(), ['raz', 'dwa'].sort(), + "Other"); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/polyfill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/polyfill.js new file mode 100644 index 00000000..94ae3e6e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/polyfill.js @@ -0,0 +1,50 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = ['raz', 'dwa', 'trzy'], set = new T(arr), x = {}, y = {}, i = 0; + + a(set instanceof T, true, "Set"); + a(set.size, 3, "Size"); + a(set.has('raz'), true, "Has: true"); + a(set.has(x), false, "Has: false"); + a(set.add(x), set, "Add: return"); + a(set.has(x), true, "Add"); + a(set.size, 4, "Add: Size"); + a(set.delete({}), false, "Delete: false"); + + arr.push(x); + set.forEach(function () { + a.deep(aFrom(arguments), [arr[i], arr[i], set], + "ForEach: Arguments: #" + i); + a(this, y, "ForEach: Context: #" + i); + if (i === 0) { + a(set.delete('raz'), true, "Delete: true"); + a(set.has('raz'), false, "Delete"); + a(set.size, 3, "Delete: size"); + set.add('cztery'); + arr.push('cztery'); + } + i++; + }, y); + arr.splice(0, 1); + + a.deep(toArray(set.entries()), [['dwa', 'dwa'], ['trzy', 'trzy'], [x, x], + ['cztery', 'cztery']], "Entries"); + a.deep(toArray(set.keys()), ['dwa', 'trzy', x, 'cztery'], "Keys"); + a.deep(toArray(set.values()), ['dwa', 'trzy', x, 'cztery'], "Values"); + a.deep(toArray(set), ['dwa', 'trzy', x, 'cztery'], "Iterator"); + + set.clear(); + a(set.size, 0, "Clear: size"); + a(set.has('trzy'), false, "Clear: has"); + a.deep(toArray(set), [], "Clear: Values"); + + a.h1("Empty initialization"); + set = new T(); + set.add('foo'); + a(set.size, 1); + a(set.has('foo'), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/primitive/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/primitive/index.js new file mode 100644 index 00000000..88f9502f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/primitive/index.js @@ -0,0 +1,50 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + , getIterator = require('es6-iterator/get') + , toArray = require('es5-ext/array/to-array'); + +module.exports = function (T, a) { + var arr = ['raz', 'dwa', 'trzy'], set = new T(arr), x = 'other', y = 'other2' + , i = 0, result = []; + + a(set instanceof T, true, "Set"); + a(set.size, 3, "Size"); + a(set.has('raz'), true, "Has: true"); + a(set.has(x), false, "Has: false"); + a(set.add(x), set, "Add: return"); + a(set.has(x), true, "Add"); + a(set.size, 4, "Add: Size"); + a(set.delete('else'), false, "Delete: false"); + a(set.get('raz'), 'raz', "Get"); + + arr.push(x); + set.forEach(function () { + result.push(aFrom(arguments)); + a(this, y, "ForEach: Context: #" + i); + }, y); + + a.deep(result.sort(function (a, b) { + return a[0].localeCompare(b[0]); + }), arr.sort().map(function (val) { return [val, val, set]; })); + + a.deep(toArray(set.entries()).sort(), [['dwa', 'dwa'], ['trzy', 'trzy'], + [x, x], ['raz', 'raz']].sort(), "Entries"); + a.deep(toArray(set.keys()).sort(), ['dwa', 'trzy', x, 'raz'].sort(), + "Keys"); + a.deep(toArray(set.values()).sort(), ['dwa', 'trzy', x, 'raz'].sort(), + "Values"); + a.deep(toArray(getIterator(set)).sort(), ['dwa', 'trzy', x, 'raz'].sort(), + "Iterator"); + + set.clear(); + a(set.size, 0, "Clear: size"); + a(set.has('trzy'), false, "Clear: has"); + a.deep(toArray(set.values()), [], "Clear: Values"); + + a.h1("Empty initialization"); + set = new T(); + set.add('foo'); + a(set.size, 1); + a(set.has('foo'), true); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/valid-set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/valid-set.js new file mode 100644 index 00000000..8c71f5f8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/test/valid-set.js @@ -0,0 +1,19 @@ +'use strict'; + +var SetPoly = require('../polyfill'); + +module.exports = function (t, a) { + var set; + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(true); }, TypeError, "Primitive"); + a.throws(function () { t('raz'); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t([]); }, TypeError, "Array"); + if (typeof Set !== 'undefined') { + set = new Set(); + a(t(set), set, "Native"); + } + set = new SetPoly(); + a(t(set), set, "Polyfill"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/valid-set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/valid-set.js new file mode 100644 index 00000000..9336fd35 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-set/valid-set.js @@ -0,0 +1,8 @@ +'use strict'; + +var isSet = require('./is-set'); + +module.exports = function (x) { + if (!isSet(x)) throw new TypeError(x + " is not a Set"); + return x; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.lint b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.lint new file mode 100644 index 00000000..df1e53cd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.lint @@ -0,0 +1,15 @@ +@root + +module + +tabs +indent 2 +maxlen 100 + +ass +nomen +plusplus +newcap +vars + +predef+ Symbol diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.npmignore new file mode 100644 index 00000000..155e41f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.travis.yml new file mode 100644 index 00000000..0b1f5e4a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/.travis.yml @@ -0,0 +1,11 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - v4 + - v5 + - v6 + +notifications: + email: + - medikoo+es6-symbol@medikoo.com diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/CHANGES b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/CHANGES new file mode 100644 index 00000000..017d4091 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/CHANGES @@ -0,0 +1,57 @@ +v3.1.1 -- 2017.03.15 +* Improve documentation +* Improve error messages +* Update dependencies + +v3.1.0 -- 2016.06.03 +* Fix internals of symbol detection +* Ensure Symbol.prototype[Symbol.toPrimitive] in all cases returns primitive value + (fixes Node v6 support) +* Create native symbols whenver possible + +v3.0.2 -- 2015.12.12 +* Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of + polyfill. See #13 + +v3.0.1 -- 2015.10.22 +* Workaround for IE11 bug (reported in #12) + +v3.0.0 -- 2015.10.02 +* Reuse native symbols (e.g. iterator, toStringTag etc.) in a polyfill if they're available + Otherwise polyfill symbols may not be recognized by other functions +* Improve documentation + +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + +v0.1.1 -- 2014.10.07 +* Fix isImplemented, so it returns true in case of polyfill +* Improve documentations + +v0.1.0 -- 2014.04.28 +* Assure strictly npm dependencies +* Update to use latest versions of dependencies +* Fix implementation detection so it doesn't crash on `String(symbol)` +* throw on `new Symbol()` (as decided by TC39) + +v0.0.0 -- 2013.11.15 +* Initial (dev) version \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/LICENSE new file mode 100644 index 00000000..04724a3a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/README.md new file mode 100644 index 00000000..fea99062 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/README.md @@ -0,0 +1,71 @@ +# es6-symbol +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor) + +### Limitations + +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. + +### Usage + +If you'd like to use native version when it exists and fallback to [ponyfill](https://ponyfill.com) if it doesn't, use *es6-symbol* as following: + +```javascript +var Symbol = require('es6-symbol'); +``` + +If you want to make sure your environment implements `Symbol` globally, do: + +```javascript +require('es6-symbol/implement'); +``` + +If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: + +```javascript +var Symbol = require('es6-symbol/polyfill'); +``` + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples: + +```javascript +var Symbol = require('es6-symbol'); + +var symbol = Symbol('My custom symbol'); +var x = {}; + +x[symbol] = 'foo'; +console.log(x[symbol]); 'foo' + +// Detect iterable: +var iterator, result; +if (possiblyIterable[Symbol.iterator]) { + iterator = possiblyIterable[Symbol.iterator](); + result = iterator.next(); + while(!result.done) { + console.log(result.value); + result = iterator.next(); + } +} +``` + +### Installation +#### NPM + +In your project path: + + $ npm install es6-symbol + +##### Browser + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol) + + $ npm test diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/implement.js new file mode 100644 index 00000000..153edacd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(require('es5-ext/global'), 'Symbol', + { value: require('./polyfill'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/index.js new file mode 100644 index 00000000..609f1faf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? Symbol : require('./polyfill'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-implemented.js new file mode 100644 index 00000000..93629d2f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-implemented.js @@ -0,0 +1,17 @@ +'use strict'; + +var validTypes = { object: true, symbol: true }; + +module.exports = function () { + var symbol; + if (typeof Symbol !== 'function') return false; + symbol = Symbol('test symbol'); + try { String(symbol); } catch (e) { return false; } + + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) return false; + if (!validTypes[typeof Symbol.toPrimitive]) return false; + if (!validTypes[typeof Symbol.toStringTag]) return false; + + return true; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-native-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-native-implemented.js new file mode 100644 index 00000000..8676d0e8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-native-implemented.js @@ -0,0 +1,5 @@ +// Exports true if environment provides native `Symbol` implementation + +'use strict'; + +module.exports = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-symbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-symbol.js new file mode 100644 index 00000000..074cb07f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/is-symbol.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (x) { + if (!x) return false; + if (typeof x === 'symbol') return true; + if (!x.constructor) return false; + if (x.constructor.name !== 'Symbol') return false; + return (x[x.constructor.toStringTag] === 'Symbol'); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/package.json new file mode 100644 index 00000000..7a3f6655 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/package.json @@ -0,0 +1,71 @@ +{ + "_from": "es6-symbol@~3.1.1", + "_id": "es6-symbol@3.1.1", + "_inBundle": false, + "_integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "_location": "/node-red-contrib-johnny-five/es6-symbol", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-symbol@~3.1.1", + "name": "es6-symbol", + "escapedName": "es6-symbol", + "rawSpec": "~3.1.1", + "saveSpec": null, + "fetchSpec": "~3.1.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/es5-ext", + "/node-red-contrib-johnny-five/es6-iterator", + "/node-red-contrib-johnny-five/es6-map", + "/node-red-contrib-johnny-five/es6-set" + ], + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "_shasum": "bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77", + "_spec": "es6-symbol@~3.1.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/es6-map", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-symbol/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + }, + "deprecated": false, + "description": "ECMAScript 6 Symbol polyfill", + "devDependencies": { + "tad": "~0.2.7", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "homepage": "https://github.com/medikoo/es6-symbol#readme", + "keywords": [ + "symbol", + "private", + "property", + "es6", + "ecmascript", + "harmony", + "ponyfill", + "polyfill" + ], + "license": "MIT", + "name": "es6-symbol", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-symbol.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "3.1.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/polyfill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/polyfill.js new file mode 100644 index 00000000..dca879a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/polyfill.js @@ -0,0 +1,118 @@ +// ES2015 Symbol polyfill for environments that do not (or partially) support it + +'use strict'; + +var d = require('d') + , validateSymbol = require('./validate-symbol') + + , create = Object.create, defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) + , isNativeSafe; + +if (typeof Symbol === 'function') { + NativeSymbol = Symbol; + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} + +var generateName = (function () { + var created = create(null); + return function (desc) { + var postfix = 0, name, ie11BugWorkaround; + while (created[desc + (postfix || '')]) ++postfix; + desc += (postfix || ''); + created[desc] = true; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + // For IE11 issue see: + // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ + // ie11-broken-getters-on-dom-objects + // https://github.com/medikoo/es6-symbol/issues/12 + if (ie11BugWorkaround) return; + ie11BugWorkaround = true; + defineProperty(this, name, d(value)); + ie11BugWorkaround = false; + })); + return name; + }; +}()); + +// Internal constructor (not one exposed) for creating Symbol instances. +// This one is used to ensure that `someSymbol instanceof Symbol` always return false +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('Symbol is not a constructor'); + return SymbolPolyfill(description); +}; + +// Exposed `Symbol` constructor +// (returns instances of HiddenSymbol) +module.exports = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError('Symbol is not a constructor'); + if (isNativeSafe) return NativeSymbol(description); + symbol = create(HiddenSymbol.prototype); + description = (description === undefined ? '' : String(description)); + return defineProperties(symbol, { + __description__: d('', description), + __name__: d('', generateName(description)) + }); +}; +defineProperties(SymbolPolyfill, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = SymbolPolyfill(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), + + // To ensure proper interoperability with other native functions (e.g. Array.from) + // fallback to eventual native implementation of given symbol + hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), + isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || + SymbolPolyfill('isConcatSpreadable')), + iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), + match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), + replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), + search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), + species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), + split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), + toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), + toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), + unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) +}); + +// Internal tweaks for real symbol producer +defineProperties(HiddenSymbol.prototype, { + constructor: d(SymbolPolyfill), + toString: d('', function () { return this.__name__; }) +}); + +// Proper implementation of methods exposed on Symbol.prototype +// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype +defineProperties(SymbolPolyfill.prototype, { + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) +}); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { + var symbol = validateSymbol(this); + if (typeof symbol === 'symbol') return symbol; + return symbol.toString(); +})); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); + +// Proper implementaton of toPrimitive and toStringTag for returned symbol instances +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); + +// Note: It's important to define `toPrimitive` as last one, as some implementations +// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) +// And that may invoke error in definition flow: +// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/implement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/implement.js new file mode 100644 index 00000000..eb35c301 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/implement.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof Symbol, 'function'); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/index.js new file mode 100644 index 00000000..62b3296d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/index.js @@ -0,0 +1,12 @@ +'use strict'; + +var d = require('d') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-implemented.js new file mode 100644 index 00000000..bb0d6453 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +var global = require('es5-ext/global') + , polyfill = require('../polyfill'); + +module.exports = function (t, a) { + var cache; + a(typeof t(), 'boolean'); + cache = global.Symbol; + global.Symbol = polyfill; + a(t(), true); + if (cache === undefined) delete global.Symbol; + else global.Symbol = cache; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-native-implemented.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-native-implemented.js new file mode 100644 index 00000000..df8ba032 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-native-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-symbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-symbol.js new file mode 100644 index 00000000..ac24b9ab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/is-symbol.js @@ -0,0 +1,16 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t('raz'), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof Symbol !== 'undefined') { + a(t(Symbol()), true, "Native"); + } + a(t(SymbolPoly()), true, "Polyfill"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/polyfill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/polyfill.js new file mode 100644 index 00000000..8b657905 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/polyfill.js @@ -0,0 +1,29 @@ +'use strict'; + +var d = require('d') + , isSymbol = require('../is-symbol') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); + a(x instanceof T, false); + + a(isSymbol(symbol), true, "Symbol"); + a(isSymbol(T.iterator), true, "iterator"); + a(isSymbol(T.toStringTag), true, "toStringTag"); + + x = {}; + x[symbol] = 'foo'; + if (typeof symbol !== 'symbol') { + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + } + symbol = T.for('marko'); + a(isSymbol(symbol), true); + a(T.for('marko'), symbol); + a(T.keyFor(symbol), 'marko'); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/validate-symbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/validate-symbol.js new file mode 100644 index 00000000..2c8f84c8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/test/validate-symbol.js @@ -0,0 +1,19 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + var symbol; + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(true); }, TypeError, "Primitive"); + a.throws(function () { t('raz'); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t([]); }, TypeError, "Array"); + if (typeof Symbol !== 'undefined') { + symbol = Symbol(); + a(t(symbol), symbol, "Native"); + } + symbol = SymbolPoly(); + a(t(symbol), symbol, "Polyfill"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/validate-symbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/validate-symbol.js new file mode 100644 index 00000000..42750043 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/es6-symbol/validate-symbol.js @@ -0,0 +1,8 @@ +'use strict'; + +var isSymbol = require('./is-symbol'); + +module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/index.js new file mode 100644 index 00000000..7834bf9b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/license b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/package.json new file mode 100644 index 00000000..22a34df5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/package.json @@ -0,0 +1,81 @@ +{ + "_from": "escape-string-regexp@^1.0.5", + "_id": "escape-string-regexp@1.0.5", + "_inBundle": false, + "_integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "_location": "/node-red-contrib-johnny-five/escape-string-regexp", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "escape-string-regexp@^1.0.5", + "name": "escape-string-regexp", + "escapedName": "escape-string-regexp", + "rawSpec": "^1.0.5", + "saveSpec": null, + "fetchSpec": "^1.0.5" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/chalk" + ], + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "_spec": "escape-string-regexp@^1.0.5", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Escape RegExp special characters", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.8.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", + "keywords": [ + "escape", + "regex", + "regexp", + "re", + "regular", + "expression", + "string", + "str", + "special", + "characters" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Boy Nicolai Appelman", + "email": "joshua@jbna.nl", + "url": "jbna.nl" + } + ], + "name": "escape-string-regexp", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.5" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/readme.md new file mode 100644 index 00000000..87ac82d5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +``` +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> 'how much \$ for a unicorn\?' + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.lint b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.lint new file mode 100644 index 00000000..f76e528e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.lint @@ -0,0 +1,15 @@ +@root + +module +es5 + +indent 2 +maxlen 80 +tabs + +ass +plusplus +nomen + +./benchmark +predef+ console diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.npmignore new file mode 100644 index 00000000..68ebfddd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.npmignore @@ -0,0 +1,3 @@ +.DS_Store +/.lintcache +/node_modules diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.testignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.testignore new file mode 100644 index 00000000..f9c8c381 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.testignore @@ -0,0 +1 @@ +/benchmark diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.travis.yml new file mode 100644 index 00000000..5f29034c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/.travis.yml @@ -0,0 +1,16 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + - 6 + - 7 + +before_install: + - mkdir node_modules; ln -s ../ node_modules/event-emitter + +notifications: + email: + - medikoo+event-emitter@medikoo.com + +script: "npm test && npm run lint" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/CHANGES b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/CHANGES new file mode 100644 index 00000000..3ac46ce8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/CHANGES @@ -0,0 +1,73 @@ +v0.3.5 -- 2017.03.15 +* Improve documentation +* Update dependencies + +v0.3.4 -- 2015.10.02 +* Add `emitError` extension + +v0.3.3 -- 2015.01.30 +* Fix reference to module in benchmarks + +v0.3.2 -- 2015.01.20 +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + +v0.3.1 -- 2014.04.25 +* Fix redefinition of emit method in `pipe` +* Allow custom emit method name in `pipe` + +v0.3.0 -- 2014.04.24 +* Move out from lib folder +* Do not expose all utilities on main module +* Support objects which do not inherit from Object.prototype +* Improve arguments validation +* Improve internals +* Remove Makefile +* Improve documentation + +v0.2.2 -- 2013.06.05 +* `unify` functionality + +v0.2.1 -- 2012.09.21 +* hasListeners module +* Simplified internal id (improves performance a little), now it starts with + underscore (hint it's private). Abstracted it to external module to have it + one place +* Documentation cleanup + +v0.2.0 -- 2012.09.19 +* Trashed poor implementation of v0.1 and came up with something solid + +Changes: +* Improved performance +* Fixed bugs event-emitter is now cross-prototype safe and not affected by + unexpected methods attached to Object.prototype +* Removed support for optional "emitter" argument in `emit` method, it was + cumbersome to use, and should be solved just with event objects + +v0.1.5 -- 2012.08.06 +* (maintanance) Do not use descriptors for internal objects, it exposes V8 bugs + (only Node v0.6 branch) + +v0.1.4 -- 2012.06.13 +* Fix detachment of listeners added with 'once' + +v0.1.3 -- 2012.05.28 +* Updated es5-ext to latest version (v0.8) +* Cleared package.json so it's in npm friendly format + +v0.1.2 -- 2012.01.22 +* Support for emitter argument in emit function, this allows some listeners not + to be notified about event +* allOff - removes all listeners from object +* All methods returns self object +* Internal fixes +* Travis CI integration + +v0.1.1 -- 2011.08.08 +* Added TAD test suite to devDependencies, configured test commands. + Tests can be run with 'make test' or 'npm test' + +v0.1.0 -- 2011.08.08 +Initial version diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/LICENSE new file mode 100644 index 00000000..ccb76f6e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2015 Mariusz Nowak (www.medikoo.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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/README.md new file mode 100644 index 00000000..04990542 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/README.md @@ -0,0 +1,98 @@ +# event-emitter +## Environment agnostic event emitter + +### Installation + + $ npm install event-emitter + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +### Usage + +```javascript +var ee = require('event-emitter'); + +var MyClass = function () { /* .. */ }; +ee(MyClass.prototype); // All instances of MyClass will expose event-emitter interface + +var emitter = new MyClass(), listener; + +emitter.on('test', listener = function (args) { + // … react to 'test' event +}); + +emitter.once('test', function (args) { + // … react to first 'test' event (invoked only once!) +}); + +emitter.emit('test', arg1, arg2/*…args*/); // Two above listeners invoked +emitter.emit('test', arg1, arg2/*…args*/); // Only first listener invoked + +emitter.off('test', listener); // Removed first listener +emitter.emit('test', arg1, arg2/*…args*/); // No listeners invoked +``` +### Additional utilities + +#### allOff(obj) _(event-emitter/all-off)_ + +Removes all listeners from given event emitter object + +#### hasListeners(obj[, name]) _(event-emitter/has-listeners)_ + +Whether object has some listeners attached to the object. +When `name` is provided, it checks listeners for specific event name + +```javascript +var emitter = ee(); +var hasListeners = require('event-emitter/has-listeners'); +var listener = function () {}; + +hasListeners(emitter); // false + +emitter.on('foo', listener); +hasListeners(emitter); // true +hasListeners(emitter, 'foo'); // true +hasListeners(emitter, 'bar'); // false + +emitter.off('foo', listener); +hasListeners(emitter, 'foo'); // false +``` + +#### pipe(source, target[, emitMethodName]) _(event-emitter/pipe)_ + +Pipes all events from _source_ emitter onto _target_ emitter (all events from _source_ emitter will be emitted also on _target_ emitter, but not other way). +Returns _pipe_ object which exposes `pipe.close` function. Invoke it to close configured _pipe_. +It works internally by redefinition of `emit` method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument. + +#### unify(emitter1, emitter2) _(event-emitter/unify)_ + +Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitted on _emitter2_, and other way back. +Non reversible. + +```javascript +var eeUnify = require('event-emitter/unify'); + +var emitter1 = ee(), listener1, listener3; +var emitter2 = ee(), listener2, listener4; + +emitter1.on('test', listener1 = function () { }); +emitter2.on('test', listener2 = function () { }); + +emitter1.emit('test'); // Invoked listener1 +emitter2.emit('test'); // Invoked listener2 + +var unify = eeUnify(emitter1, emitter2); + +emitter1.emit('test'); // Invoked listener1 and listener2 +emitter2.emit('test'); // Invoked listener1 and listener2 + +emitter1.on('test', listener3 = function () { }); +emitter2.on('test', listener4 = function () { }); + +emitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4 +emitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4 +``` + +### Tests [![Build Status](https://travis-ci.org/medikoo/event-emitter.png)](https://travis-ci.org/medikoo/event-emitter) + + $ npm test diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/all-off.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/all-off.js new file mode 100644 index 00000000..829be65c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/all-off.js @@ -0,0 +1,19 @@ +'use strict'; + +var value = require('es5-ext/object/valid-object') + + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (emitter/*, type*/) { + var type = arguments[1], data; + + value(emitter); + + if (type !== undefined) { + data = hasOwnProperty.call(emitter, '__ee__') && emitter.__ee__; + if (!data) return; + if (data[type]) delete data[type]; + return; + } + if (hasOwnProperty.call(emitter, '__ee__')) delete emitter.__ee__; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/benchmark/many-on.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/benchmark/many-on.js new file mode 100644 index 00000000..e09bfde8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/benchmark/many-on.js @@ -0,0 +1,83 @@ +'use strict'; + +// Benchmark comparing performance of event emit for many listeners +// To run it, do following in memoizee package path: +// +// $ npm install eventemitter2 signals +// $ node benchmark/many-on.js + +var forEach = require('es5-ext/object/for-each') + , pad = require('es5-ext/string/#/pad') + + , now = Date.now + + , time, count = 1000000, i, data = {} + , ee, native, ee2, signals, a = {}, b = {}; + +ee = (function () { + var ee = require('../')(); + ee.on('test', function () { return arguments; }); + ee.on('test', function () { return arguments; }); + return ee.on('test', function () { return arguments; }); +}()); + +native = (function () { + var ee = require('events'); + ee = new ee.EventEmitter(); + ee.on('test', function () { return arguments; }); + ee.on('test', function () { return arguments; }); + return ee.on('test', function () { return arguments; }); +}()); + +ee2 = (function () { + var ee = require('eventemitter2'); + ee = new ee.EventEmitter2(); + ee.on('test', function () { return arguments; }); + ee.on('test', function () { return arguments; }); + return ee.on('test', function () { return arguments; }); +}()); + +signals = (function () { + var Signal = require('signals') + , ee = { test: new Signal() }; + ee.test.add(function () { return arguments; }); + ee.test.add(function () { return arguments; }); + ee.test.add(function () { return arguments; }); + return ee; +}()); + +console.log("Emit for 3 listeners", "x" + count + ":\n"); + +i = count; +time = now(); +while (i--) { + ee.emit('test', a, b); +} +data["event-emitter (this implementation)"] = now() - time; + +i = count; +time = now(); +while (i--) { + native.emit('test', a, b); +} +data["EventEmitter (Node.js native)"] = now() - time; + +i = count; +time = now(); +while (i--) { + ee2.emit('test', a, b); +} +data.EventEmitter2 = now() - time; + +i = count; +time = now(); +while (i--) { + signals.test.dispatch(a, b); +} +data.Signals = now() - time; + +forEach(data, function (value, name, obj, index) { + console.log(index + 1 + ":", pad.call(value, " ", 5), name); +}, null, function (a, b) { + return this[a] - this[b]; +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/benchmark/single-on.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/benchmark/single-on.js new file mode 100644 index 00000000..99decbda --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/benchmark/single-on.js @@ -0,0 +1,73 @@ +'use strict'; + +// Benchmark comparing performance of event emit for single listener +// To run it, do following in memoizee package path: +// +// $ npm install eventemitter2 signals +// $ node benchmark/single-on.js + +var forEach = require('es5-ext/object/for-each') + , pad = require('es5-ext/string/#/pad') + + , now = Date.now + + , time, count = 1000000, i, data = {} + , ee, native, ee2, signals, a = {}, b = {}; + +ee = (function () { + var ee = require('../'); + return ee().on('test', function () { return arguments; }); +}()); + +native = (function () { + var ee = require('events'); + return (new ee.EventEmitter()).on('test', function () { return arguments; }); +}()); + +ee2 = (function () { + var ee = require('eventemitter2'); + return (new ee.EventEmitter2()).on('test', function () { return arguments; }); +}()); + +signals = (function () { + var Signal = require('signals') + , ee = { test: new Signal() }; + ee.test.add(function () { return arguments; }); + return ee; +}()); + +console.log("Emit for single listener", "x" + count + ":\n"); + +i = count; +time = now(); +while (i--) { + ee.emit('test', a, b); +} +data["event-emitter (this implementation)"] = now() - time; + +i = count; +time = now(); +while (i--) { + native.emit('test', a, b); +} +data["EventEmitter (Node.js native)"] = now() - time; + +i = count; +time = now(); +while (i--) { + ee2.emit('test', a, b); +} +data.EventEmitter2 = now() - time; + +i = count; +time = now(); +while (i--) { + signals.test.dispatch(a, b); +} +data.Signals = now() - time; + +forEach(data, function (value, name, obj, index) { + console.log(index + 1 + ":", pad.call(value, " ", 5), name); +}, null, function (a, b) { + return this[a] - this[b]; +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/emit-error.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/emit-error.js new file mode 100644 index 00000000..769b4c53 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/emit-error.js @@ -0,0 +1,13 @@ +'use strict'; + +var ensureError = require('es5-ext/error/valid-error') + , ensureObject = require('es5-ext/object/valid-object') + + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (err) { + (ensureObject(this) && ensureError(err)); + if (!hasOwnProperty.call(ensureObject(this), '__ee__')) throw err; + if (!this.__ee__.error) throw err; + this.emit('error', err); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/has-listeners.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/has-listeners.js new file mode 100644 index 00000000..8744522e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/has-listeners.js @@ -0,0 +1,16 @@ +'use strict'; + +var isEmpty = require('es5-ext/object/is-empty') + , value = require('es5-ext/object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (obj/*, type*/) { + var type; + value(obj); + type = arguments[1]; + if (arguments.length > 1) { + return hasOwnProperty.call(obj, '__ee__') && Boolean(obj.__ee__[type]); + } + return obj.hasOwnProperty('__ee__') && !isEmpty(obj.__ee__); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/index.js new file mode 100644 index 00000000..c36d3e49 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/index.js @@ -0,0 +1,132 @@ +'use strict'; + +var d = require('d') + , callable = require('es5-ext/object/valid-callable') + + , apply = Function.prototype.apply, call = Function.prototype.call + , create = Object.create, defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties + , hasOwnProperty = Object.prototype.hasOwnProperty + , descriptor = { configurable: true, enumerable: false, writable: true } + + , on, once, off, emit, methods, descriptors, base; + +on = function (type, listener) { + var data; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) { + data = descriptor.value = create(null); + defineProperty(this, '__ee__', descriptor); + descriptor.value = null; + } else { + data = this.__ee__; + } + if (!data[type]) data[type] = listener; + else if (typeof data[type] === 'object') data[type].push(listener); + else data[type] = [data[type], listener]; + + return this; +}; + +once = function (type, listener) { + var once, self; + + callable(listener); + self = this; + on.call(this, type, once = function () { + off.call(self, type, once); + apply.call(listener, this, arguments); + }); + + once.__eeOnceListener__ = listener; + return this; +}; + +off = function (type, listener) { + var data, listeners, candidate, i; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) return this; + data = this.__ee__; + if (!data[type]) return this; + listeners = data[type]; + + if (typeof listeners === 'object') { + for (i = 0; (candidate = listeners[i]); ++i) { + if ((candidate === listener) || + (candidate.__eeOnceListener__ === listener)) { + if (listeners.length === 2) data[type] = listeners[i ? 0 : 1]; + else listeners.splice(i, 1); + } + } + } else { + if ((listeners === listener) || + (listeners.__eeOnceListener__ === listener)) { + delete data[type]; + } + } + + return this; +}; + +emit = function (type) { + var i, l, listener, listeners, args; + + if (!hasOwnProperty.call(this, '__ee__')) return; + listeners = this.__ee__[type]; + if (!listeners) return; + + if (typeof listeners === 'object') { + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) args[i - 1] = arguments[i]; + + listeners = listeners.slice(); + for (i = 0; (listener = listeners[i]); ++i) { + apply.call(listener, this, args); + } + } else { + switch (arguments.length) { + case 1: + call.call(listeners, this); + break; + case 2: + call.call(listeners, this, arguments[1]); + break; + case 3: + call.call(listeners, this, arguments[1], arguments[2]); + break; + default: + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) { + args[i - 1] = arguments[i]; + } + apply.call(listeners, this, args); + } + } +}; + +methods = { + on: on, + once: once, + off: off, + emit: emit +}; + +descriptors = { + on: d(on), + once: d(once), + off: d(off), + emit: d(emit) +}; + +base = defineProperties({}, descriptors); + +module.exports = exports = function (o) { + return (o == null) ? create(base) : defineProperties(Object(o), descriptors); +}; +exports.methods = methods; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/package.json new file mode 100644 index 00000000..aa3f6642 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/package.json @@ -0,0 +1,68 @@ +{ + "_from": "event-emitter@~0.3.5", + "_id": "event-emitter@0.3.5", + "_inBundle": false, + "_integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "_location": "/node-red-contrib-johnny-five/event-emitter", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "event-emitter@~0.3.5", + "name": "event-emitter", + "escapedName": "event-emitter", + "rawSpec": "~0.3.5", + "saveSpec": null, + "fetchSpec": "~0.3.5" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/es6-map", + "/node-red-contrib-johnny-five/es6-set" + ], + "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "_shasum": "df8c69eef1647923c7157b9ce83840610b02cc39", + "_spec": "event-emitter@~0.3.5", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/es6-map", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/event-emitter/issues" + }, + "bundleDependencies": false, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + }, + "deprecated": false, + "description": "Environment agnostic event emitter", + "devDependencies": { + "tad": "~0.2.7", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "homepage": "https://github.com/medikoo/event-emitter#readme", + "keywords": [ + "event", + "events", + "trigger", + "observer", + "listener", + "emitter", + "pubsub" + ], + "license": "MIT", + "name": "event-emitter", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/event-emitter.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "0.3.5" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/pipe.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/pipe.js new file mode 100644 index 00000000..0088efef --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/pipe.js @@ -0,0 +1,42 @@ +'use strict'; + +var aFrom = require('es5-ext/array/from') + , remove = require('es5-ext/array/#/remove') + , value = require('es5-ext/object/valid-object') + , d = require('d') + , emit = require('./').methods.emit + + , defineProperty = Object.defineProperty + , hasOwnProperty = Object.prototype.hasOwnProperty + , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +module.exports = function (e1, e2/*, name*/) { + var pipes, pipe, desc, name; + + (value(e1) && value(e2)); + name = arguments[2]; + if (name === undefined) name = 'emit'; + + pipe = { + close: function () { remove.call(pipes, e2); } + }; + if (hasOwnProperty.call(e1, '__eePipes__')) { + (pipes = e1.__eePipes__).push(e2); + return pipe; + } + defineProperty(e1, '__eePipes__', d('c', pipes = [e2])); + desc = getOwnPropertyDescriptor(e1, name); + if (!desc) { + desc = d('c', undefined); + } else { + delete desc.get; + delete desc.set; + } + desc.value = function () { + var i, emitter, data = aFrom(pipes); + emit.apply(this, arguments); + for (i = 0; (emitter = data[i]); ++i) emit.apply(emitter, arguments); + }; + defineProperty(e1, name, desc); + return pipe; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/all-off.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/all-off.js new file mode 100644 index 00000000..8aa872e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/all-off.js @@ -0,0 +1,48 @@ +'use strict'; + +var ee = require('../'); + +module.exports = function (t, a) { + var x, count, count2; + + x = ee(); + count = 0; + count2 = 0; + x.on('foo', function () { + ++count; + }); + x.on('foo', function () { + ++count; + }); + x.on('bar', function () { + ++count2; + }); + x.on('bar', function () { + ++count2; + }); + t(x, 'foo'); + x.emit('foo'); + x.emit('bar'); + a(count, 0, "All off: type"); + a(count2, 2, "All off: ohter type"); + + count = 0; + count2 = 0; + x.on('foo', function () { + ++count; + }); + x.on('foo', function () { + ++count; + }); + x.on('bar', function () { + ++count2; + }); + x.on('bar', function () { + ++count2; + }); + t(x); + x.emit('foo'); + x.emit('bar'); + a(count, 0, "All off: type"); + a(count2, 0, "All off: other type"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/emit-error.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/emit-error.js new file mode 100644 index 00000000..edac350a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/emit-error.js @@ -0,0 +1,14 @@ +'use strict'; + +var customError = require('es5-ext/error/custom') + , ee = require('../'); + +module.exports = function (t, a) { + var x, error = customError('Some error', 'ERROR_TEST'), emitted; + + x = ee(); + a.throws(function () { t.call(x, error); }, 'ERROR_TEST'); + x.on('error', function (err) { emitted = err; }); + t.call(x, error); + a(emitted, error); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/has-listeners.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/has-listeners.js new file mode 100644 index 00000000..875b048a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/has-listeners.js @@ -0,0 +1,42 @@ +'use strict'; + +var ee = require('../'); + +module.exports = function (t) { + var x, y; + return { + Any: function (a) { + a(t(true), false, "Primitive"); + a(t({ events: [] }), false, "Other object"); + a(t(x = ee()), false, "Emitter: empty"); + + x.on('test', y = function () {}); + a(t(x), true, "Emitter: full"); + x.off('test', y); + a(t(x), false, "Emitter: empty but touched"); + x.once('test', y = function () {}); + a(t(x), true, "Emitter: full: Once"); + x.off('test', y); + a(t(x), false, "Emitter: empty but touched by once"); + }, + Specific: function (a) { + a(t(true, 'test'), false, "Primitive"); + a(t({ events: [] }, 'test'), false, "Other object"); + a(t(x = ee(), 'test'), false, "Emitter: empty"); + + x.on('test', y = function () {}); + a(t(x, 'test'), true, "Emitter: full"); + a(t(x, 'foo'), false, "Emitter: full, other event"); + x.off('test', y); + a(t(x, 'test'), false, "Emitter: empty but touched"); + a(t(x, 'foo'), false, "Emitter: empty but touched, other event"); + + x.once('test', y = function () {}); + a(t(x, 'test'), true, "Emitter: full: Once"); + a(t(x, 'foo'), false, "Emitter: full: Once, other event"); + x.off('test', y); + a(t(x, 'test'), false, "Emitter: empty but touched by once"); + a(t(x, 'foo'), false, "Emitter: empty but touched by once, other event"); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/index.js new file mode 100644 index 00000000..c7c3f24c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/index.js @@ -0,0 +1,107 @@ +'use strict'; + +module.exports = function (t, a) { + var x = t(), y, count, count2, count3, count4, test, listener1, listener2; + + x.emit('none'); + + test = "Once: "; + count = 0; + x.once('foo', function (a1, a2, a3) { + a(this, x, test + "Context"); + a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments"); + ++count; + }); + + x.emit('foobar'); + a(count, 0, test + "Not invoked on other event"); + x.emit('foo', 'foo', x, 15); + a(count, 1, test + "Emitted"); + x.emit('foo'); + a(count, 1, test + "Emitted once"); + + test = "On & Once: "; + count = 0; + x.on('foo', listener1 = function (a1, a2, a3) { + a(this, x, test + "Context"); + a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments"); + ++count; + }); + count2 = 0; + x.once('foo', listener2 = function (a1, a2, a3) { + a(this, x, test + "Context"); + a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments"); + ++count2; + }); + + x.emit('foobar'); + a(count, 0, test + "Not invoked on other event"); + x.emit('foo', 'foo', x, 15); + a(count, 1, test + "Emitted"); + x.emit('foo', 'foo', x, 15); + a(count, 2, test + "Emitted twice"); + a(count2, 1, test + "Emitted once"); + x.off('foo', listener1); + x.emit('foo'); + a(count, 2, test + "Not emitter after off"); + + count = 0; + x.once('foo', listener1 = function () { ++count; }); + + x.off('foo', listener1); + x.emit('foo'); + a(count, 0, "Once Off: Not emitted"); + + count = 0; + x.on('foo', listener2 = function () {}); + x.once('foo', listener1 = function () { ++count; }); + + x.off('foo', listener1); + x.emit('foo'); + a(count, 0, "Once Off (multi): Not emitted"); + x.off('foo', listener2); + + test = "Prototype Share: "; + + y = Object.create(x); + + count = 0; + count2 = 0; + count3 = 0; + count4 = 0; + x.on('foo', function () { + ++count; + }); + y.on('foo', function () { + ++count2; + }); + x.once('foo', function () { + ++count3; + }); + y.once('foo', function () { + ++count4; + }); + x.emit('foo'); + a(count, 1, test + "x on count"); + a(count2, 0, test + "y on count"); + a(count3, 1, test + "x once count"); + a(count4, 0, test + "y once count"); + + y.emit('foo'); + a(count, 1, test + "x on count"); + a(count2, 1, test + "y on count"); + a(count3, 1, test + "x once count"); + a(count4, 1, test + "y once count"); + + x.emit('foo'); + a(count, 2, test + "x on count"); + a(count2, 1, test + "y on count"); + a(count3, 1, test + "x once count"); + a(count4, 1, test + "y once count"); + + y.emit('foo'); + a(count, 2, test + "x on count"); + a(count2, 2, test + "y on count"); + a(count3, 1, test + "x once count"); + a(count4, 1, test + "y once count"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/pipe.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/pipe.js new file mode 100644 index 00000000..9d15d6da --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/pipe.js @@ -0,0 +1,53 @@ +'use strict'; + +var ee = require('../'); + +module.exports = function (t, a) { + var x = {}, y = {}, z = {}, count, count2, count3, pipe; + + ee(x); + x = Object.create(x); + ee(y); + ee(z); + + count = 0; + count2 = 0; + count3 = 0; + x.on('foo', function () { + ++count; + }); + y.on('foo', function () { + ++count2; + }); + z.on('foo', function () { + ++count3; + }); + + x.emit('foo'); + a(count, 1, "Pre pipe, x"); + a(count2, 0, "Pre pipe, y"); + a(count3, 0, "Pre pipe, z"); + + pipe = t(x, y); + x.emit('foo'); + a(count, 2, "Post pipe, x"); + a(count2, 1, "Post pipe, y"); + a(count3, 0, "Post pipe, z"); + + y.emit('foo'); + a(count, 2, "Post pipe, on y, x"); + a(count2, 2, "Post pipe, on y, y"); + a(count3, 0, "Post pipe, on y, z"); + + t(x, z); + x.emit('foo'); + a(count, 3, "Post pipe z, x"); + a(count2, 3, "Post pipe z, y"); + a(count3, 1, "Post pipe z, z"); + + pipe.close(); + x.emit('foo'); + a(count, 4, "Close pipe y, x"); + a(count2, 3, "Close pipe y, y"); + a(count3, 2, "Close pipe y, z"); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/unify.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/unify.js new file mode 100644 index 00000000..69295e06 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/test/unify.js @@ -0,0 +1,123 @@ +'use strict'; + +var ee = require('../'); + +module.exports = function (t) { + + return { + "": function (a) { + var x = {}, y = {}, z = {}, count, count2, count3; + + ee(x); + ee(y); + ee(z); + + count = 0; + count2 = 0; + count3 = 0; + x.on('foo', function () { ++count; }); + y.on('foo', function () { ++count2; }); + z.on('foo', function () { ++count3; }); + + x.emit('foo'); + a(count, 1, "Pre unify, x"); + a(count2, 0, "Pre unify, y"); + a(count3, 0, "Pre unify, z"); + + t(x, y); + a(x.__ee__, y.__ee__, "Post unify y"); + x.emit('foo'); + a(count, 2, "Post unify, x"); + a(count2, 1, "Post unify, y"); + a(count3, 0, "Post unify, z"); + + y.emit('foo'); + a(count, 3, "Post unify, on y, x"); + a(count2, 2, "Post unify, on y, y"); + a(count3, 0, "Post unify, on y, z"); + + t(x, z); + a(x.__ee__, x.__ee__, "Post unify z"); + x.emit('foo'); + a(count, 4, "Post unify z, x"); + a(count2, 3, "Post unify z, y"); + a(count3, 1, "Post unify z, z"); + }, + "On empty": function (a) { + var x = {}, y = {}, z = {}, count, count2, count3; + + ee(x); + ee(y); + ee(z); + + count = 0; + count2 = 0; + count3 = 0; + y.on('foo', function () { ++count2; }); + x.emit('foo'); + a(count, 0, "Pre unify, x"); + a(count2, 0, "Pre unify, y"); + a(count3, 0, "Pre unify, z"); + + t(x, y); + a(x.__ee__, y.__ee__, "Post unify y"); + x.on('foo', function () { ++count; }); + x.emit('foo'); + a(count, 1, "Post unify, x"); + a(count2, 1, "Post unify, y"); + a(count3, 0, "Post unify, z"); + + y.emit('foo'); + a(count, 2, "Post unify, on y, x"); + a(count2, 2, "Post unify, on y, y"); + a(count3, 0, "Post unify, on y, z"); + + t(x, z); + a(x.__ee__, z.__ee__, "Post unify z"); + z.on('foo', function () { ++count3; }); + x.emit('foo'); + a(count, 3, "Post unify z, x"); + a(count2, 3, "Post unify z, y"); + a(count3, 1, "Post unify z, z"); + }, + Many: function (a) { + var x = {}, y = {}, z = {}, count, count2, count3; + + ee(x); + ee(y); + ee(z); + + count = 0; + count2 = 0; + count3 = 0; + x.on('foo', function () { ++count; }); + y.on('foo', function () { ++count2; }); + y.on('foo', function () { ++count2; }); + z.on('foo', function () { ++count3; }); + + x.emit('foo'); + a(count, 1, "Pre unify, x"); + a(count2, 0, "Pre unify, y"); + a(count3, 0, "Pre unify, z"); + + t(x, y); + a(x.__ee__, y.__ee__, "Post unify y"); + x.emit('foo'); + a(count, 2, "Post unify, x"); + a(count2, 2, "Post unify, y"); + a(count3, 0, "Post unify, z"); + + y.emit('foo'); + a(count, 3, "Post unify, on y, x"); + a(count2, 4, "Post unify, on y, y"); + a(count3, 0, "Post unify, on y, z"); + + t(x, z); + a(x.__ee__, x.__ee__, "Post unify z"); + x.emit('foo'); + a(count, 4, "Post unify z, x"); + a(count2, 6, "Post unify z, y"); + a(count3, 1, "Post unify z, z"); + } + }; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/unify.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/unify.js new file mode 100644 index 00000000..c6a858a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/event-emitter/unify.js @@ -0,0 +1,50 @@ +'use strict'; + +var forEach = require('es5-ext/object/for-each') + , validValue = require('es5-ext/object/valid-object') + + , push = Array.prototype.apply, defineProperty = Object.defineProperty + , create = Object.create, hasOwnProperty = Object.prototype.hasOwnProperty + , d = { configurable: true, enumerable: false, writable: true }; + +module.exports = function (e1, e2) { + var data; + (validValue(e1) && validValue(e2)); + if (!hasOwnProperty.call(e1, '__ee__')) { + if (!hasOwnProperty.call(e2, '__ee__')) { + d.value = create(null); + defineProperty(e1, '__ee__', d); + defineProperty(e2, '__ee__', d); + d.value = null; + return; + } + d.value = e2.__ee__; + defineProperty(e1, '__ee__', d); + d.value = null; + return; + } + data = d.value = e1.__ee__; + if (!hasOwnProperty.call(e2, '__ee__')) { + defineProperty(e2, '__ee__', d); + d.value = null; + return; + } + if (data === e2.__ee__) return; + forEach(e2.__ee__, function (listener, name) { + if (!data[name]) { + data[name] = listener; + return; + } + if (typeof data[name] === 'object') { + if (typeof listener === 'object') push.apply(data[name], listener); + else data[name].push(listener); + } else if (typeof listener === 'object') { + listener.unshift(data[name]); + data[name] = listener; + } else { + data[name] = [data[name], listener]; + } + }); + defineProperty(e2, '__ee__', d); + d.value = null; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/.travis.yml similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/.travis.yml rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/.travis.yml diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/index.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/index.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/index.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/package.json similarity index 90% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/package.json index 6cc896d7..3edb5ef5 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/package.json @@ -3,7 +3,7 @@ "_id": "expand-template@2.0.3", "_inBundle": false, "_integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", - "_location": "/raspi-io/expand-template", + "_location": "/node-red-contrib-johnny-five/expand-template", "_phantomChildren": {}, "_requested": { "type": "range", @@ -16,12 +16,12 @@ "fetchSpec": "^2.0.3" }, "_requiredBy": [ - "/raspi-io/prebuild-install" + "/node-red-contrib-johnny-five/prebuild-install" ], "_resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", "_shasum": "6e14b3fcee0f3a6340ecb57d2e8918692052a47c", "_spec": "expand-template@^2.0.3", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/prebuild-install", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/prebuild-install", "author": { "name": "LM", "email": "ralphtheninja@riseup.net" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/test.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/expand-template/test.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/expand-template/test.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.editorconfig b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.editorconfig new file mode 100644 index 00000000..bc228f82 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.eslintrc b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.eslintrc new file mode 100644 index 00000000..a34cf283 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.eslintrc @@ -0,0 +1,17 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": [2, 20], + "eqeqeq": [2, "allow-null"], + "func-name-matching": [1], + "max-depth": [1, 4], + "max-statements": [2, 26], + "no-extra-parens": [1], + "no-magic-numbers": [0], + "no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"], + "sort-keys": [0], + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.jscs.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.jscs.json new file mode 100644 index 00000000..3cce01d7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.jscs.json @@ -0,0 +1,175 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 6 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": false, + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.travis.yml new file mode 100644 index 00000000..5ccdfc49 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/.travis.yml @@ -0,0 +1,230 @@ +language: node_js +os: + - linux +node_js: + - "10.7" + - "9.11" + - "8.11" + - "7.10" + - "6.14" + - "5.12" + - "4.9" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "lts/*" + env: PRETEST=true + - node_js: "lts/*" + env: POSTTEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "10.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "10.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "9.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.13" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.12" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/LICENSE new file mode 100644 index 00000000..e16d6a56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2014 Stefan Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/README.md new file mode 100644 index 00000000..5b8249aa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/README.md @@ -0,0 +1,81 @@ +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] + +# extend() for Node.js [![Version Badge][npm-version-png]][npm-url] + +`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true. + +Notes: + +* Since Node.js >= 4, + [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + now offers the same functionality natively (but without the "deep copy" option). + See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6). +* Some native implementations of `Object.assign` in both Node.js and many + browsers (since NPM modules are for the browser too) may not be fully + spec-compliant. + Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for + a compliant candidate. + +## Installation + +This package is available on [npm][npm-url] as: `extend` + +``` sh +npm install extend +``` + +## Usage + +**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)** + +*Extend one object with one or more others, returning the modified object.* + +**Example:** + +``` js +var extend = require('extend'); +extend(targetObject, object1, object2); +``` + +Keep in mind that the target object will be modified, and will be returned from extend(). + +If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). +Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. +Warning: passing `false` as the first argument is not supported. + +### Arguments + +* `deep` *Boolean* (optional) +If set, the merge becomes recursive (i.e. deep copy). +* `target` *Object* +The object to extend. +* `object1` *Object* +The object that will be merged into the first. +* `objectN` *Object* (Optional) +More objects to merge into the first. + +## License + +`node-extend` is licensed under the [MIT License][mit-license-url]. + +## Acknowledgements + +All credit to the jQuery authors for perfecting this amazing utility. + +Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb]. + +[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg +[travis-url]: https://travis-ci.org/justmoon/node-extend +[npm-url]: https://npmjs.org/package/extend +[mit-license-url]: http://opensource.org/licenses/MIT +[github-justmoon]: https://github.com/justmoon +[github-insin]: https://github.com/insin +[github-ljharb]: https://github.com/ljharb +[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg +[deps-svg]: https://david-dm.org/justmoon/node-extend.svg +[deps-url]: https://david-dm.org/justmoon/node-extend +[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg +[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/component.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/component.json new file mode 100644 index 00000000..1500a2f3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/component.json @@ -0,0 +1,32 @@ +{ + "name": "extend", + "author": "Stefan Thomas (http://www.justmoon.net)", + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser.", + "scripts": [ + "index.js" + ], + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository" : { + "type": "git", + "url": "https://github.com/justmoon/node-extend.git" + }, + "dependencies": { + }, + "devDependencies": { + "tape" : "~3.0.0", + "covert": "~0.4.0", + "jscs": "~1.6.2" + } +} + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/index.js new file mode 100644 index 00000000..2aa3faae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/index.js @@ -0,0 +1,117 @@ +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; +var defineProperty = Object.defineProperty; +var gOPD = Object.getOwnPropertyDescriptor; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target +var setProperty = function setProperty(target, options) { + if (defineProperty && options.name === '__proto__') { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } +}; + +// Return undefined instead of __proto__ if '__proto__' is not an own property +var getProperty = function getProperty(obj, name) { + if (name === '__proto__') { + if (!hasOwn.call(obj, name)) { + return void 0; + } else if (gOPD) { + // In early versions of node, obj['__proto__'] is buggy when obj has + // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. + return gOPD(obj, name).value; + } + } + + return obj[name]; +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = getProperty(target, name); + copy = getProperty(options, name); + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + setProperty(target, { name: name, newValue: copy }); + } + } + } + } + } + + // Return the modified object + return target; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/package.json new file mode 100644 index 00000000..b081700c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/extend/package.json @@ -0,0 +1,75 @@ +{ + "_from": "extend@^3.0.0", + "_id": "extend@3.0.2", + "_inBundle": false, + "_integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "_location": "/node-red-contrib-johnny-five/extend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend@^3.0.0", + "name": "extend", + "escapedName": "extend", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/glob-stream" + ], + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "_shasum": "f8b1136b4071fbd8eb140aff858b1019ec2915fa", + "_spec": "extend@^3.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream", + "author": { + "name": "Stefan Thomas", + "email": "justmoon@members.fsf.org", + "url": "http://www.justmoon.net" + }, + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Port of jQuery.extend for node.js and the browser", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.19.1", + "jscs": "^3.0.7", + "tape": "^4.9.1" + }, + "homepage": "https://github.com/justmoon/node-extend#readme", + "keywords": [ + "extend", + "clone", + "merge" + ], + "license": "MIT", + "main": "index", + "name": "extend", + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage-quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "version": "3.0.2" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/.npmignore similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/.npmignore rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/.npmignore diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/.travis.yml similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/.travis.yml rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/.travis.yml diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/History.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/History.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/History.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/History.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/index.d.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/index.d.ts similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/index.d.ts rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/index.d.ts diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/index.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/index.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/index.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/package.json similarity index 91% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/package.json index 7eda14d7..f0fb9ab0 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/package.json @@ -3,7 +3,7 @@ "_id": "file-uri-to-path@1.0.0", "_inBundle": false, "_integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "_location": "/raspi-io/file-uri-to-path", + "_location": "/node-red-contrib-johnny-five/file-uri-to-path", "_phantomChildren": {}, "_requested": { "type": "version", @@ -16,12 +16,12 @@ "fetchSpec": "1.0.0" }, "_requiredBy": [ - "/raspi-io/bindings" + "/node-red-contrib-johnny-five/bindings" ], "_resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "_shasum": "553a7b8446ff6f684359c445f1e37a05dacc33dd", "_spec": "file-uri-to-path@1.0.0", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/bindings", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/bindings", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/test/test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/test/test.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/test/test.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/test/test.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/test/tests.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/test/tests.json similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/file-uri-to-path/test/tests.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/file-uri-to-path/test/tests.json diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/.tesselignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/.tesselignore new file mode 100644 index 00000000..ca90b42e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/.tesselignore @@ -0,0 +1,2 @@ +package-lock.json +readme.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/encoder7bit.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/encoder7bit.js new file mode 100644 index 00000000..0274bfc3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/encoder7bit.js @@ -0,0 +1,49 @@ +"use strict"; +/** + * "Inspired" by Encoder7Bit.h/Encoder7Bit.cpp in the + * Firmata source code. + */ +module.exports = { + to7BitArray(data) { + let shift = 0; + let previous = 0; + const output = []; + + for (let byte of data) { + if (shift === 0) { + output.push(byte & 0x7f); + shift++; + previous = byte >> 7; + } else { + output.push(((byte << shift) & 0x7f) | previous); + if (shift === 6) { + output.push(byte >> 1); + shift = 0; + } else { + shift++; + previous = byte >> (8 - shift); + } + } + } + + /* istanbul ignore else */ + if (shift > 0) { + output.push(previous); + } + + return output; + }, + from7BitArray(encoded) { + const expectedBytes = encoded.length * 7 >> 3; + const decoded = []; + + for (let i = 0; i < expectedBytes; i++) { + const j = i << 3; + const pos = (j / 7) >>> 0; + const shift = j % 7; + decoded[i] = (encoded[pos] >> shift) | ((encoded[pos + 1] << (7 - shift)) & 0xFF); + } + + return decoded; + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/firmata.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/firmata.js new file mode 100644 index 00000000..84785d04 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/firmata.js @@ -0,0 +1,2686 @@ +"use strict"; + +// Built-in Dependencies +const Emitter = require("events"); + +// Internal Dependencies +const Encoder7Bit = require("./encoder7bit"); +const OneWire = require("./onewireutils"); + +// Program specifics +const i2cActive = new Map(); + +/** + * constants + */ + +const ANALOG_MAPPING_QUERY = 0x69; +const ANALOG_MAPPING_RESPONSE = 0x6A; +const ANALOG_MESSAGE = 0xE0; +const CAPABILITY_QUERY = 0x6B; +const CAPABILITY_RESPONSE = 0x6C; +const DIGITAL_MESSAGE = 0x90; +const END_SYSEX = 0xF7; +const EXTENDED_ANALOG = 0x6F; +const I2C_CONFIG = 0x78; +const I2C_REPLY = 0x77; +const I2C_REQUEST = 0x76; +const I2C_READ_MASK = 0x18; // 0b00011000 +// const I2C_END_TX_MASK = 0x40; // 0b01000000 +const ONEWIRE_CONFIG_REQUEST = 0x41; +const ONEWIRE_DATA = 0x73; +const ONEWIRE_DELAY_REQUEST_BIT = 0x10; +const ONEWIRE_READ_REPLY = 0x43; +const ONEWIRE_READ_REQUEST_BIT = 0x08; +const ONEWIRE_RESET_REQUEST_BIT = 0x01; +const ONEWIRE_SEARCH_ALARMS_REPLY = 0x45; +const ONEWIRE_SEARCH_ALARMS_REQUEST = 0x44; +const ONEWIRE_SEARCH_REPLY = 0x42; +const ONEWIRE_SEARCH_REQUEST = 0x40; +const ONEWIRE_WITHDATA_REQUEST_BITS = 0x3C; +const ONEWIRE_WRITE_REQUEST_BIT = 0x20; +const PIN_MODE = 0xF4; +const PIN_STATE_QUERY = 0x6D; +const PIN_STATE_RESPONSE = 0x6E; +const PING_READ = 0x75; +// const PULSE_IN = 0x74; +// const PULSE_OUT = 0x73; +const QUERY_FIRMWARE = 0x79; +const REPORT_ANALOG = 0xC0; +const REPORT_DIGITAL = 0xD0; +const REPORT_VERSION = 0xF9; +const SAMPLING_INTERVAL = 0x7A; +const SERVO_CONFIG = 0x70; +const SERIAL_MESSAGE = 0x60; +const SERIAL_CONFIG = 0x10; +const SERIAL_WRITE = 0x20; +const SERIAL_READ = 0x30; +const SERIAL_REPLY = 0x40; +const SERIAL_CLOSE = 0x50; +const SERIAL_FLUSH = 0x60; +const SERIAL_LISTEN = 0x70; +const START_SYSEX = 0xF0; +const STEPPER = 0x72; +const ACCELSTEPPER = 0x62; +const STRING_DATA = 0x71; +const SYSTEM_RESET = 0xFF; + +const MAX_PIN_COUNT = 128; + +const SYM_sendOneWireSearch = Symbol("sendOneWireSearch"); +const SYM_sendOneWireRequest = Symbol("sendOneWireRequest"); + +/** + * MIDI_RESPONSE contains functions to be called when we receive a MIDI message from the arduino. + * used as a switch object as seen here http://james.padolsey.com/javascript/how-to-avoid-switch-case-syndrome/ + * @private + */ + +const MIDI_RESPONSE = { + + /** + * Handles a REPORT_VERSION response and emits the reportversion event. + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [REPORT_VERSION](board) { + board.version.major = board.buffer[1]; + board.version.minor = board.buffer[2]; + board.emit("reportversion"); + }, + + /** + * Handles a ANALOG_MESSAGE response and emits "analog-read" and "analog-read-"+n events where n is the pin number. + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [ANALOG_MESSAGE](board) { + const pin = board.buffer[0] & 0x0F; + const value = board.buffer[1] | (board.buffer[2] << 7); + + /* istanbul ignore else */ + if (board.pins[board.analogPins[pin]]) { + board.pins[board.analogPins[pin]].value = value; + } + + board.emit(`analog-read-${pin}`, value); + board.emit("analog-read", { + pin, + value, + }); + }, + + /** + * Handles a DIGITAL_MESSAGE response and emits: + * "digital-read" + * "digital-read-"+n + * + * Where n is the pin number. + * + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [DIGITAL_MESSAGE](board) { + const port = board.buffer[0] & 0x0F; + const portValue = board.buffer[1] | (board.buffer[2] << 7); + + for (let i = 0; i < 8; i++) { + const pin = 8 * port + i; + const pinRec = board.pins[pin]; + const bit = 1 << i; + + if (pinRec && (pinRec.mode === board.MODES.INPUT || pinRec.mode === board.MODES.PULLUP)) { + pinRec.value = (portValue >> (i & 0x07)) & 0x01; + + if (pinRec.value) { + board.ports[port] |= bit; + } else { + board.ports[port] &= ~bit; + } + + let {value} = pinRec; + + board.emit(`digital-read-${pin}`, value); + board.emit("digital-read", { + pin, + value, + }); + } + } + }, +}; + +/** + * SYSEX_RESPONSE contains functions to be called when we receive a SYSEX message from the arduino. + * used as a switch object as seen here http://james.padolsey.com/javascript/how-to-avoid-switch-case-syndrome/ + * @private + */ + +const SYSEX_RESPONSE = { + + /** + * Handles a QUERY_FIRMWARE response and emits the "queryfirmware" event + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [QUERY_FIRMWARE](board) { + const length = board.buffer.length - 2; + const buffer = Buffer.alloc(Math.round((length - 4) / 2)); + let byte = 0; + let offset = 0; + + for (let i = 4; i < length; i += 2) { + byte = ((board.buffer[i] & 0x7F) | ((board.buffer[i + 1] & 0x7F) << 7)) & 0xFF; + buffer.writeUInt8(byte, offset++); + } + + board.firmware = { + name: buffer.toString(), + version: { + major: board.buffer[2], + minor: board.buffer[3], + }, + }, + + board.emit("queryfirmware"); + }, + + /** + * Handles a CAPABILITY_RESPONSE response and emits the "capability-query" event + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [CAPABILITY_RESPONSE](board) { + const modes = Object.keys(board.MODES).map((key) => board.MODES[key]); + let mode, resolution; + let capability = 0; + + function supportedModes(capability) { + return modes.reduce((accum, mode) => { + if (capability & (1 << mode)) { + accum.push(mode); + } + return accum; + }, []); + } + + // Only create pins if none have been previously created on the instance. + if (!board.pins.length) { + for (let i = 2, n = 0; i < board.buffer.length - 1; i++) { + if (board.buffer[i] === 0x7F) { + board.pins.push({ + supportedModes: supportedModes(capability), + mode: undefined, + value: 0, + report: 1, + }); + capability = 0; + n = 0; + continue; + } + if (n === 0) { + mode = board.buffer[i]; + resolution = (1 << board.buffer[i + 1]) - 1; + capability |= (1 << mode); + + // ADC Resolution of Analog Inputs + if (mode === board.MODES.ANALOG && board.RESOLUTION.ADC === null) { + board.RESOLUTION.ADC = resolution; + } + + // PWM Resolution of PWM Outputs + if (mode === board.MODES.PWM && board.RESOLUTION.PWM === null) { + board.RESOLUTION.PWM = resolution; + } + + // DAC Resolution of DAC Outputs + // if (mode === board.MODES.DAC && board.RESOLUTION.DAC === null) { + // board.RESOLUTION.DAC = resolution; + // } + } + n ^= 1; + } + } + + board.emit("capability-query"); + }, + + /** + * Handles a PIN_STATE response and emits the 'pin-state-'+n event where n is the pin number. + * + * Note about pin state: For output modes, the state is any value that has been + * previously written to the pin. For input modes, the state is the status of + * the pullup resistor. + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [PIN_STATE_RESPONSE](board) { + let pin = board.buffer[2]; + board.pins[pin].mode = board.buffer[3]; + board.pins[pin].state = board.buffer[4]; + if (board.buffer.length > 6) { + board.pins[pin].state |= (board.buffer[5] << 7); + } + if (board.buffer.length > 7) { + board.pins[pin].state |= (board.buffer[6] << 14); + } + board.emit(`pin-state-${pin}`); + }, + + /** + * Handles a ANALOG_MAPPING_RESPONSE response and emits the "analog-mapping-query" event. + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [ANALOG_MAPPING_RESPONSE](board) { + let pin = 0; + let currentValue; + for (let i = 2; i < board.buffer.length - 1; i++) { + currentValue = board.buffer[i]; + board.pins[pin].analogChannel = currentValue; + if (currentValue !== 127) { + board.analogPins.push(pin); + } + pin++; + } + board.emit("analog-mapping-query"); + }, + + /** + * Handles a I2C_REPLY response and emits the "I2C-reply-"+n event where n is the slave address of the I2C device. + * The event is passed the buffer of data sent from the I2C Device + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [I2C_REPLY](board) { + const reply = []; + const address = (board.buffer[2] & 0x7F) | ((board.buffer[3] & 0x7F) << 7); + const register = (board.buffer[4] & 0x7F) | ((board.buffer[5] & 0x7F) << 7); + + for (let i = 6, length = board.buffer.length - 1; i < length; i += 2) { + reply.push(board.buffer[i] | (board.buffer[i + 1] << 7)); + } + + board.emit(`I2C-reply-${address}-${register}`, reply); + }, + + [ONEWIRE_DATA](board) { + const subCommand = board.buffer[2]; + + if (!SYSEX_RESPONSE[subCommand]) { + return; + } + + SYSEX_RESPONSE[subCommand](board); + }, + + [ONEWIRE_SEARCH_REPLY](board) { + const pin = board.buffer[3]; + const buffer = board.buffer.slice(4, board.buffer.length - 1); + + board.emit(`1-wire-search-reply-${pin}`, OneWire.readDevices(buffer)); + }, + + [ONEWIRE_SEARCH_ALARMS_REPLY](board) { + const pin = board.buffer[3]; + const buffer = board.buffer.slice(4, board.buffer.length - 1); + + board.emit(`1-wire-search-alarms-reply-${pin}`, OneWire.readDevices(buffer)); + }, + + [ONEWIRE_READ_REPLY](board) { + const encoded = board.buffer.slice(4, board.buffer.length - 1); + const decoded = Encoder7Bit.from7BitArray(encoded); + const correlationId = (decoded[1] << 8) | decoded[0]; + + board.emit(`1-wire-read-reply-${correlationId}`, decoded.slice(2)); + }, + + /** + * Handles a STRING_DATA response and logs the string to the console. + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [STRING_DATA](board) { + board.emit("string", Buffer.from(board.buffer.slice(2, -1)).toString().replace(/\0/g, "")); + }, + + /** + * Response from pingRead + */ + + [PING_READ](board) { + const pin = (board.buffer[2] & 0x7F) | ((board.buffer[3] & 0x7F) << 7); + const durationBuffer = [ + (board.buffer[4] & 0x7F) | ((board.buffer[5] & 0x7F) << 7), + (board.buffer[6] & 0x7F) | ((board.buffer[7] & 0x7F) << 7), + (board.buffer[8] & 0x7F) | ((board.buffer[9] & 0x7F) << 7), + (board.buffer[10] & 0x7F) | ((board.buffer[11] & 0x7F) << 7), + ]; + const duration = ((durationBuffer[0] << 24) + + (durationBuffer[1] << 16) + + (durationBuffer[2] << 8) + + (durationBuffer[3])); + board.emit(`ping-read-${pin}`, duration); + }, + + /** + * Handles the message from a stepper completing move + * @param {Board} board + */ + + [STEPPER](board) { + const deviceNum = board.buffer[2]; + board.emit(`stepper-done-${deviceNum}`, true); + }, + + /** + * Handles the message from a stepper or group of steppers completing move + * @param {Board} board + */ + + [ACCELSTEPPER](board) { + const command = board.buffer[2]; + const deviceNum = board.buffer[3]; + const value = command === 0x06 || command === 0x0A ? + decode32BitSignedInteger(board.buffer.slice(4, 9)) : null; + + if (command === 0x06) { + board.emit(`stepper-position-${deviceNum}`, value); + } + if (command === 0x0A) { + board.emit(`stepper-done-${deviceNum}`, value); + } + if (command === 0x24) { + board.emit(`multi-stepper-done-${deviceNum}`); + } + }, + + /** + * Handles a SERIAL_REPLY response and emits the "serial-data-"+n event where n is the id of the + * serial port. + * The event is passed the buffer of data sent from the serial device + * @private + * @param {Board} board the current arduino board we are working with. + */ + + [SERIAL_MESSAGE](board) { + const command = board.buffer[2] & START_SYSEX; + const portId = board.buffer[2] & 0x0F; + const reply = []; + + /* istanbul ignore else */ + if (command === SERIAL_REPLY) { + for (let i = 3, len = board.buffer.length; i < len - 1; i += 2) { + reply.push((board.buffer[i + 1] << 7) | board.buffer[i]); + } + board.emit(`serial-data-${portId}`, reply); + } + }, + + +}; + +/** + * The default transport class + */ + +let Transport = null; + + +/** + * @class The Board object represents an arduino board. + * @augments EventEmitter + * @param {String} port This is the serial port the arduino is connected to. + * @param {function} function A function to be called when the arduino is ready to communicate. + * @property MODES All the modes available for pins on this arduino board. + * @property I2C_MODES All the I2C modes available. + * @property SERIAL_MODES All the Serial modes available. + * @property SERIAL_PORT_ID ID values to pass as the portId parameter when calling serialConfig. + * @property HIGH A constant to set a pins value to HIGH when the pin is set to an output. + * @property LOW A constant to set a pins value to LOW when the pin is set to an output. + * @property pins An array of pin object literals. + * @property analogPins An array of analog pins and their corresponding indexes in the pins array. + * @property version An object indicating the major and minor version of the firmware currently running. + * @property firmware An object indicating the name, major and minor version of the firmware currently running. + * @property buffer An array holding the current bytes received from the arduino. + * @property {SerialPort} sp The serial port object used to communicate with the arduino. + */ + +class Firmata extends Emitter { + constructor(port, options, callback) { + super(); + + if (typeof options === "function" || typeof options === "undefined") { + callback = options; + options = {}; + } + + const board = this; + const defaults = { + reportVersionTimeout: 5000, + samplingInterval: 19, + serialport: { + baudRate: 57600, + // https://github.com/node-serialport/node-serialport/blob/5.0.0/UPGRADE_GUIDE.md#open-options + highWaterMark: 256, + }, + }; + + const settings = Object.assign({}, defaults, options); + + this.isReady = false; + + this.MODES = { + INPUT: 0x00, + OUTPUT: 0x01, + ANALOG: 0x02, + PWM: 0x03, + SERVO: 0x04, + SHIFT: 0x05, + I2C: 0x06, + ONEWIRE: 0x07, + STEPPER: 0x08, + SERIAL: 0x0A, + PULLUP: 0x0B, + IGNORE: 0x7F, + PING_READ: 0x75, + UNKOWN: 0x10, + }; + + this.I2C_MODES = { + WRITE: 0, + READ: 1, + CONTINUOUS_READ: 2, + STOP_READING: 3, + }; + + this.STEPPER = { + TYPE: { + DRIVER: 1, + TWO_WIRE: 2, + THREE_WIRE: 3, + FOUR_WIRE: 4, + }, + STEP_SIZE: { + WHOLE: 0, + HALF: 1 + }, + RUN_STATE: { + STOP: 0, + ACCEL: 1, + DECEL: 2, + RUN: 3, + }, + DIRECTION: { + CCW: 0, + CW: 1, + }, + }; + + this.SERIAL_MODES = { + CONTINUOUS_READ: 0x00, + STOP_READING: 0x01, + }; + + // ids for hardware and software serial ports on the board + this.SERIAL_PORT_IDs = { + HW_SERIAL0: 0x00, + HW_SERIAL1: 0x01, + HW_SERIAL2: 0x02, + HW_SERIAL3: 0x03, + SW_SERIAL0: 0x08, + SW_SERIAL1: 0x09, + SW_SERIAL2: 0x10, + SW_SERIAL3: 0x11, + + // Default can be used by dependant libraries to key on a + // single property name when negotiating ports. + // + // Firmata elects SW_SERIAL0: 0x08 as its DEFAULT + DEFAULT: 0x08, + }; + + // map to the pin resolution value in the capability query response + this.SERIAL_PIN_TYPES = { + RES_RX0: 0x00, + RES_TX0: 0x01, + RES_RX1: 0x02, + RES_TX1: 0x03, + RES_RX2: 0x04, + RES_TX2: 0x05, + RES_RX3: 0x06, + RES_TX3: 0x07, + }; + + this.RESOLUTION = { + ADC: null, + DAC: null, + PWM: null, + }; + + this.HIGH = 1; + this.LOW = 0; + this.pins = []; + this.ports = Array(16).fill(0); + this.analogPins = []; + this.version = {}; + this.firmware = {}; + this.buffer = []; + this.versionReceived = false; + this.name = "Firmata"; + this.settings = settings; + this.pending = 0; + this.digitalPortQueue = 0x0000; + + if (typeof port === "object") { + this.transport = port; + } else { + if (!Transport) { + throw new Error("Missing Default Transport"); + } + this.transport = new Transport(port, settings.serialport); + } + + this.transport.on("close", event => { + + // https://github.com/node-serialport/node-serialport/blob/5.0.0/UPGRADE_GUIDE.md#opening-and-closing + if (event && event.disconnect && event.disconnected) { + this.emit("disconnect"); + return; + } + + this.emit("close"); + }); + + this.transport.on("open", event => { + this.emit("open", event); + // Legacy + this.emit("connect", event); + }); + + this.transport.on("error", error => { + if (!this.isReady && typeof callback === "function") { + callback(error); + } else { + this.emit("error", error); + } + }); + + this.transport.on("data", data => { + for (let i = 0; i < data.length; i++) { + let byte = data[i]; + // we dont want to push 0 as the first byte on our buffer + if (this.buffer.length === 0 && byte === 0) { + continue; + } else { + this.buffer.push(byte); + + let first = this.buffer[0]; + let last = this.buffer[this.buffer.length - 1]; + + // [START_SYSEX, ... END_SYSEX] + if (first === START_SYSEX && last === END_SYSEX) { + + let handler = SYSEX_RESPONSE[this.buffer[1]]; + + // Ensure a valid SYSEX_RESPONSE handler exists + // Only process these AFTER the REPORT_VERSION + // message has been received and processed. + if (handler && this.versionReceived) { + handler(this); + } + + // It is possible for the board to have + // existing activity from a previous run + // that will leave any of the following + // active: + // + // - ANALOG_MESSAGE + // - SERIAL_READ + // - I2C_REQUEST, CONTINUOUS_READ + // + // This means that we will receive these + // messages on transport "open", before any + // handshake can occur. We MUST assert + // that we will only process this buffer + // AFTER the REPORT_VERSION message has + // been received. Not doing so will result + // in the appearance of the program "hanging". + // + // Since we cannot do anything with this data + // until _after_ REPORT_VERSION, discard it. + // + this.buffer.length = 0; + + } else if (first === START_SYSEX && (this.buffer.length > 0)) { + // we have a new command after an incomplete sysex command + let currByte = data[i]; + if (currByte > 0x7F) { + this.buffer.length = 0; + this.buffer.push(currByte); + } + } else { + /* istanbul ignore else */ + if (first !== START_SYSEX) { + // Check if data gets out of sync: first byte in buffer + // must be a valid response if not START_SYSEX + // Identify response on first byte + let response = first < START_SYSEX ? (first & START_SYSEX) : first; + + // Check if the first byte is possibly + // a valid MIDI_RESPONSE (handler) + /* istanbul ignore else */ + if (response !== REPORT_VERSION && + response !== ANALOG_MESSAGE && + response !== DIGITAL_MESSAGE) { + // If not valid, then we received garbage and can discard + // whatever bytes have been been queued. + this.buffer.length = 0; + } + } + } + + // There are 3 bytes in the buffer and the first is not START_SYSEX: + // Might have a MIDI Command + if (this.buffer.length === 3 && first !== START_SYSEX) { + // response bytes under 0xF0 we have a multi byte operation + let response = first < START_SYSEX ? (first & START_SYSEX) : first; + + /* istanbul ignore else */ + if (MIDI_RESPONSE[response]) { + // It's ok that this.versionReceived will be set to + // true every time a valid MIDI_RESPONSE is received. + // This condition is necessary to ensure that REPORT_VERSION + // is called first. + if (this.versionReceived || first === REPORT_VERSION) { + this.versionReceived = true; + MIDI_RESPONSE[response](this); + } + this.buffer.length = 0; + } else { + // A bad serial read must have happened. + // Reseting the buffer will allow recovery. + this.buffer.length = 0; + } + } + } + } + }); + + // if we have not received the version within the allotted + // time specified by the reportVersionTimeout (user or default), + // then send an explicit request for it. + this.reportVersionTimeoutId = setTimeout(() => { + /* istanbul ignore else */ + if (this.versionReceived === false) { + this.reportVersion(function() {}); + this.queryFirmware(function() {}); + } + }, settings.reportVersionTimeout); + + function ready() { + board.isReady = true; + board.emit("ready"); + /* istanbul ignore else */ + if (typeof callback === "function") { + callback(); + } + } + + // Await the reported version. + this.once("reportversion", () => { + clearTimeout(this.reportVersionTimeoutId); + this.versionReceived = true; + this.once("queryfirmware", () => { + + // Only preemptively set the sampling interval if `samplingInterval` + // property was _explicitly_ set as a constructor option. + if (options.samplingInterval !== undefined) { + this.setSamplingInterval(options.samplingInterval); + } + if (settings.skipCapabilities) { + this.analogPins = settings.analogPins || this.analogPins; + this.pins = settings.pins || this.pins; + /* istanbul ignore else */ + if (!this.pins.length) { + for (var i = 0; i < (settings.pinCount || MAX_PIN_COUNT); i++) { + var supportedModes = []; + var analogChannel = this.analogPins.indexOf(i); + + if (analogChannel < 0) { + analogChannel = 127; + } + this.pins.push({supportedModes, analogChannel}); + } + } + + // If the capabilities query is skipped, + // default resolution values will be used. + // + // Based on ATmega328/P + // + this.RESOLUTION.ADC = 0x3FF; + this.RESOLUTION.PWM = 0x0FF; + + ready(); + } else { + this.queryCapabilities(() => { + this.queryAnalogMapping(ready); + }); + } + }); + }); + } + + /** + * Asks the arduino to tell us its version. + * @param {function} callback A function to be called when the arduino has reported its version. + */ + + reportVersion(callback) { + this.once("reportversion", callback); + writeToTransport(this, [REPORT_VERSION]); + } + + /** + * Asks the arduino to tell us its firmware version. + * @param {function} callback A function to be called when the arduino has reported its firmware version. + */ + + queryFirmware(callback) { + this.once("queryfirmware", callback); + writeToTransport(this, [ + START_SYSEX, + QUERY_FIRMWARE, + END_SYSEX + ]); + } + + + + /** + * Asks the arduino to read analog data. Turn on reporting for this pin. + * @param {number} pin The pin to read analog data + * @param {function} callback A function to call when we have the analag data. + */ + + analogRead(pin, callback) { + this.reportAnalogPin(pin, 1); + this.addListener(`analog-read-${pin}`, callback); + } + + /** + * Write a PWM value Asks the arduino to write an analog message. + * @param {number} pin The pin to write analog data to. + * @param {number} value The data to write to the pin between 0 and this.RESOLUTION.PWM. + */ + + pwmWrite(pin, value) { + let data; + + this.pins[pin].value = value; + + if (pin > 15) { + data = [ + START_SYSEX, + EXTENDED_ANALOG, + pin, + value & 0x7F, + (value >> 7) & 0x7F, + ]; + + if (value > 0x00004000) { + data[data.length] = (value >> 14) & 0x7F; + } + + if (value > 0x00200000) { + data[data.length] = (value >> 21) & 0x7F; + } + + if (value > 0x10000000) { + data[data.length] = (value >> 28) & 0x7F; + } + + data[data.length] = END_SYSEX; + } else { + data = [ + ANALOG_MESSAGE | pin, + value & 0x7F, + (value >> 7) & 0x7F + ]; + } + + writeToTransport(this, data); + } + + /** + * Set a pin to SERVO mode with an explicit PWM range. + * + * @param {number} pin The pin the servo is connected to + * @param {number} min A 14-bit signed int. + * @param {number} max A 14-bit signed int. + */ + + servoConfig(pin, min, max) { + if (typeof pin === "object" && pin !== null) { + let temp = pin; + pin = temp.pin; + min = temp.min; + max = temp.max; + } + + if (typeof pin === "undefined") { + throw new Error("servoConfig: pin must be specified"); + } + + if (typeof min === "undefined") { + throw new Error("servoConfig: min must be specified"); + } + + if (typeof max === "undefined") { + throw new Error("servoConfig: max must be specified"); + } + + // [0] START_SYSEX (0xF0) + // [1] SERVO_CONFIG (0x70) + // [2] pin number (0-127) + // [3] minPulse LSB (0-6) + // [4] minPulse MSB (7-13) + // [5] maxPulse LSB (0-6) + // [6] maxPulse MSB (7-13) + // [7] END_SYSEX (0xF7) + + this.pins[pin].mode = this.MODES.SERVO; + + writeToTransport(this, [ + START_SYSEX, + SERVO_CONFIG, + pin, + min & 0x7F, + (min >> 7) & 0x7F, + max & 0x7F, + (max >> 7) & 0x7F, + END_SYSEX, + ]); + } + + /** + * Asks the arduino to move a servo + * @param {number} pin The pin the servo is connected to + * @param {number} value The degrees to move the servo to. + */ + + servoWrite(...args) { + // Values less than 544 will be treated as angles in degrees + // (valid values in microseconds are handled as microseconds) + this.analogWrite(...args); + } + + /** + * Asks the arduino to set the pin to a certain mode. + * @param {number} pin The pin you want to change the mode of. + * @param {number} mode The mode you want to set. Must be one of board.MODES + */ + + pinMode(pin, mode) { + this.pins[pin].mode = mode; + writeToTransport(this, [ + PIN_MODE, + pin, + mode + ]); + } + + /** + * Asks the arduino to write a value to a digital pin + * @param {number} pin The pin you want to write a value to. + * @param {number} value The value you want to write. Must be board.HIGH or board.LOW + * @param {boolean} enqueue When true, the local state is updated but the command is not sent to the Arduino + */ + + digitalWrite(pin, value, enqueue) { + let port = this.updateDigitalPort(pin, value); + + if (enqueue) { + this.digitalPortQueue |= 1 << port; + } else { + this.writeDigitalPort(port); + } + } + + /** + * Update local store of digital port state + * @param {number} pin The pin you want to write a value to. + * @param {number} value The value you want to write. Must be board.HIGH or board.LOW + */ + + updateDigitalPort(pin, value) { + const port = pin >> 3; + const bit = 1 << (pin & 0x07); + + this.pins[pin].value = value; + + if (value) { + this.ports[port] |= bit; + } else { + this.ports[port] &= ~bit; + } + + return port; + } + + /** + * Write queued digital ports + */ + + flushDigitalPorts() { + for (let i = 0; i < this.ports.length; i++) { + if (this.digitalPortQueue >> i) { + this.writeDigitalPort(i); + } + } + this.digitalPortQueue = 0x0000; + } + + /** + * Update a digital port (group of 8 digital pins) on the Arduino + * @param {number} port The port you want to update. + */ + + writeDigitalPort(port) { + writeToTransport(this, [ + DIGITAL_MESSAGE | port, + this.ports[port] & 0x7F, + (this.ports[port] >> 7) & 0x7F + ]); + } + + /** + * Asks the arduino to read digital data. Turn on reporting for this pin's port. + * + * @param {number} pin The pin to read data from + * @param {function} callback The function to call when data has been received + */ + + digitalRead(pin, callback) { + this.reportDigitalPin(pin, 1); + this.addListener(`digital-read-${pin}`, callback); + } + + /** + * Asks the arduino to tell us its capabilities + * @param {function} callback A function to call when we receive the capabilities + */ + + queryCapabilities(callback) { + this.once("capability-query", callback); + writeToTransport(this, [ + START_SYSEX, + CAPABILITY_QUERY, + END_SYSEX + ]); + } + + /** + * Asks the arduino to tell us its analog pin mapping + * @param {function} callback A function to call when we receive the pin mappings. + */ + + queryAnalogMapping(callback) { + this.once("analog-mapping-query", callback); + writeToTransport(this, [ + START_SYSEX, + ANALOG_MAPPING_QUERY, + END_SYSEX + ]); + } + + /** + * Asks the arduino to tell us the current state of a pin + * @param {number} pin The pin we want to the know the state of + * @param {function} callback A function to call when we receive the pin state. + */ + + queryPinState(pin, callback) { + this.once(`pin-state-${pin}`, callback); + writeToTransport(this, [ + START_SYSEX, + PIN_STATE_QUERY, + pin, + END_SYSEX + ]); + } + + /** + * Sends a string to the arduino + * @param {String} string to send to the device + */ + + sendString(string) { + const bytes = Buffer.from(`${string}\0`, "utf8"); + const data = []; + + data.push(START_SYSEX, STRING_DATA); + for (let i = 0, length = bytes.length; i < length; i++) { + data.push( + bytes[i] & 0x7F, + (bytes[i] >> 7) & 0x7F + ); + } + data.push(END_SYSEX); + + writeToTransport(this, data); + } + + /** + * Sends a I2C config request to the arduino board with an optional + * value in microseconds to delay an I2C Read. Must be called before + * an I2C Read or Write + * @param {number} delay in microseconds to set for I2C Read + */ + + sendI2CConfig(delay) { + return this.i2cConfig(delay); + } + + /** + * Enable I2C with an optional read delay. Must be called before + * an I2C Read or Write + * + * Supersedes sendI2CConfig + * + * @param {number} delay in microseconds to set for I2C Read + * + * or + * + * @param {object} with a single property `delay` + */ + + i2cConfig(options) { + let settings = i2cActive.get(this); + let delay; + + if (!settings) { + settings = { + /* + Keys will be I2C peripheral addresses + */ + }; + i2cActive.set(this, settings); + } + + if (typeof options === "number") { + delay = options; + } else { + if (typeof options === "object" && options !== null) { + delay = Number(options.delay); + + // When an address was explicitly specified, there may also be + // peripheral specific instructions in the config. + if (typeof options.address !== "undefined") { + if (!settings[options.address]) { + settings[options.address] = { + stopTX: true, + }; + } + } + + // When settings have been explicitly provided, just bulk assign + // them to the existing settings, even if that's empty. This + // allows for reconfiguration as needed. + if (typeof options.settings !== "undefined") { + Object.assign(settings[options.address], options.settings); + /* + - stopTX: true | false + Set `stopTX` to `false` if this peripheral + expects Wire to keep the transmission connection alive between + setting a register and requesting bytes. + + Defaults to `true`. + */ + } + } + } + + settings.delay = delay = delay || 0; + + i2cRequest(this, [ + START_SYSEX, + I2C_CONFIG, + delay & 0xFF, + (delay >> 8) & 0xFF, + END_SYSEX, + ]); + + return this; + } + + /** + * Asks the arduino to send an I2C request to a device + * @param {number} slaveAddress The address of the I2C device + * @param {Array} bytes The bytes to send to the device + */ + + sendI2CWriteRequest(slaveAddress, bytes) { + const data = []; + /* istanbul ignore next */ + bytes = bytes || []; + + data.push( + START_SYSEX, + I2C_REQUEST, + slaveAddress, + this.I2C_MODES.WRITE << 3 + ); + + for (let i = 0, length = bytes.length; i < length; i++) { + data.push( + bytes[i] & 0x7F, + (bytes[i] >> 7) & 0x7F + ); + } + + data.push(END_SYSEX); + + i2cRequest(this, data); + } + + /** + * Write data to a register + * + * @param {number} address The address of the I2C device. + * @param {Array} cmdRegOrData An array of bytes + * + * Write a command to a register + * + * @param {number} address The address of the I2C device. + * @param {number} cmdRegOrData The register + * @param {Array} inBytes An array of bytes + * + */ + + i2cWrite(address, registerOrData, inBytes) { + /** + * registerOrData: + * [... arbitrary bytes] + * + * or + * + * registerOrData, inBytes: + * command [, ...] + * + */ + const data = [ + START_SYSEX, + I2C_REQUEST, + address, + this.I2C_MODES.WRITE << 3 + ]; + + // If i2cWrite was used for an i2cWriteReg call... + if (arguments.length === 3 && + !Array.isArray(registerOrData) && + !Array.isArray(inBytes)) { + + return this.i2cWriteReg(address, registerOrData, inBytes); + } + + // Fix arguments if called with Firmata.js API + if (arguments.length === 2) { + if (Array.isArray(registerOrData)) { + inBytes = registerOrData.slice(); + registerOrData = inBytes.shift(); + } else { + inBytes = []; + } + } + + const bytes = Buffer.from([registerOrData].concat(inBytes)); + + for (var i = 0, length = bytes.length; i < length; i++) { + data.push( + bytes[i] & 0x7F, + (bytes[i] >> 7) & 0x7F + ); + } + + data.push(END_SYSEX); + + i2cRequest(this, data); + + return this; + } + + /** + * Write data to a register + * + * @param {number} address The address of the I2C device. + * @param {number} register The register. + * @param {number} byte The byte value to write. + * + */ + + i2cWriteReg(address, register, byte) { + i2cRequest(this, [ + START_SYSEX, + I2C_REQUEST, + address, + this.I2C_MODES.WRITE << 3, + // register + register & 0x7F, + (register >> 7) & 0x7F, + // byte + byte & 0x7F, + (byte >> 7) & 0x7F, + END_SYSEX, + ]); + + return this; + } + + /** + * Asks the arduino to request bytes from an I2C device + * @param {number} slaveAddress The address of the I2C device + * @param {number} numBytes The number of bytes to receive. + * @param {function} callback A function to call when we have received the bytes. + */ + + sendI2CReadRequest(address, numBytes, callback) { + i2cRequest(this, [ + START_SYSEX, + I2C_REQUEST, + address, + this.I2C_MODES.READ << 3, + numBytes & 0x7F, + (numBytes >> 7) & 0x7F, + END_SYSEX, + ]); + this.once(`I2C-reply-${address}-0`, callback); + } + + // TODO: Refactor i2cRead and i2cReadOnce + // to share most operations. + + /** + * Initialize a continuous I2C read. + * + * @param {number} address The address of the I2C device + * @param {number} register Optionally set the register to read from. + * @param {number} numBytes The number of bytes to receive. + * @param {function} callback A function to call when we have received the bytes. + */ + + i2cRead(address, register, bytesToRead, callback) { + + if (arguments.length === 3 && + typeof register === "number" && + typeof bytesToRead === "function") { + callback = bytesToRead; + bytesToRead = register; + register = null; + } + + const data = [ + START_SYSEX, + I2C_REQUEST, + address, + this.I2C_MODES.CONTINUOUS_READ << 3, + ]; + let event = `I2C-reply-${address}-`; + + if (register !== null) { + data.push( + register & 0x7F, + (register >> 7) & 0x7F + ); + } else { + register = 0; + } + + event += register; + + data.push( + bytesToRead & 0x7F, + (bytesToRead >> 7) & 0x7F, + END_SYSEX + ); + + this.on(event, callback); + + i2cRequest(this, data); + + return this; + } + + /** + * Stop continuous reading of the specified I2C address or register. + * + * @param {object} options Options: + * bus {number} The I2C bus (on supported platforms) + * address {number} The I2C peripheral address to stop reading. + * + * @param {number} address The I2C peripheral address to stop reading. + */ + + i2cStop(options) { + // There may be more values in the future + // var options = {}; + + // null or undefined? Do nothing. + if (options == null) { + return; + } + + if (typeof options === "number") { + options = { + address: options + }; + } + + writeToTransport(this, [ + START_SYSEX, + I2C_REQUEST, + options.address, + this.I2C_MODES.STOP_READING << 3, + END_SYSEX, + ]); + + Object.keys(this._events).forEach(event => { + if (event.startsWith(`I2C-reply-${options.address}`)) { + this.removeAllListeners(event); + } + }); + } + + /** + * Perform a single I2C read + * + * Supersedes sendI2CReadRequest + * + * Read bytes from address + * + * @param {number} address The address of the I2C device + * @param {number} register Optionally set the register to read from. + * @param {number} numBytes The number of bytes to receive. + * @param {function} callback A function to call when we have received the bytes. + * + */ + + + i2cReadOnce(address, register, bytesToRead, callback) { + + if (arguments.length === 3 && + typeof register === "number" && + typeof bytesToRead === "function") { + callback = bytesToRead; + bytesToRead = register; + register = null; + } + + const data = [ + START_SYSEX, + I2C_REQUEST, + address, + this.I2C_MODES.READ << 3, + ]; + let event = `I2C-reply-${address}-`; + + if (register !== null) { + data.push( + register & 0x7F, + (register >> 7) & 0x7F + ); + } else { + register = 0; + } + + event += register; + + data.push( + bytesToRead & 0x7F, + (bytesToRead >> 7) & 0x7F, + END_SYSEX + ); + + this.once(event, callback); + + i2cRequest(this, data); + + return this; + } + + /** + * Configure the passed pin as the controller in a 1-wire bus. + * Pass as enableParasiticPower true if you want the data pin to power the bus. + * @param pin + * @param enableParasiticPower + */ + + sendOneWireConfig(pin, enableParasiticPower) { + writeToTransport(this, [ + START_SYSEX, + ONEWIRE_DATA, + ONEWIRE_CONFIG_REQUEST, + pin, + enableParasiticPower ? 0x01 : 0x00, + END_SYSEX, + ]); + } + + /** + * Searches for 1-wire devices on the bus. The passed callback should accept + * and error argument and an array of device identifiers. + * @param pin + * @param callback + */ + + sendOneWireSearch(pin, callback) { + this[SYM_sendOneWireSearch]( + ONEWIRE_SEARCH_REQUEST, + `1-wire-search-reply-${pin}`, + pin, + callback + ); + } + + /** + * Searches for 1-wire devices on the bus in an alarmed state. The passed callback + * should accept and error argument and an array of device identifiers. + * @param pin + * @param callback + */ + + sendOneWireAlarmsSearch(pin, callback) { + this[SYM_sendOneWireSearch]( + ONEWIRE_SEARCH_ALARMS_REQUEST, + `1-wire-search-alarms-reply-${pin}`, + pin, + callback + ); + } + + [SYM_sendOneWireSearch](type, event, pin, callback) { + writeToTransport(this, [ + START_SYSEX, + ONEWIRE_DATA, + type, + pin, + END_SYSEX + ]); + + const timeout = setTimeout(() => { + /* istanbul ignore next */ + callback(new Error("1-Wire device search timeout - are you running ConfigurableFirmata?")); + }, 5000); + this.once(event, devices => { + clearTimeout(timeout); + callback(null, devices); + }); + } + + /** + * Reads data from a device on the bus and invokes the passed callback. + * + * N.b. ConfigurableFirmata will issue the 1-wire select command internally. + * @param pin + * @param device + * @param numBytesToRead + * @param callback + */ + + sendOneWireRead(pin, device, numBytesToRead, callback) { + const correlationId = Math.floor(Math.random() * 255); + /* istanbul ignore next */ + const timeout = setTimeout(() => { + /* istanbul ignore next */ + callback(new Error("1-Wire device read timeout - are you running ConfigurableFirmata?")); + }, 5000); + this[SYM_sendOneWireRequest]( + pin, + ONEWIRE_READ_REQUEST_BIT, + device, + numBytesToRead, + correlationId, + null, + null, + `1-wire-read-reply-${correlationId}`, + data => { + clearTimeout(timeout); + callback(null, data); + } + ); + } + + /** + * Resets all devices on the bus. + * @param pin + */ + + sendOneWireReset(pin) { + this[SYM_sendOneWireRequest]( + pin, + ONEWIRE_RESET_REQUEST_BIT + ); + } + + /** + * Writes data to the bus to be received by the passed device. The device + * should be obtained from a previous call to sendOneWireSearch. + * + * N.b. ConfigurableFirmata will issue the 1-wire select command internally. + * @param pin + * @param device + * @param data + */ + + sendOneWireWrite(pin, device, data) { + this[SYM_sendOneWireRequest]( + pin, + ONEWIRE_WRITE_REQUEST_BIT, + device, + null, + null, + null, + Array.isArray(data) ? data : [data] + ); + } + + /** + * Tells firmata to not do anything for the passed amount of ms. For when you + * need to give a device attached to the bus time to do a calculation. + * @param pin + */ + + sendOneWireDelay(pin, delay) { + this[SYM_sendOneWireRequest]( + pin, + ONEWIRE_DELAY_REQUEST_BIT, + null, + null, + null, + delay + ); + } + + /** + * Sends the passed data to the passed device on the bus, reads the specified + * number of bytes and invokes the passed callback. + * + * N.b. ConfigurableFirmata will issue the 1-wire select command internally. + * @param pin + * @param device + * @param data + * @param numBytesToRead + * @param callback + */ + + sendOneWireWriteAndRead(pin, device, data, numBytesToRead, callback) { + const correlationId = Math.floor(Math.random() * 255); + /* istanbul ignore next */ + const timeout = setTimeout(() => { + /* istanbul ignore next */ + callback(new Error("1-Wire device read timeout - are you running ConfigurableFirmata?")); + }, 5000); + this[SYM_sendOneWireRequest]( + pin, + ONEWIRE_WRITE_REQUEST_BIT | ONEWIRE_READ_REQUEST_BIT, + device, + numBytesToRead, + correlationId, + null, + Array.isArray(data) ? data : [data], + `1-wire-read-reply-${correlationId}`, + data => { + clearTimeout(timeout); + callback(null, data); + } + ); + } + + // see http://firmata.org/wiki/Proposals#OneWire_Proposal + [SYM_sendOneWireRequest](pin, subcommand, device, numBytesToRead, correlationId, delay, dataToWrite, event, callback) { + const bytes = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + + if (device || numBytesToRead || correlationId || delay || dataToWrite) { + subcommand = subcommand | ONEWIRE_WITHDATA_REQUEST_BITS; + } + + if (device) { + bytes.splice(...[0, 8].concat(device)); + } + + if (numBytesToRead) { + bytes[8] = numBytesToRead & 0xFF; + bytes[9] = (numBytesToRead >> 8) & 0xFF; + } + + if (correlationId) { + bytes[10] = correlationId & 0xFF; + bytes[11] = (correlationId >> 8) & 0xFF; + } + + if (delay) { + bytes[12] = delay & 0xFF; + bytes[13] = (delay >> 8) & 0xFF; + bytes[14] = (delay >> 16) & 0xFF; + bytes[15] = (delay >> 24) & 0xFF; + } + + if (dataToWrite) { + bytes.push(...dataToWrite); + } + + const output = [ + START_SYSEX, + ONEWIRE_DATA, + subcommand, + pin, + ...Encoder7Bit.to7BitArray(bytes), + END_SYSEX, + ]; + + writeToTransport(this, output); + + if (event && callback) { + this.once(event, callback); + } + } + + /** + * Set sampling interval in millis. Default is 19 ms + * @param {number} interval The sampling interval in ms > 10 + */ + + setSamplingInterval(interval) { + const safeint = interval < 10 ? 10 : (interval > 65535 ? 65535 : interval); + this.settings.samplingInterval = safeint; + writeToTransport(this, [ + START_SYSEX, + SAMPLING_INTERVAL, + (safeint & 0x7F), + ((safeint >> 7) & 0x7F), + END_SYSEX, + ]); + } + + /** + * Get sampling interval in millis. Default is 19 ms + * + * @return {number} samplingInterval + */ + + getSamplingInterval() { + return this.settings.samplingInterval; + } + + /** + * Set reporting on pin + * @param {number} pin The pin to turn on/off reporting + * @param {number} value Binary value to turn reporting on/off + */ + + reportAnalogPin(pin, value) { + /* istanbul ignore else */ + if (value === 0 || value === 1) { + this.pins[this.analogPins[pin]].report = value; + writeToTransport(this, [ + REPORT_ANALOG | pin, + value + ]); + } + } + + /** + * Set reporting on pin + * @param {number} pin The pin to turn on/off reporting + * @param {number} value Binary value to turn reporting on/off + */ + + reportDigitalPin(pin, value) { + const port = pin >> 3; + /* istanbul ignore else */ + if (value === 0 || value === 1) { + this.pins[pin].report = value; + writeToTransport(this, [ + REPORT_DIGITAL | port, + value + ]); + } + } + + /** + * + * + */ + + pingRead(options, callback) { + + if (!this.pins[options.pin].supportedModes.includes(PING_READ)) { + throw new Error("Please upload PingFirmata to the board"); + } + + const { + pin, + value, + pulseOut = 0, + timeout = 1000000 + } = options; + + writeToTransport(this, [ + START_SYSEX, + PING_READ, + pin, + value, + ...Firmata.encode([ + (pulseOut >> 24) & 0xFF, + (pulseOut >> 16) & 0xFF, + (pulseOut >> 8) & 0xFF, + (pulseOut & 0xFF), + ]), + ...Firmata.encode([ + (timeout >> 24) & 0xFF, + (timeout >> 16) & 0xFF, + (timeout >> 8) & 0xFF, + (timeout & 0xFF), + ]), + END_SYSEX, + ]); + + this.once(`ping-read-${pin}`, callback); + } + + /** + * Stepper functions to support version 2 of ConfigurableFirmata's asynchronous control of stepper motors + * https://github.com/soundanalogous/ConfigurableFirmata + */ + + /** + * Asks the arduino to configure a stepper motor with the given config to allow asynchronous control of the stepper + * @param {object} opts Options: + * {number} deviceNum: Device number for the stepper (range 0-9) + * {number} type: One of this.STEPPER.TYPE.* + * {number} stepSize: One of this.STEPPER.STEP_SIZE.* + * {number} stepPin: Only used if STEPPER.TYPE.DRIVER + * {number} directionPin: Only used if STEPPER.TYPE.DRIVER + * {number} motorPin1: motor pin 1 + * {number} motorPin2: motor pin 2 + * {number} [motorPin3]: Only required if type == this.STEPPER.TYPE.THREE_WIRE || this.STEPPER.TYPE.FOUR_WIRE + * {number} [motorPin4]: Only required if type == this.STEPPER.TYPE.FOUR_WIRE + * {number} [enablePin]: Enable pin + * {array} [invertPins]: Array of pins to invert + */ + + accelStepperConfig(options) { + + let { + deviceNum, + invertPins, + motorPin1, + motorPin2, + motorPin3, + motorPin4, + enablePin, + stepSize = this.STEPPER.STEP_SIZE.WHOLE, + type = this.STEPPER.TYPE.FOUR_WIRE, + } = options; + + const data = [ + START_SYSEX, + ACCELSTEPPER, + 0x00, // STEPPER_CONFIG from firmware + deviceNum + ]; + + let iface = ((type & 0x07) << 4) | ((stepSize & 0x07) << 1); + let pinsToInvert = 0x00; + + if (typeof enablePin !== "undefined") { + iface = iface | 0x01; + } + + data.push(iface); + + [ + "stepPin", + "motorPin1", + "directionPin", + "motorPin2", + "motorPin3", + "motorPin4", + "enablePin" + ].forEach(pin => { + if (typeof options[pin] !== "undefined") { + data.push(options[pin]); + } + }); + + if (Array.isArray(invertPins)) { + if (invertPins.includes(motorPin1)) { + pinsToInvert |= 0x01; + } + if (invertPins.includes(motorPin2)) { + pinsToInvert |= 0x02; + } + if (invertPins.includes(motorPin3)) { + pinsToInvert |= 0x04; + } + if (invertPins.includes(motorPin4)) { + pinsToInvert |= 0x08; + } + if (invertPins.includes(enablePin)) { + pinsToInvert |= 0x10; + } + } + + data.push( + pinsToInvert, + END_SYSEX + ); + + writeToTransport(this, data); + } + + /** + * Asks the arduino to set the stepper position to 0 + * Note: This is not a move. We are setting the current position equal to zero + * @param {number} deviceNum Device number for the stepper (range 0-9) + */ + + accelStepperZero(deviceNum) { + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x01, // STEPPER_ZERO from firmware + deviceNum, + END_SYSEX, + ]); + } + + /** + * Asks the arduino to move a stepper a number of steps + * (and optionally with and acceleration and deceleration) + * speed is in units of steps/sec + * @param {number} deviceNum Device number for the stepper (range 0-5) + * @param {number} steps Number of steps to make + */ + accelStepperStep(deviceNum, steps, callback) { + + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x02, // STEPPER_STEP from firmware + deviceNum, + ...encode32BitSignedInteger(steps), + END_SYSEX, + ]); + + if (callback) { + this.once(`stepper-done-${deviceNum}`, callback); + } + } + + /** + * Asks the arduino to move a stepper to a specific location + * @param {number} deviceNum Device number for the stepper (range 0-5) + * @param {number} position Desired position + */ + accelStepperTo(deviceNum, position, callback) { + + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x03, // STEPPER_TO from firmware + deviceNum, + ...encode32BitSignedInteger(position), + END_SYSEX, + ]); + + if (callback) { + this.once(`stepper-done-${deviceNum}`, callback); + } + } + + /** + * Asks the arduino to enable/disable a stepper + * @param {number} deviceNum Device number for the stepper (range 0-9) + * @param {boolean} [enabled] + */ + + accelStepperEnable(deviceNum, enabled = true) { + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x04, // ENABLE from firmware + deviceNum, + enabled & 0x01, + END_SYSEX, + ]); + } + + /** + * Asks the arduino to stop a stepper + * @param {number} deviceNum Device number for the stepper (range 0-9) + */ + + accelStepperStop(deviceNum) { + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x05, // STEPPER_STOP from firmware + deviceNum, + END_SYSEX, + ]); + } + + /** + * Asks the arduino to report the position of a stepper + * @param {number} deviceNum Device number for the stepper (range 0-9) + */ + + accelStepperReportPosition(deviceNum, callback) { + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x06, // STEPPER_REPORT_POSITION from firmware + deviceNum, + END_SYSEX, + ]); + + /* istanbul ignore else */ + if (callback) { + this.once(`stepper-position-${deviceNum}`, callback); + } + } + + /** + * Asks the arduino to set the acceleration for a stepper + * @param {number} deviceNum Device number for the stepper (range 0-9) + * @param {number} acceleration Desired acceleration in steps per sec^2 + */ + + accelStepperAcceleration(deviceNum, acceleration) { + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x08, // STEPPER_SET_ACCELERATION from firmware + deviceNum, + ...encodeCustomFloat(acceleration), + END_SYSEX, + ]); + } + + /** + * Asks the arduino to set the max speed for a stepper + * @param {number} deviceNum Device number for the stepper (range 0-9) + * @param {number} speed Desired speed or maxSpeed in steps per second + * @param {function} [callback] + */ + + accelStepperSpeed(deviceNum, speed) { + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x09, // STEPPER_SET_SPEED from firmware + deviceNum, + ...encodeCustomFloat(speed), + END_SYSEX, + ]); + } + + /** + * Asks the arduino to configure a multiStepper group + * @param {object} options Options: + * {number} groupNum: Group number for the multiSteppers (range 0-5) + * {number} devices: array of accelStepper device numbers in group + **/ + + multiStepperConfig(options) { + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x20, // MULTISTEPPER_CONFIG from firmware + options.groupNum, + ...options.devices, + END_SYSEX, + ]); + } + + /** + * Asks the arduino to move a multiStepper group + * @param {number} groupNum Group number for the multiSteppers (range 0-5) + * @param {number} positions array of absolute stepper positions + **/ + + multiStepperTo(groupNum, positions, callback) { + if (groupNum < 0 || groupNum > 5) { + throw new RangeError(`Invalid "groupNum": ${groupNum}. Expected "groupNum" between 0-5`); + } + + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x21, // MULTISTEPPER_TO from firmware + groupNum, + ...positions.reduce((a, b) => a.concat(...encode32BitSignedInteger(b)), []), + END_SYSEX, + ]); + + /* istanbul ignore else */ + if (callback) { + this.once(`multi-stepper-done-${groupNum}`, callback); + } + } + + /** + * Asks the arduino to stop a multiStepper group + * @param {number} groupNum: Group number for the multiSteppers (range 0-5) + **/ + + multiStepperStop(groupNum) { + /* istanbul ignore else */ + if (groupNum < 0 || groupNum > 5) { + throw new RangeError(`Invalid "groupNum": ${groupNum}. Expected "groupNum" between 0-5`); + } + writeToTransport(this, [ + START_SYSEX, + ACCELSTEPPER, + 0x23, // MULTISTEPPER_STOP from firmware + groupNum, + END_SYSEX, + ]); + } + + /** + * Stepper functions to support AdvancedFirmata's asynchronous control of stepper motors + * https://github.com/soundanalogous/AdvancedFirmata + */ + + /** + * Asks the arduino to configure a stepper motor with the given config to allow asynchronous control of the stepper + * @param {number} deviceNum Device number for the stepper (range 0-5, expects steppers to be setup in order from 0 to 5) + * @param {number} type One of this.STEPPER.TYPE.* + * @param {number} stepsPerRev Number of steps motor takes to make one revolution + * @param {number} stepOrMotor1Pin If using EasyDriver type stepper driver, this is direction pin, otherwise it is motor 1 pin + * @param {number} dirOrMotor2Pin If using EasyDriver type stepper driver, this is step pin, otherwise it is motor 2 pin + * @param {number} [motorPin3] Only required if type == this.STEPPER.TYPE.FOUR_WIRE + * @param {number} [motorPin4] Only required if type == this.STEPPER.TYPE.FOUR_WIRE + */ + + stepperConfig(deviceNum, type, stepsPerRev, dirOrMotor1Pin, dirOrMotor2Pin, motorPin3, motorPin4) { + writeToTransport(this, [ + START_SYSEX, + STEPPER, + 0x00, // STEPPER_CONFIG from firmware + deviceNum, + type, + stepsPerRev & 0x7F, + (stepsPerRev >> 7) & 0x7F, + dirOrMotor1Pin, + dirOrMotor2Pin, + ...(type === this.STEPPER.TYPE.FOUR_WIRE ? [motorPin3, motorPin4] : []), + END_SYSEX + ]); + } + + /** + * Asks the arduino to move a stepper a number of steps at a specific speed + * (and optionally with and acceleration and deceleration) + * speed is in units of .01 rad/sec + * accel and decel are in units of .01 rad/sec^2 + * TODO: verify the units of speed, accel, and decel + * @param {number} deviceNum Device number for the stepper (range 0-5) + * @param {number} direction One of this.STEPPER.DIRECTION.* + * @param {number} steps Number of steps to make + * @param {number} speed + * @param {number|function} accel Acceleration or if accel and decel are not used, then it can be the callback + * @param {number} [decel] + * @param {function} [callback] + */ + + stepperStep(deviceNum, direction, steps, speed, accel, decel, callback) { + if (typeof accel === "function") { + callback = accel; + accel = 0; + decel = 0; + } + + writeToTransport(this, [ + START_SYSEX, + STEPPER, + 0x01, // STEPPER_STEP from firmware + deviceNum, + direction, // one of this.STEPPER.DIRECTION.* + steps & 0x7F, (steps >> 7) & 0x7F, (steps >> 14) & 0x7F, + speed & 0x7F, (speed >> 7) & 0x7F, + + ...(accel > 0 || decel > 0 ? + [accel & 0x7F, (accel >> 7) & 0x7F, decel & 0x7F, (decel >> 7) & 0x7F] : []), + + END_SYSEX, + ]); + + /* istanbul ignore else */ + if (callback) { + this.once(`stepper-done-${deviceNum}`, callback); + } + } + + /** + * Asks the Arduino to configure a hardware or serial port. + * @param {object} options Options: + * portId {number} The serial port to use (HW_SERIAL1, HW_SERIAL2, HW_SERIAL3, SW_SERIAL0, + * SW_SERIAL1, SW_SERIAL2, SW_SERIAL3) + * baud {number} The baud rate of the serial port + * rxPin {number} [SW Serial only] The RX pin of the SoftwareSerial instance + * txPin {number} [SW Serial only] The TX pin of the SoftwareSerial instance + */ + + serialConfig(options) { + + let portId; + let baud; + let rxPin; + let txPin; + + /* istanbul ignore else */ + if (typeof options === "object" && options !== null) { + portId = options.portId; + baud = options.baud; + rxPin = options.rxPin; + txPin = options.txPin; + } + + /* istanbul ignore else */ + if (typeof portId === "undefined") { + throw new Error("portId must be specified, see SERIAL_PORT_IDs for options."); + } + + baud = baud || 57600; + + const data = [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_CONFIG | portId, + baud & 0x7F, + (baud >> 7) & 0x7F, + (baud >> 14) & 0x7F + ]; + if (portId > 7 && typeof rxPin !== "undefined" && typeof txPin !== "undefined") { + data.push( + rxPin, + txPin + ); + } else if (portId > 7) { + throw new Error("Both RX and TX pins must be defined when using Software Serial."); + } + + data.push(END_SYSEX); + writeToTransport(this, data); + } + + /** + * Write an array of bytes to the specified serial port. + * @param {number} portId The serial port to write to. + * @param {Array} inBytes An array of bytes to write to the serial port. + */ + + serialWrite(portId, bytes) { + const data = [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_WRITE | portId, + ]; + for (let i = 0, len = bytes.length; i < len; i++) { + data.push( + bytes[i] & 0x7F, + (bytes[i] >> 7) & 0x7F + ); + } + data.push(END_SYSEX); + /* istanbul ignore else */ + if (bytes.length > 0) { + writeToTransport(this, data); + } + } + + /** + * Start continuous reading of the specified serial port. The port is checked for data each + * iteration of the main Arduino loop. + * @param {number} portId The serial port to start reading continuously. + * @param {number} maxBytesToRead [Optional] The maximum number of bytes to read per iteration. + * If there are less bytes in the buffer, the lesser number of bytes will be returned. A value of 0 + * indicates that all available bytes in the buffer should be read. + * @param {function} callback A function to call when we have received the bytes. + */ + + serialRead(portId, maxBytesToRead, callback) { + const data = [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_READ | portId, + this.SERIAL_MODES.CONTINUOUS_READ + ]; + + if (arguments.length === 2 && typeof maxBytesToRead === "function") { + callback = maxBytesToRead; + } else { + data.push( + maxBytesToRead & 0x7F, + (maxBytesToRead >> 7) & 0x7F + ); + } + + data.push(END_SYSEX); + writeToTransport(this, data); + + this.on(`serial-data-${portId}`, callback); + } + + /** + * Stop continuous reading of the specified serial port. This does not close the port, it stops + * reading it but keeps the port open. + * @param {number} portId The serial port to stop reading. + */ + + serialStop(portId) { + writeToTransport(this, [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_READ | portId, + this.SERIAL_MODES.STOP_READING, + END_SYSEX, + ]); + + this.removeAllListeners(`serial-data-${portId}`); + } + + /** + * Close the specified serial port. + * @param {number} portId The serial port to close. + */ + + serialClose(portId) { + writeToTransport(this, [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_CLOSE | portId, + END_SYSEX, + ]); + } + + /** + * Flush the specified serial port. For hardware serial, this waits for the transmission of + * outgoing serial data to complete. For software serial, this removed any buffered incoming serial + * data. + * @param {number} portId The serial port to flush. + */ + + serialFlush(portId) { + writeToTransport(this, [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_FLUSH | portId, + END_SYSEX, + ]); + } + + /** + * For SoftwareSerial only. Only a single SoftwareSerial instance can read data at a time. + * Call this method to set this port to be the reading port in the case there are multiple + * SoftwareSerial instances. + * @param {number} portId The serial port to listen on. + */ + + serialListen(portId) { + // listen only applies to software serial ports + if (portId < 8) { + return; + } + writeToTransport(this, [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_LISTEN | portId, + END_SYSEX, + ]); + } + + /** + * Allow user code to handle arbitrary sysex responses + * + * @param {number} commandByte The commandByte must be associated with some message + * that's expected from the slave device. The handler is + * called with an array of _raw_ data from the slave. Data + * decoding must be done within the handler itself. + * + * Use Firmata.decode(data) to extract useful values from + * the incoming response data. + * + * @param {function} handler Function which handles receipt of responses matching + * commandByte. + */ + + sysexResponse(commandByte, handler) { + if (Firmata.SYSEX_RESPONSE[commandByte]) { + throw new Error(`${commandByte} is not an available SYSEX_RESPONSE byte`); + } + + Firmata.SYSEX_RESPONSE[commandByte] = board => handler.call(board, board.buffer.slice(2, -1)); + + return this; + } + + /* + * Allow user to remove sysex response handlers. + * + * @param {number} commandByte The commandByte to disassociate with a handler + * previously set via `sysexResponse( commandByte, handler)`. + */ + + clearSysexResponse(commandByte) { + /* istanbul ignore else */ + if (Firmata.SYSEX_RESPONSE[commandByte]) { + delete Firmata.SYSEX_RESPONSE[commandByte]; + } + } + + /** + * Allow user code to send arbitrary sysex messages + * + * @param {Array} message The message array is expected to be all necessary bytes + * between START_SYSEX and END_SYSEX (non-inclusive). It will + * be assumed that the data in the message array is + * already encoded as 2 7-bit bytes LSB first. + * + * + */ + + sysexCommand(message) { + + if (!message || !message.length) { + throw new Error("Sysex Command cannot be empty"); + } + + writeToTransport(this, [ + START_SYSEX, + ...message.slice(), + END_SYSEX + ]); + return this; + } + + /** + * Send SYSTEM_RESET to arduino + */ + + reset() { + writeToTransport(this, [SYSTEM_RESET]); + } + + /** + * Firmata.isAcceptablePort Determines if a `port` object (from SerialPort.list(...)) + * is a valid Arduino (or similar) device. + * @return {Boolean} true if port can be connected to by Firmata + */ + + static isAcceptablePort(port) { + let rport = /usb|acm|^com/i; + + if (rport.test(port.comName)) { + return true; + } + + return false; + } + + /** + * Firmata.requestPort(callback) Request an acceptable port to connect to. + * callback(error, port) + */ + + static requestPort(callback) { + if (!Transport || (Transport && typeof Transport.list !== "function")) { + process.nextTick(() => { + callback(new Error("No Transport provided"), null); + }); + } else { + Transport.list((error, ports) => { + const port = ports.find(port => Firmata.isAcceptablePort(port) && port); + + /* istanbul ignore if */ + if (error) { + callback(error, null); + } else { + if (port) { + callback(null, port); + } else { + callback(new Error("No Acceptable Port Found"), null); + } + } + }); + } + } + + // Expose encode/decode for custom sysex messages + static encode(data) { + const encoded = []; + const length = data.length; + + for (let i = 0; i < length; i++) { + encoded.push( + data[i] & 0x7F, + (data[i] >> 7) & 0x7F + ); + } + + return encoded; + } + + static decode(data) { + const decoded = []; + + if (data.length % 2 !== 0) { + throw new Error("Firmata.decode(data) called with odd number of data bytes"); + } + + while (data.length) { + const lsb = data.shift(); + const msb = data.shift(); + decoded.push(lsb | (msb << 7)); + } + + return decoded; + } +} + +// Prototype Compatibility Aliases +Firmata.prototype.analogWrite = Firmata.prototype.pwmWrite; + +// Static Compatibility Aliases +Firmata.Board = Firmata; +Firmata.SYSEX_RESPONSE = SYSEX_RESPONSE; +Firmata.MIDI_RESPONSE = MIDI_RESPONSE; + +// The following are used internally. + +/** + * writeToTransport Due to the non-blocking behaviour of transport write + * operations, dependent programs need a way to know + * when all writes are complete. Every write increments + * a `pending` value, when the write operation has + * completed, the `pending` value is decremented. + * + * @param {Board} board An active Board instance + * @param {Array} data An array of 8 and 7 bit values that will be + * wrapped in a Buffer and written to the transport. + */ +function writeToTransport(board, data) { + board.pending++; + board.transport.write(Buffer.from(data), () => board.pending--); +} + +function i2cRequest(board, bytes) { + const active = i2cActive.get(board); + + if (!active) { + throw new Error("I2C is not enabled for this board. To enable, call the i2cConfig() method."); + } + + // Do not tamper with I2C_CONFIG messages + if (bytes[1] === I2C_REQUEST) { + const address = bytes[2]; + + // If no peripheral settings exist, make them. + if (!active[address]) { + active[address] = { + stopTX: true, + }; + } + + // READ (8) or CONTINUOUS_READ (16) + // value & 0b00011000 + if (bytes[3] & I2C_READ_MASK) { + // Invert logic to accomodate default = true, + // which is actually stopTX = 0 + bytes[3] |= Number(!active[address].stopTX) << 6; + } + } + + writeToTransport(board, bytes); +} + + +function encode32BitSignedInteger(data) { + const negative = data < 0; + + data = Math.abs(data); + + const encoded = [ + data & 0x7F, + (data >> 7) & 0x7F, + (data >> 14) & 0x7F, + (data >> 21) & 0x7F, + (data >> 28) & 0x07 + ]; + + if (negative) { + encoded[encoded.length - 1] |= 0x08; + } + + return encoded; +} + +function decode32BitSignedInteger(bytes) { + let result = (bytes[0] & 0x7F) | + ((bytes[1] & 0x7F) << 7) | + ((bytes[2] & 0x7F) << 14) | + ((bytes[3] & 0x7F) << 21) | + ((bytes[4] & 0x07) << 28); + + if (bytes[4] >> 3) { + result *= -1; + } + + return result; +} + +const MAX_SIGNIFICAND = Math.pow(2, 23); + +function encodeCustomFloat(input) { + const sign = input < 0 ? 1 : 0; + + input = Math.abs(input); + + const base10 = Math.floor(Math.log10(input)); + // Shift decimal to start of significand + let exponent = 0 + base10; + input /= Math.pow(10, base10); + + // Shift decimal to the right as far as we can + while (!Number.isInteger(input) && input < MAX_SIGNIFICAND) { + exponent -= 1; + input *= 10; + } + + // Reduce precision if necessary + while (input > MAX_SIGNIFICAND) { + exponent += 1; + input /= 10; + } + + input = Math.trunc(input); + exponent += 11; + + const encoded = [ + input & 0x7F, + (input >> 7) & 0x7F, + (input >> 14) & 0x7F, + (input >> 21) & 0x03 | (exponent & 0x0F) << 2 | (sign & 0x01) << 6 + ]; + + return encoded; +} + +function decodeCustomFloat(input) { + const exponent = ((input[3] >> 2) & 0x0F) - 11; + const sign = (input[3] >> 6) & 0x01; + + let result = input[0] | + (input[1] << 7) | + (input[2] << 14) | + (input[3] & 0x03) << 21; + + if (sign) { + result *= -1; + } + return result * Math.pow(10, exponent); +} + + +/* istanbul ignore else */ +if (process.env.IS_TEST_MODE) { + let transport = null; + Firmata.test = { + i2cPeripheralSettings(board) { + return i2cActive.get(board); + }, + get i2cActive() { + return i2cActive; + }, + set transport(value) { + transport = Transport; + Transport = value; + }, + restoreTransport() { + Transport = transport; + }, + encode32BitSignedInteger, + decode32BitSignedInteger, + encodeCustomFloat, + decodeCustomFloat, + writeToTransport, + + symbols: { + SYM_sendOneWireRequest, + SYM_sendOneWireSearch, + } + }; +} + +const bindTransport = function(transport) { + Transport = transport; + return Firmata; +}; + +bindTransport.Firmata = Firmata; + +module.exports = bindTransport; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/onewireutils.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/onewireutils.js new file mode 100644 index 00000000..29ea60e1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/lib/onewireutils.js @@ -0,0 +1,47 @@ +"use strict"; +const Encoder7Bit = require("./encoder7bit"); +const OneWireUtils = { + crc8(data) { + let crc = 0; + + for (let inbyte of data) { + for (let n = 8; n; n--) { + const mix = (crc ^ inbyte) & 0x01; + crc >>= 1; + + if (mix) { + crc ^= 0x8C; + } + + inbyte >>= 1; + } + } + + return crc; + }, + + readDevices(data) { + const deviceBytes = Encoder7Bit.from7BitArray(data); + const devices = []; + + for (let i = 0; i < deviceBytes.length; i += 8) { + const device = deviceBytes.slice(i, i + 8); + + if (device.length !== 8) { + continue; + } + + const check = OneWireUtils.crc8(device.slice(0, 7)); + + if (check !== device[7]) { + console.error("ROM invalid!"); + } + + devices.push(device); + } + + return devices; + } +}; + +module.exports = OneWireUtils; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/package.json new file mode 100644 index 00000000..955a1f3b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/package.json @@ -0,0 +1,44 @@ +{ + "_from": "firmata-io@^2.0.0", + "_id": "firmata-io@2.0.0", + "_inBundle": false, + "_integrity": "sha512-9wCgc6KYFT6xZ4RLCTLM00G3tpVu0BHhufRiipgCplG00lJa+lQ2cY5Dpfkc1RKMJXXQTzknIVZC5vJ4I3Xy/g==", + "_location": "/node-red-contrib-johnny-five/firmata-io", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "firmata-io@^2.0.0", + "name": "firmata-io", + "escapedName": "firmata-io", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/firmata" + ], + "_resolved": "https://registry.npmjs.org/firmata-io/-/firmata-io-2.0.0.tgz", + "_shasum": "27d1c3447abb9790c23692e9948e5d7e8b163aab", + "_spec": "firmata-io@^2.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/firmata", + "author": { + "name": "Julian Gautier" + }, + "bugs": { + "url": "https://github.com/firmata/firmata.js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Firmata protocol implementation", + "gitHead": "7ddbf3e14e360706fa3f64c61926abc11c4f0116", + "homepage": "http://www.github.com/firmata/firmata.js", + "license": "MIT", + "main": "lib/firmata", + "name": "firmata-io", + "repository": { + "type": "git", + "url": "git://github.com/firmata/firmata.js.git" + }, + "version": "2.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/readme.md new file mode 100644 index 00000000..87fc3030 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata-io/readme.md @@ -0,0 +1,107 @@ +# Firmata-io + +This is Firmata.js without a default `Transport`. + +# Install + +Install Firmata-io: + +```sh +npm install firmata-io --save +``` + +Install a Transport: + + +```sh +npm install serialport --save +``` + +## Transports + +- Serialport +- Etherport + +# Basic Usage + +## With A _Transport Class_ + +Here's an example using the `Serialport` class: + +```js +// Require your Transport! +const Serialport = require("serialport"); +// Pass the Transport class to the transport binding +// function exported by firmata-io. The transport binding +// function will return the Firmata class object with +// the Transport class bound in its scope. +const Firmata = require("firmata-io")(Serialport); + +Firmata.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Firmata(port.comName); + + board.on("close", () => { + // Unplug the board to see this event! + console.log("Closed!"); + }); +}); +``` + +## With A _Transport Instance_ + +Here's an example using a `Serialport` instance: + +```js +// Require your Transport! +const Serialport = require("serialport"); +// Get the Firmata class without a bound transport. +const Firmata = require("firmata-io").Firmata; + +Serialport.list().then(ports => { + // Figure which port to use... + const port = ports.find(port => port.manufacturer.startsWith("Arduino")); + + // Instantiate an instance of your Transport class + const transport = new Serialport(port.comName); + + // Pass the new instance directly to the Firmata class + const board = new Firmata(transport); + + board.on("close", () => { + // Unplug the board to see this event! + console.log("Closed!"); + }); +}); +``` + + +## License + +(The MIT License) + +Copyright (c) 2011-2015 Julian Gautier \ +Copyright (c) 2015-2019 The Firmata.js Authors (see AUTHORS.md) + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/.tesselignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/.tesselignore new file mode 100644 index 00000000..92661df6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/.tesselignore @@ -0,0 +1,7 @@ +changelog +gruntfile.js +repl.js +package-lock.json +readme.md +examples/ +test/ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/adxl345.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/adxl345.js new file mode 100644 index 00000000..a6684003 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/adxl345.js @@ -0,0 +1,49 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const register = { + POWER: 0x2D, + RANGE: 0x31, + READ: 0xB2, + }; + + const board = new Board(port.comName); + + board.on("ready", function() { + console.log("Ready"); + + const adxl345 = 0x53; + const sensitivity = 0.00390625; + + // Enable I2C + this.i2cConfig(); + + // Toggle power to reset + this.i2cWrite(adxl345, register.POWER, 0); + this.i2cWrite(adxl345, register.POWER, 8); + + // Set range (this is 2G range) + this.i2cWrite(adxl345, register.RANGE, 8); + + // Set register to READ position and request 6 bytes + this.i2cRead(adxl345, register.READ, 6, data => { + const x = (data[1] << 8) | data[0]; + const y = (data[3] << 8) | data[2]; + const z = (data[5] << 8) | data[4]; + + // Wrap and clamp 16 bits; + const X = (x >> 15 ? ((x ^ 0xFFFF) + 1) * -1 : x) * sensitivity; + const Y = (y >> 15 ? ((y ^ 0xFFFF) + 1) * -1 : y) * sensitivity; + const Z = (z >> 15 ? ((z ^ 0xFFFF) + 1) * -1 : z) * sensitivity; + + console.log("X: ", X); + console.log("Y: ", Y); + console.log("Z: ", Z); + }); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/blink.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/blink.js new file mode 100644 index 00000000..f2920475 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/blink.js @@ -0,0 +1,21 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + board.on("ready", () => { + const pin = 13; + let state = 1; + + board.pinMode(pin, board.MODES.OUTPUT); + + setInterval(() => { + board.digitalWrite(pin, (state ^= 1)); + }, 500); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/close-events.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/close-events.js new file mode 100644 index 00000000..ed55c6c0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/close-events.js @@ -0,0 +1,15 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + board.on("close", () => { + // Unplug the board to see this event! + console.log("Closed!"); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/hw-serial-read-gps.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/hw-serial-read-gps.js new file mode 100644 index 00000000..3c9df902 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/hw-serial-read-gps.js @@ -0,0 +1,40 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + board.on("ready", () => { + console.log("READY"); + + const HW_SERIAL1 = board.SERIAL_PORT_IDs.HW_SERIAL1; + + board.serialConfig({ + portId: HW_SERIAL1, + baud: 9600 + }); + + board.serialRead(HW_SERIAL1, data => { + console.log(new Buffer(data).toString("ascii")); + }); + + board.on("string", message => { + console.log(message); + }); + + // log serial pin numbers + for (const pin in board.pins) { + const modes = board.pins[pin].supportedModes; + for (const mode in modes) { + if (modes[mode] === board.MODES.SERIAL) { + console.log(`serial pin: ${pin}`); + } + } + } + + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/johnny-five-io-plugin.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/johnny-five-io-plugin.js new file mode 100644 index 00000000..510c2d10 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/johnny-five-io-plugin.js @@ -0,0 +1,28 @@ +const SerialPort = require("serialport"); +const five = require("johnny-five"); +const Firmata = require("../"); + +SerialPort.list((error, list) => { + const device = list.reduce((accum, item) => { + if (item.manufacturer.indexOf("Arduino") === 0) { + return item; + } + return accum; + }, null); + + + /* + The following demonstrates using Firmata + as an IO Plugin for Johnny-Five + */ + + const board = new five.Board({ + io: new Firmata(device.comName) + }); + + board.on("ready", () => { + const led = new five.Led(13); + led.blink(500); + }); +}); + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/k22.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/k22.js new file mode 100644 index 00000000..10862584 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/k22.js @@ -0,0 +1,33 @@ +/** + * Sample script to take readings from a k22 co2 sensor. + * http://www.co2meter.com/collections/co2-sensors/products/k-22-oc-co2-sensor-module + */ + +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + const board = new Board(port.comName); + + board.on("ready", () => { + const k22 = 0x68; + + board.i2cConfig(); + board.i2cWrite(k22, [0x22, 0x00, 0x08, 0x2A]); + board.i2cRead(k22, 4, data => { + let ppms = 0; + ppms |= data[1] & 0xFF; + ppms = ppms << 8; + ppms |= data[2] & 0xFF; + const checksum = data[0] + data[1] + data[2]; + if (checksum === data[3]) { + console.log(`Current PPMs: ${ppms}`); + } else { + console.log("Checksum failure"); + } + }); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/mma8452.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/mma8452.js new file mode 100644 index 00000000..81d0a1c3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/mma8452.js @@ -0,0 +1,104 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const register = { + CTRL_REG1: 0x2A, + XYZ_DATA_CFG: 0x0E, + READ_X_MSB: 0x01, + }; + + const board = new Board(port.comName); + // var board = new Board("/dev/cu.usbmodem1411"); + + board.on("ready", function() { + console.log("Ready"); + + const mma8452 = 0x1D; + const scale = 2; // 2G + const options = { + address: mma8452, + settings: { + stopTX: false, + }, + }; + + this.i2cConfig(options); + + function mode(which, callback) { + board.i2cReadOnce(mma8452, register.CTRL_REG1, 1, data => { + let value = data[0]; + if (which === "standby") { + // Clear the first bit + value &= ~1; + } else { + // Set the first bit + value |= 1; + } + + board.i2cWrite(mma8452, register.CTRL_REG1, value); + + callback(); + }); + } + + new Promise(resolve => { + mode("standby", () => { + + // 00: 2G (0b00000000) + // 01: 4G (0b00000001) + // 10: 8G (0b00000010) + const fsr = scale >> 2; // 2G (0b00000000) + board.i2cWrite(mma8452, register.XYZ_DATA_CFG, fsr); + + // 0: 800 Hz + // 1: 400 Hz + // 2: 200 Hz * + // 3: 100 Hz + // 4: 50 Hz + // 5: 12.5 Hz + // 6: 6.25 Hz + // 7: 1.56 Hz + const ctrlreg1 = 0b00000101 << 3; // 5 0b00[101]000 + board.i2cWrite(mma8452, register.CTRL_REG1, ctrlreg1); + + mode("active", resolve); + }); + }).then(() => { + + board.i2cRead(mma8452, 0x00, 1, data => { + const available = data[0]; + + if ((available & 0x08) >> 3) { + board.i2cReadOnce(mma8452, register.READ_X_MSB, 6, data => { + let x = (data[0] << 8 | data[1]) >> 4; + let y = (data[2] << 8 | data[3]) >> 4; + let z = (data[4] << 8 | data[5]) >> 4; + + if (data[0] > 0x7F) { + x = -(1 + 0xFFF - x); + } + + if (data[2] > 0x7F) { + y = -(1 + 0xFFF - y); + } + + if (data[4] > 0x7F) { + z = -(1 + 0xFFF - z); + } + + console.log({ + x: x / ((1 << 12) / (2 * scale)), + y: y / ((1 << 12) / (2 * scale)), + z: z / ((1 << 12) / (2 * scale)), + }); + }); + } + }); + }); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/reporting.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/reporting.js new file mode 100644 index 00000000..3031bea8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/reporting.js @@ -0,0 +1,48 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + const board = new Board(port.comName); + + board.on("ready", function() { + const a = 6; + const b = 7; + + console.log("Ready."); + + this.pinMode(a, this.MODES.PWM); + this.pinMode(b, this.MODES.OUTPUT); + + const states = { + 5: 0, + 8: 0 + }; + + Object.keys(states).forEach(function(pin) { + pin = +pin; + this.pinMode(pin, this.MODES.INPUT); + this.digitalRead(pin, function(value) { + console.log("pin: %d value: %d", pin, value); + if (states[pin] !== value) { + states[pin] = value; + this.digitalWrite(b, value); + } + }); + }, this); + + // var analogs = [0, 1, 2, 3, 4, 5]; + const analogs = [3]; + + analogs.forEach(function(pin) { + pin = +pin; + this.pinMode(pin, this.MODES.ANALOG); + this.analogRead(pin, function(value) { + this.analogWrite(a, value >> 2); + }); + }, this); + + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/servo-config.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/servo-config.js new file mode 100644 index 00000000..024174c9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/servo-config.js @@ -0,0 +1,20 @@ +const Board = require("../"); +const board = new Board("/dev/tty.usbmodem1421"); + +board.on("ready", () => { + let degrees = 10; + let incrementer = 10; + + // This will map 0-180 to 1000-1500 + board.servoConfig(9, 1000, 1500); + board.servoWrite(9, 0); + + setInterval(() => { + if (degrees >= 180 || degrees === 0) { + incrementer *= -1; + } + degrees += incrementer; + board.servoWrite(9, degrees); + console.log(degrees); + }, 500); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/servosweep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/servosweep.js new file mode 100644 index 00000000..45fbe35e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/servosweep.js @@ -0,0 +1,23 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + const board = new Board(port.comName); + + board.on("ready", () => { + let degrees = 10; + let incrementer = 10; + board.pinMode(9, board.MODES.SERVO); + board.servoWrite(9, 0); + setInterval(() => { + if (degrees >= 180 || degrees === 0) { + incrementer *= -1; + } + degrees += incrementer; + board.servoWrite(9, degrees); + }, 500); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-accel.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-accel.js new file mode 100644 index 00000000..b4f2763a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-accel.js @@ -0,0 +1,29 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + board.on("ready", () => { + + board.accelStepperConfig({ + deviceNum: 0, + type: board.STEPPER.TYPE.FOUR_WIRE, + motorPin1: 4, + motorPin2: 5, + motorPin3: 6, + motorPin4: 7, + stepSize: board.STEPPER.STEP_SIZE.WHOLE + }); + + board.accelStepperSpeed(0, 300); + board.accelStepperAcceleration(0, 100); + board.accelStepperStep(0, 2000, position => { + console.log(`Current position: ${position}`); + }); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-driver.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-driver.js new file mode 100644 index 00000000..dc621b4e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-driver.js @@ -0,0 +1,30 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + board.on("ready", () => { + + board.accelStepperConfig({ + deviceNum: 0, + type: board.STEPPER.TYPE.DRIVER, + stepPin: 5, + directionPin: 6, + enablePin: 2, + invertPins: [2] + }); + + board.accelStepperSpeed(0, 400); + board.accelStepperAcceleration(0, 100); + board.accelStepperEnable(0, true); + board.accelStepperStep(0, 200, position => { + console.log(`Current position: ${position}`); + }); + + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-multi.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-multi.js new file mode 100644 index 00000000..2673c4d7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-multi.js @@ -0,0 +1,54 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + board.on("ready", () => { + + board.accelStepperConfig({ + deviceNum: 0, + type: board.STEPPER.TYPE.FOUR_WIRE, + motorPin1: 5, + motorPin2: 6, + motorPin3: 7, + motorPin4: 8, + stepSize: board.STEPPER.STEP_SIZE.WHOLE + }); + + board.accelStepperConfig({ + deviceNum: 1, + type: board.STEPPER.TYPE.FOUR_WIRE, + motorPin1: 9, + motorPin2: 10, + motorPin3: 11, + motorPin4: 12, + stepSize: board.STEPPER.STEP_SIZE.HALF + }); + + board.accelStepperSpeed(0, 400); + board.accelStepperSpeed(1, 400); + + board.multiStepperConfig({ + groupNum: 0, + devices: [0, 1] + }); + + board.multiStepperTo(0, [2000, 3000], () => { + + board.accelStepperReportPosition(0, value => { + console.log(`Stepper 0 position: ${value}`); + }); + + board.accelStepperReportPosition(1, value => { + console.log(`Stepper 1 position: ${value}`); + }); + + }); + + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-three-wire.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-three-wire.js new file mode 100644 index 00000000..264c7814 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/stepper-three-wire.js @@ -0,0 +1,27 @@ +const Board = require("../"); + +Board.requestPort(function(error, port) { + if (error) { + console.log(error); + return; + } + + var board = new Board(port.comName); + + board.on("ready", function() { + + board.accelStepperConfig({ + deviceNum: 0, + type: board.STEPPER.TYPE.THREE_WIRE, + motorPin1: 2, + motorPin2: 3, + motorPin3: 4 + }); + + board.accelStepperSpeed(0, 100); + board.accelStepperStep(0, 1000, function(position) { + console.log("Current position: " + position); + }); + + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/sw-serial-read-gps.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/sw-serial-read-gps.js new file mode 100644 index 00000000..aa9d652e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/sw-serial-read-gps.js @@ -0,0 +1,27 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + const board = new Board(port.comName); + + board.on("ready", () => { + console.log("READY"); + + const SW_SERIAL0 = board.SERIAL_PORT_IDs.SW_SERIAL0; + const maxBytesToRead = 4; + + board.serialConfig({ + portId: SW_SERIAL0, + baud: 9600, + rxPin: 10, + txPin: 11 + }); + + board.serialRead(SW_SERIAL0, maxBytesToRead, data => { + console.log(new Buffer(data).toString("ascii")); + }); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-analog-read.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-analog-read.js new file mode 100644 index 00000000..9ad54247 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-analog-read.js @@ -0,0 +1,48 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + console.log(__filename); + console.log("------------------------------"); + + board.on("open", () => { + console.log(" ✔ open"); + }); + + board.on("reportversion", () => { + console.log(" ✔ reportversion"); + }); + + board.on("queryfirmware", () => { + console.log(" ✔ queryfirmware"); + }); + + board.on("capability-query", () => { + console.log(" ✔ capability-query"); + }); + + board.on("ready", function() { + console.log(" ✔ ready"); + clearTimeout(timeout); + + this.pinMode(0, 2); + this.analogRead(0, () => { + console.log(" ✔ received data (exiting)"); + console.log("------------------------------"); + process.exit(); + }); + }); + + var timeout = setTimeout(() => { + console.log(board.currentBuffer); + console.log(">>>>>>>>>>>>>>TIMEOUT<<<<<<<<<<<<<<"); + console.log("------------------------------"); + process.exit(); + }, 10000); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-i2c-read.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-i2c-read.js new file mode 100644 index 00000000..ed587a5f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-i2c-read.js @@ -0,0 +1,48 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + console.log(__filename); + console.log("------------------------------"); + + board.on("open", () => { + console.log(" ✔ open"); + }); + + board.on("reportversion", () => { + console.log(" ✔ reportversion"); + }); + + board.on("queryfirmware", () => { + console.log(" ✔ queryfirmware"); + }); + + board.on("capability-query", () => { + console.log(" ✔ capability-query"); + }); + + board.on("ready", () => { + console.log(" ✔ ready"); + clearTimeout(timeout); + + board.i2cConfig(); + board.i2cRead(0x0A, 1, () => { + console.log(" ✔ received data (exiting)"); + console.log("------------------------------"); + process.exit(); + }); + }); + + var timeout = setTimeout(() => { + console.log(board.currentBuffer); + console.log(">>>>>>>>>>>>>>TIMEOUT<<<<<<<<<<<<<<"); + console.log("------------------------------"); + process.exit(); + }, 10000); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-serial-read.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-serial-read.js new file mode 100644 index 00000000..52774b05 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/examples/test-serial-read.js @@ -0,0 +1,56 @@ +const Board = require("../"); + +Board.requestPort((error, port) => { + if (error) { + console.log(error); + return; + } + + const board = new Board(port.comName); + + console.log(__filename); + console.log("------------------------------"); + + board.on("open", () => { + console.log(" ✔ open"); + }); + + board.on("reportversion", () => { + console.log(" ✔ reportversion"); + }); + + board.on("queryfirmware", () => { + console.log(" ✔ queryfirmware"); + }); + + board.on("capability-query", () => { + console.log(" ✔ capability-query"); + }); + + board.on("ready", () => { + console.log(" ✔ ready"); + clearTimeout(timeout); + + const SW_SERIAL0 = board.SERIAL_PORT_IDs.SW_SERIAL0; + + board.serialConfig({ + portId: SW_SERIAL0, + baud: 9600, + rxPin: 2, + txPin: 3 + }); + + board.serialRead(SW_SERIAL0, () => { + console.log(" ✔ received data (exiting)"); + console.log("------------------------------"); + process.exit(); + }); + }); + + var timeout = setTimeout(() => { + console.log(board.currentBuffer); + console.log(">>>>>>>>>>>>>>TIMEOUT<<<<<<<<<<<<<<"); + console.log("------------------------------"); + process.exit(); + }, 10000); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/lib/com.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/lib/com.js new file mode 100644 index 00000000..75ed443a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/lib/com.js @@ -0,0 +1,64 @@ +"use strict"; + +const Emitter = require("events"); + +class TransportStub extends Emitter { + constructor(path/*, options, openCallback*/) { + super(); + this.isOpen = true; + this.baudRate = 0; + this.path = path; + } + + write(buffer) { + // Tests are written to work with arrays not buffers + // this shouldn't impact the data, just the container + // This also should be changed in future test rewrites + /* istanbul ignore else */ + if (Buffer.isBuffer(buffer)) { + buffer = Array.from(buffer); + } + + this.lastWrite = buffer; + this.emit("write", buffer); + } + + static list() { + /* istanbul ignore next */ + return Promise.resolve([]); + } +} + +// This trash is necessary for stubbing with sinon. +TransportStub.SerialPort = TransportStub; + +let com; +let error; +let SerialPort; + +try { + /* istanbul ignore else */ + if (process.env.IS_TEST_MODE) { + com = TransportStub; + } else { + SerialPort = require("serialport"); + com = SerialPort; + } +} catch (err) { + /* istanbul ignore next */ + error = err; +} + +/* istanbul ignore if */ +if (com == null) { + if (process.env.IS_TEST_MODE) { + com = TransportStub; + } else { + console.log("It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https://github.com/voodootikigod/node-serialport#to-install"); + console.log(`The result of requiring the package is: ${SerialPort}`); + console.log(error); + throw "Missing serialport dependency"; + } +} + +module.exports = com; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/lib/firmata.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/lib/firmata.js new file mode 100644 index 00000000..410143e1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/lib/firmata.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = require("firmata-io")(require("./com")); + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/package.json new file mode 100644 index 00000000..c4905768 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/package.json @@ -0,0 +1,59 @@ +{ + "_from": "firmata@^2.0.0", + "_id": "firmata@2.0.0", + "_inBundle": false, + "_integrity": "sha512-THFTZVPZLFNdtv/IaBALEHXaeTti2v12woD/MGAo0bG082WQKBZuEX1PRk0Hd39XV3rN5XuQnWrAgo112OWbNw==", + "_location": "/node-red-contrib-johnny-five/firmata", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "firmata@^2.0.0", + "name": "firmata", + "escapedName": "firmata", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five", + "/node-red-contrib-johnny-five/johnny-five" + ], + "_resolved": "https://registry.npmjs.org/firmata/-/firmata-2.0.0.tgz", + "_shasum": "f0ee62b700b0a16bf4b0836ffdf61737e9183b63", + "_spec": "firmata@^2.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five", + "author": { + "name": "Julian Gautier" + }, + "bugs": { + "url": "https://github.com/firmata/firmata.js/issues" + }, + "bundleDependencies": false, + "dependencies": { + "firmata-io": "^2.0.0", + "serialport": "^7.1.3" + }, + "deprecated": false, + "description": "Firmata protocol implementation for programmatic interaction with Arduino and Arduino compatible development boards. Includes Serialport", + "directories": { + "example": "examples", + "lib": "lib" + }, + "gitHead": "7ddbf3e14e360706fa3f64c61926abc11c4f0116", + "homepage": "http://www.github.com/firmata/firmata.js", + "keywords": [], + "license": "MIT", + "main": "./lib/firmata", + "name": "firmata", + "repository": { + "type": "git", + "url": "git://github.com/firmata/firmata.js.git" + }, + "scripts": { + "coveralls": "nyc --reporter=lcov grunt test && cat ./coverage/lcov.info | coveralls", + "test": "grunt", + "test-cover": "nyc grunt test" + }, + "version": "2.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/readme.md new file mode 100644 index 00000000..fed39f4f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/readme.md @@ -0,0 +1,628 @@ +# Firmata.js + + +[![Travis Build Status](https://travis-ci.org/firmata/firmata.js.svg?branch=master)](https://travis-ci.org/firmata/firmata.js) +[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/w026oorwsq44223j?svg=true)](https://ci.appveyor.com/project/rwaldron/firmata) +[![Coverage Status](https://coveralls.io/repos/github/firmata/firmata.js/badge.svg?branch=master)](https://coveralls.io/github/firmata/firmata.js?branch=master) + + +[Firmata protocol](https://github.com/firmata/protocol) implementation for programmatic interaction with Arduino and Arduino compatible development boards. + +# Install + +As a project dependency: + +```sh +npm install firmata +``` + + +For global cli use: + +```sh +npm install -g firmata +``` + + +# REPL + +If you run *firmata* from the command line it will prompt you for the serial port. Then it will present you with a REPL with a board variable available. + +# Basic Usage + +### Using the `"ready"` event... + +#### With a path string: + +```js +const Firmata = require("firmata"); +const board = new Firmata("system path or name"); + +board.on("ready", () => { + // Arduino is ready to communicate +}); +``` + +#### With a Serialport object: + +```js +const Serialport = require("serialport"); +const Firmata = require("firmata"); +const board = new Firmata(new Serialport(...)); + +board.on("ready", () => { + // Arduino is ready to communicate +}); +``` + +#### With an Etherport object: + +[Etherport](https://github.com/rwaldron/etherport) is a TCP server that can be used with [StandardFirmataEthernet](https://github.com/firmata/arduino/tree/master/examples/StandardFirmataEthernet) or [StandardFirmataWiFi](https://github.com/firmata/arduino/tree/master/examples/StandardFirmataWiFi) when configured as a TCP client (StandardFirmataEthernet can currently only be configured as a TCP client). There is also [etherport-client](https://github.com/mwittig/etherport-client) which is a TCP client that can be used with StandardFirmataWiFi when configured as a TCP server. + + +```js +const Etherport = require("etherport"); +const Firmata = require("firmata"); +const board = new Firmata(new Etherport(...)); + +board.on("ready", () => { + // Arduino is ready to communicate +}); +``` + +### Using the `readyCallback`: + +```js +const Firmata = require("firmata"); +const board = new Firmata("system path or name", () => { + // Arduino is ready to communicate +}); +``` + +#### With a Serialport object: + +```js +const Serialport = require("serialport"); +const Firmata = require("firmata"); +const board = new Firmata(new Serialport(...), () => { + // Arduino is ready to communicate +}); +``` + +#### With an Etherport object: + +```js +const Etherport = require("etherport"); +const Firmata = require("firmata"); +const board = new Firmata(new Etherport(...), () => { + // Arduino is ready to communicate +}); +``` + + +**Any object can be a `Transport` object, as long as it emits an "open" event and a "data" event, which match the semantics of a `Serialport` object.** + + +# `Firmata` + +The `Firmata` constructor creates an instance that represents a physical board. + +- `new Firmata(path[, options][, readyCallback])` +- `new Firmata(port[, options][, readyCallback])` + + | Parameter | Type | Description | Default | Required | + |-----------|------- |------------ |--------- |----------| + | path | String | A system path or port name. | none | Yes\* | + | port | Transport | A Transport object. | none | Yes\* | + | [options] | object | Optional settings to used when constructing. | [See Below](#board-options) | No | + | [readyCallback] | function | Optional "ready" callback to call when connection to board is complete. | none | No | + + \* _**Either**_ a **path** or a **port** are required. + + - Notes: + - `new Firmata(path: string)`: instances can be constructed using only a system path of the serial port to open or name, for example: + + `new Firmata("/dev/usb.whatever")` + + `new Firmata("/dev/ttyACM0")` + + `new Firmata("COM1")` + - `new Firmata(port: Transport)`: instances can be constructed using a "Transport" object, for example: + + `new Firmata(new Serialport(...))` + + `new Firmata(new Etherport(...))` + +- Options + + | Property | Type | Description | Default | Required | + |-----------|------- |------------ |--------- |----------| + | skipCapabilities | Boolean | Set to `true` to skip the `CAPABILITY_QUERY` | `true` | No | + | reportVersionTimeout | Number | Time in milliseconds to wait before timing out the initial request for the firmware version. | 5000 | No | + | samplingInterval | Number | Time in milliseconds of the sampling interval on the actual board. | 19 | No | + | serialport | Object | See: [Serialport:openOptions](https://github.com/EmergingTechnologyAdvisors/node-serialport#module_serialport--SerialPort..openOptions). These will be ignored if the first argument is a Transport object. | \* | No | + + \* Defaults are defined in `Serialport`. + + + + + + ## Firmata Instance + +- `board.MODES` + This is an enumeration of the different modes available. These are used in calls to the *pinMode* function. + ```js + { + INPUT: 0x00, + OUTPUT: 0x01, + ANALOG: 0x02, + PWM: 0x03, + SERVO: 0x04, + SHIFT: 0x05, + I2C: 0x06, + ONEWIRE: 0x07, + STEPPER: 0x08, + SERIAL: 0x0A, + PULLUP: 0x0B, + IGNORE: 0x7F, + UNKOWN: 0x10 + } + ``` + + +- `board.HIGH* and *board.LOW` + + Constants used to set a digital pin's voltage will be set to the corresponding value: 5V (or 3.3V, or 1.8V, depending on board) for `HIGH`, 0V (Ground) for `LOW`. + +- `board.pins` + + This is an array of all the pins on the board. + + Each value in the array is an object: + + ```js + { + mode: Number, // Current mode of pin which is on the the board.MODES. + value: Number, // Current value of the pin. when pin is digital and set to output it will be + // Firmata.HIGH or Firmata.LOW. If the pin is an analog pin it will be an numeric + // value between 0 and 1023. + supportedModes: [ ...Number ], // Array of modes from board.MODES that are supported on this pin. + analogChannel: Number, // Will be 127 for digital pins and the pin number for analog pins. + state: Number // For output pins this is the value of the pin on the board, for digital input + // it's the status of the pullup resistor (1 = pullup enabled, 0 = pullup disabled) + } + ``` + + This array holds all pins digital and analog. To get the analog pin number as seen on the arduino board use the analogChannel attribute. + +- `board.analogPins` + + This is an array of all the array indexes of the analog pins in the `board.pins` array. For example to get the analog pin 5 from the `board.pins` attributes use: + + ```js + board.pins[board.analogPins[5]];` + ``` + +## Firmata Prototype API + +### Pin + +- `board.pinMode(pin,mode)` + + Set a mode for a pin. pin is the number of the pin and the mode is on of the Firmata.MODES values. All digital pins are set to board.MODES.OUTPUT by default (because this is what the Firmata firmware running on the board defaults to) and all analog pins are set to board.MODES.ANALOG (analog input) by default. + +- `board.digitalWrite(pin,value,enqueue)` + + Write an output to a digital pin. pin is the number of the pin and the value is either board.HIGH or board.LOW. enqueue is optional and when true will update the local pin value but will not write the data until `flushDigitalPorts()` is called. + +- `board.flushDigitalPorts()` + + Directs firmata to update all ports whose values have been changed via digitalWrite with the `enqueue` parameter set to true. + +- `board.digitalRead(pin,callback)` + + Register to get the digital value (board.HIGH or board.LOW). The value is reported via the callback whenever it changes. To get the locally stored value at any other time you can use `board.pins[pinNumber].value`. + + Example: + + ```js + board.digitalRead(2, function(value) { + console.log("The value of digital pin 2 changed to: " + value); + }); + ``` + + To stop reporting digital values for a pin, call `board.reportDigitalPin(digitalPinNumber, 0)`. To restart, call `digitalRead(pin,callback)` or use `board.reportDigitalPin(digitalPinNumber, 1)` if you don't want to call digitalRead again. + + *Note if you are familiar with the use of digitalRead when writing an Arduino sketch, the firmata.js implementation of digitalRead is very different in that it's reporting-based rather than immediately returning a value as in an Arduino sketch.* + +- `board.analogWrite(pin,value)` + + Write an output to an analog pin (PWM). pin is the number of the pin and the value is between 0 and 255. + +- `board.analogRead(pin,callback)` + + Register to get the analog value (0 - 1023) of the pin. The value is reported via the callback at the current sampling interval. The sampling interval is 19 milliseconds by default so the analog value is reported every 19 ms unless the sampling interval is changed. See documentation for `board.setSamplingInterval` below. To get the locally stored value at any other time you can use `board.pins[board.analogPins[analogPinNumber]].value`, but the value will only be as fresh as the most recent report via the sampling interval. + + Example: + + ```js + board.analogRead(0, function(value) { + console.log("The value of pin A0 is " + value + " as reported at the sampling interval"); + }); + ``` + + To stop reporting analog values for a pin, call `board.reportAnalogPin(analogPinNumber, 0)`. To restart, call `analogRead(pin,callback)` or use `board.reportAnalogPin(analogPinNumber, 1)` if you don't want to call analogRead again. + + *Note if you are familiar with the use of analogRead when writing an Arduino sketch, the firmata.js implementation of analogRead is very different in that it's reporting-based rather than immediately returning a value as in an Arduino sketch.* + +- `board.setSamplingInterval(interval)` + + Set the sampling interval in milliseconds. Default is 19 ms. Minimum is 10 ms, max is 65535 ms. The sampling interval controls how often analog values are reported when using `board.analogRead` and how often i2c device values are reported when using `board.i2cRead`. The same sampling interval is used for both analog and i2c value reporting. + + You can alternatively set the sampling interval when creating a new Firmata instance: + + ```js + // set sampling interval to 30 milliseconds + const board = new Firmata(serialPortName, {samplingInterval: 30}); + ``` + + +- `board.getSamplingInterval()` + + Get the current sampling interval value in milliseconds. + +### Servo + +- `board.servoWrite(pin, degree)` +- `board.servoWrite(pin, pulse)` + + Write a degree value to a servo pin. + +- `board.servoConfig(pin, min, max)` + + Setup a servo with a specific min and max pulse (call instead of `pinMode`, which will provide default). + +### I2C + +- `board.i2cConfig(delay)` + + Configure and enable I2C, optionally provide a value in μs to delay between reads (defaults to `0`). Required to enable I2C communication. + +- `board.i2cConfig(options)` + + Configure and enable I2C, optionally provide an object that contains properties to use for whose value is a number in μs to delay between reads. Required to enable I2C communication. + + | Option | Description | Default | Required? | + |---------|-------------|---------|-----------| + | delay | µS delay between setting a register and requesting bytes from the register | 0 | No | + | address | Valid I2C address, used when there are specific configurations for a given address | none | No | + | settings | An object of properties to associate with a given address. | none | No | + + + | Setting | Description | Default | Required? | + |---------|-------------|---------|-----------| + | stopTX | Stop transmission after setting a register to read from. Setting to `false` will keep the transmission connection active. An example of the `false` behavior is the [MMA8452](https://github.com/sparkfun/MMA8452_Accelerometer/blob/master/Libraries/Arduino/src/SparkFun_MMA8452Q.cpp#L242-L270) | true | No | + + +- `board.i2cWrite(address, [...bytes])` + + Write an arbitrary number of bytes. May not exceed 64 Bytes. + +- `board.i2cWrite(address, register, [...bytes])` + + Write an arbitrary number of bytes to the specified register. May not exceed 64 Bytes. + +- `board.i2cWriteReg(address, register, byte)` + + Write a byte value to a specific register. + +- `board.i2cRead(address, numberOfBytesToRead, handler(data))` + + Read a specified number of bytes, continuously. `handler` receives an array of values, with a length corresponding to the number of read bytes. + +- `board.i2cRead(address, register, numberOfBytesToRead, handler(data))` + + Read a specified number of bytes from a register, continuously. `handler` receives an array of values, with a length corresponding to the number of read bytes. + +- `board.i2cReadOnce(address, numberOfBytesToRead, handler(data))` + + Read a specified number of bytes, one time. `handler` receives an array of values, with a length corresponding to the number of read bytes. + +- `board.i2cReadOnce(address, register, numberOfBytesToRead, handler(data))` + + Read a specified number of bytes from a register, one time. `handler` receives an array of values, with a length corresponding to the number of read bytes. + +- `board.sendI2CConfig(delay)` **Deprecated** + + Set I2C Config on the arduino + +- `board.sendI2CWriteRequest(slaveAddress, [bytes])` **Deprecated** + + Write an array of bytes to a an I2C device. + +- `board.sendI2CReadRequest(slaveAddress, numBytes, function(data))` **Deprecated** + + Requests a number of bytes from a slave I2C device. When the bytes are received from the I2C device the callback is called with the byte array. + +### Debug + +- `board.sendString("a string")` + + Send an arbitrary string. + +### One-Wire + +- `board.sendOneWireConfig(pin, enableParasiticPower)` + + Configure the pin as the controller in a 1-wire bus. Set `enableParasiticPower` to `true` if you want the data pin to power the bus. + +- `board.sendOneWireSearch(pin, callback)` + + Searches for 1-wire devices on the bus. The callback should accept an error argument and an array of device identifiers. + +- `board.sendOneWireAlarmsSearch(pin, callback)` + + Searches for 1-wire devices on the bus in an alarmed state. The callback should accept and error argument and an array of device identifiers. + +- `board.sendOneWireRead(pin, device, numBytesToRead, callback)` + + Reads data from a device on the bus and invokes the callback. + +- `board.sendOneWireReset()` + + Resets all devices on the bus. + +- `board.sendOneWireWrite(pin, device, data)` + + Writes data to the bus to be received by the device. The device should be obtained from a previous call to `sendOneWireSearch`. + +- `board.sendOneWireDelay(pin, delay)` + + Tells Firmata to not do anything for the amount of ms. Use when you need to give a device attached to the bus time to do a calculation. + +- `board.sendOneWireWriteAndRead(pin, device, data, numBytesToRead, callback)` + + Sends the `data` to the `device` on the bus, reads the specified number of bytes and invokes the `callback`. + + +### Serial + +- `board.SERIAL_PORT_IDs` + + IDs for both hardware and software serial ports on the board. + + ```js + { + HW_SERIAL0: 0x00, + HW_SERIAL1: 0x01, + HW_SERIAL2: 0x02, + HW_SERIAL3: 0x03, + SW_SERIAL0: 0x08, + SW_SERIAL1: 0x09, + SW_SERIAL2: 0x10, + SW_SERIAL3: 0x11, + } + ``` + +- `board.serialConfig(options)` + + Configure a hardware or serial port -- required before using serial read/write functions + + ``` + { + portId: board.SERIAL_PORT_IDs.HW_SERIAL1, // The serial port to use (HW_SERIAL2, SW_SERIAL0, SW_SERIAL1...) + baud: 115200, // (optional) The baud rate of the serial port; default is 57600 + rxPin: 5, // (optional)[SW Serial only] The RX pin of the SoftwareSerial instance + txPin: 6 // (optional)[SW Serial only] The TX pin of the SoftwareSerial instance + } + ``` + + +- `board.serialWrite(portId, inBytes)` + + Write an array of bytes to the specified serial port. + + +- `board.serialRead(portId, callback)` +- `board.serialRead(portId, maxBytesToRead, callback)` + + Start continuous reading of the specified serial port. The port is checked for data each iteration of the main Arduino loop. + +> `maxBytesToRead` specifies the maximum number of bytes to read per iteration. If there are less bytes in the buffer, the lesser number of bytes will be returned. A value of 0 indicates that all available bytes in the buffer should be read. + +- `board.serialStop(portId)` + + Stop continuous reading of the specified serial port. This does not close the port, it stops reading it but keeps the port open. + +- `board.serialClose(portId)` + + Close the specified serial port. + +- `board.serialFlush(portId)` + + Flush the specified serial port. For hardware serial, this waits for the transmission of outgoing serial data to complete. For software serial, this removes any buffered incoming serial data. + +- `board.serialListen(portId)` + + **For SoftwareSerial only**. Only a single SoftwareSerial instance can read data at a time. Call this method to set this port to be the reading port in the case there are multiple SoftwareSerial instances. + +### AccelStepperFirmata + +AccelStepperFirmata in configurableFirmata wraps [Mike McCauley’s AccelStepper library](http://www.airspayce.com/mikem/arduino/AccelStepper/). Accelstepper gives basic acceleration for individual steppers and support for multiSteppers. multiSteppers allow you to coordinate the movements of a group of steppers so that they arrive at their desired positions simultaneously. + +Requests for stepper movements are made asyncrhonously and movements can be interrupted with a call to stop or by setting a new target position with accelStepperTo or accelStepperMove. + +accelStepper support 2, 3, and 4 wire configurations as well as step + direction controllers like the easyDriver. + +- `board.STEPPER.TYPE` + + Available Stepper or controller types. + + ```js + { + DRIVER: 1, + TWO_WIRE: 2, + THREE_WIRE: 3, + FOUR_WIRE: 4, + } + ``` + +- `board.STEPPER.STEP_SIZE` + + Available step sizes. + + ```js + { + WHOLE: 0, + HALF: 1 + } + ``` + +- `board.STEPPER.DIRECTION` + + Stepper directions. + + ```js + { + CCW: 0, + CW: 1 + } + ``` + + - `board.accelStepperConfig(options)` + + Configure a stepper motor + + ``` + { + deviceNum: 0, // Device number for the stepper (range 0-9) + type: board.STEPPER.TYPE.DRIVER, // (optional) Type of stepper or controller; default is FOUR_WIRE + stepSize: board.STEPPER.STEP_SIZE.HALF, // (optional) Size of step; default is WHOLE + stepPin: 2, // (required if type === DRIVER) The step pin for a step+direction stepper driver + directionPin: 3, // (required if type === DRIVER) The direction pin for a step+direction stepper driver + motorPin1: 2, // (required if type !== DRIVER) Motor control pin 1 + motorPin2: 3, // (required if type !== DRIVER) Motor control pin 2 + motorPin3: 4, // (required if type === THREE_WIRE or FOUR_WIRE) Motor control pin 3 + motorPin4: 5, // (required if type === FOUR_WIRE) Motor control pin 4 + enablePin: 6, // (optional) Enable pin for motor controller pin + invertPins: 0 // (optional) Controls which pins to invert (see table below); default is 0 + } + ``` + + **invertPins** + + The invertPins value is a 5-bit number + + bit 5 |bit 4 |bit 3 |bit 2 |bit 1 + ----------------|----------------|----------------|----------------|---------------- + invert motorPin1|invert motorPin2|invert motorPin3|invert motorPin4|invert enablePin + + Examples: + + 1. Invert motor pins 1, 2, 3 & 4 = 0b11110 = 30 + + 1. Invert motor pins 1, 2 & enablePin = 0b11001 = 25 + + +- `board.accelStepperZero(deviceNum)` + + Set the current stepper position to zero + +- `board.accelStepperStep(deviceNum, steps, callback)` + + Move the stepper motor by a number of steps. Optional callback will be called when motor has finished moving or stop is called + +- `board.accelStepperTo(deviceNum, position, callback)` + + Move the stepper motor to a specified position. Optional callback will be called when motor has finished moving or stop is called + +- `board.accelStepperEnable(deviceNum, enabled)` + + If enabled param is set to false, stepper will be disabled, otherwise stepper will be enabled + +- `board.accelStepperStop(deviceNum)` + + Stop the stepper motor. Triggers a stepper-done event + +- `board.accelStepperReportPosition(deviceNum)` + + Request the current position of the stepper. Triggers a `"stepper-position"` event. + +- `board.accelStepperSpeed(deviceNum, speed)` + + Set the speed of the stepper in steps per second + +- `board.accelStepperAcceleration(deviceNum, acceleration)` + + Set the acceleration and deceleration for the stepper in steps / sec^2 + +- `board.multiStepperConfig(opts)` + + Configure a multStepper group. multiStepper groups allow you to pass an array of targeted positions and have all the steppers move to their targets and arrive at the same time. Note that acceleration cannot be used when moving a multiStepper group. + + ``` + opts = { + groupNum: 0, // Group number for the stepper group (range 0-4) + devices: board.STEPPER.TYPE.DRIVER // [] Array of deviceNum's used in group + } + ``` + +- `board.multiStepperTo(groupNum, positions, callback)` + + Move a goup of steppers to and array of desired positions. Optional callback will be called when group has finished moving or multiStepperStop is called + +- `board.multiStepperStop(groupNum)` + + Stop a group of stepper motors. Triggers a multi-stepper-done event + +### Sysex + +- `board.sysexResponse(commandByte, handler)` + + Allow user code to handle arbitrary sysex responses. `commandByte` must be associated with some message that's expected from the slave device. The `handler` is called with an array of _raw_ data from the slave. Data decoding must be done within the handler itself. + + - Use `Firmata.decode(data)` to extract useful values from the incoming response data. + +- `board.sysexCommand(message)` + + Allow user code to send arbitrary sysex messages. The `message` array is expected to be all necessary bytes between `START_SYSEX` and `END_SYSEX` (non-inclusive). It will be assumed that the data in the message array is already encoded as 2 7-bit bytes LSB first. + + - Use `Firmata.encode(data)` to encode data values into an array of 7-bit byte pairs. + +- `board.clearSysexResponse(commandByte)` + + Allow user to remove sysex response handler such as one previously set through board.sysexResponse(commandByte, handler). + + +### Encode/Decode + +- `Firmata.encode(data)` + + Encode an array of 8-bit data values as an array of two 7-bit byte pairs (each). (LSB first). + +- `Firmata.decode(data)` + + Decode an array of 7-bit byte pairs into a an array of 8-bit data values. (LSB first) + + +## License + +(The MIT License) + +Copyright (c) 2011-2015 Julian Gautier \ +Copyright (c) 2015-2019 The Firmata.js Authors (see AUTHORS.md) + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/repl.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/repl.js new file mode 100755 index 00000000..5fba995e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/repl.js @@ -0,0 +1,14 @@ +#!/usr/bin/env node + +const firmata = require("./lib/firmata"); +const repl = require("repl"); +console.log("Enter USB Port and press enter:"); +process.stdin.resume(); +process.stdin.setEncoding("utf8"); +process.stdin.once("data", (chunk) => { + const port = chunk.replace("\n", ""); + const board = new firmata.Board(port, () => { + console.log(`Successfully Connected to ${port}`); + repl.start("firmata>").context.board = board; + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/common/bootstrap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/common/bootstrap.js new file mode 100644 index 00000000..168acda4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/common/bootstrap.js @@ -0,0 +1,29 @@ +process.env.IS_TEST_MODE = true; + +// Built-in Dependencies +global.cp = require("child_process"); +global.Emitter = require("events"); +global.fs = require("fs"); +global.path = require("path"); + +// Third-Party Dependencies +global.assert = require("should"); +global.browserify = require("browserify"); +global.sinon = require("sinon"); +global.webpack = require("webpack"); + +// Internal Dependencies +global.Encoder7Bit = require("../../../../packages/firmata-io/lib/encoder7bit"); +global.OneWire = require("../../../../packages/firmata-io/lib/onewireutils"); +global.com = require("../../lib/com"); + +global.firmata = require("../../lib/firmata"); + +// Fixtures +global.fixtures = { + unexpected: { + adc: require("../../test/unit/fixtures/unexpected-data-adc"), + i2c: require("../../test/unit/fixtures/unexpected-data-i2c"), + serial: require("../../test/unit/fixtures/unexpected-data-serial"), + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/com.test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/com.test.js new file mode 100644 index 00000000..392a5379 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/com.test.js @@ -0,0 +1,26 @@ +// This test file is primarily for rounding out test coverage +// and gaurding against changes to the "com" stubs. +require("../common/bootstrap"); + +const sandbox = sinon.sandbox.create(); + +describe("com.*", () => { + + const response = { + error: null, + port: { + comName: null + }, + }; + + it("com.SerialPort", done => { + assert.equal(typeof com.SerialPort, "function"); + done(); + }); + + it("com.list", done => { + assert.equal(typeof com.list, "function"); + done(); + }); +}); + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/encoder7bit.test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/encoder7bit.test.js new file mode 100644 index 00000000..28ccade9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/encoder7bit.test.js @@ -0,0 +1,12 @@ +require("../common/bootstrap"); + +describe("Encoder7Bit", () => { + it("must encode and decode via in-memory array", done => { + const input = [40, 219, 239, 33, 5, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0]; + const encoded = Encoder7Bit.to7BitArray(input); + const decoded = Encoder7Bit.from7BitArray(encoded); + + assert.deepEqual(decoded, input); + done(); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/firmata.test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/firmata.test.js new file mode 100644 index 00000000..01e34f9a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/firmata.test.js @@ -0,0 +1,3839 @@ +"use strict"; + +require("../common/bootstrap"); + +// Test specific internals +// +const Board = firmata.Board; + +const ANALOG_MAPPING_QUERY = 0x69; +const ANALOG_MAPPING_RESPONSE = 0x6A; +const ANALOG_MESSAGE = 0xE0; +const CAPABILITY_QUERY = 0x6B; +const CAPABILITY_RESPONSE = 0x6C; +const DIGITAL_MESSAGE = 0x90; +const END_SYSEX = 0xF7; +const EXTENDED_ANALOG = 0x6F; +const I2C_CONFIG = 0x78; +const I2C_REPLY = 0x77; +const I2C_REQUEST = 0x76; +const I2C_READ_MASK = 0x18; // 0b00011000 +const I2C_END_TX_MASK = 0x40; // 0b01000000 +const ONEWIRE_CONFIG_REQUEST = 0x41; +const ONEWIRE_DATA = 0x73; +const ONEWIRE_DELAY_REQUEST_BIT = 0x10; +const ONEWIRE_READ_REPLY = 0x43; +const ONEWIRE_READ_REQUEST_BIT = 0x08; +const ONEWIRE_RESET_REQUEST_BIT = 0x01; +const ONEWIRE_SEARCH_ALARMS_REPLY = 0x45; +const ONEWIRE_SEARCH_ALARMS_REQUEST = 0x44; +const ONEWIRE_SEARCH_REPLY = 0x42; +const ONEWIRE_SEARCH_REQUEST = 0x40; +const ONEWIRE_WITHDATA_REQUEST_BITS = 0x3C; +const ONEWIRE_WRITE_REQUEST_BIT = 0x20; +const PIN_MODE = 0xF4; +const PIN_STATE_QUERY = 0x6D; +const PIN_STATE_RESPONSE = 0x6E; +const PING_READ = 0x75; +const PULSE_IN = 0x74; +const PULSE_OUT = 0x73; +const QUERY_FIRMWARE = 0x79; +const REPORT_ANALOG = 0xC0; +const REPORT_DIGITAL = 0xD0; +const REPORT_VERSION = 0xF9; +const SAMPLING_INTERVAL = 0x7A; +const SERVO_CONFIG = 0x70; +const SERIAL_MESSAGE = 0x60; +const SERIAL_CONFIG = 0x10; +const SERIAL_WRITE = 0x20; +const SERIAL_READ = 0x30; +const SERIAL_REPLY = 0x40; +const SERIAL_CLOSE = 0x50; +const SERIAL_FLUSH = 0x60; +const SERIAL_LISTEN = 0x70; +const START_SYSEX = 0xF0; +const STEPPER = 0x72; +const ACCELSTEPPER = 0x62; +const STRING_DATA = 0x71; +const SYSTEM_RESET = 0xFF; + +// Used by custom sysex tests +const NON_STANDARD_REPLY = 0x11; + +const sandbox = sinon.sandbox.create(); + +describe("Board.requestPort", () => { + + const response = { + error: null, + port: { + comName: null + }, + }; + + beforeEach(() => { + sandbox.stub(com, "list").callsFake(callback => { + process.nextTick(() => { + callback(response.error, [response.port]); + }); + }); + }); + + afterEach(() => { + sandbox.restore(); + response.error = null; + response.port.comName = null; + }); + + it("can identify an acceptable port", done => { + response.port.comName = "/dev/usb.whatever"; + assert.equal(Board.isAcceptablePort(response.port), true); + + response.port.comName = "/dev/ttyACM0"; + assert.equal(Board.isAcceptablePort(response.port), true); + + response.port.comName = "COM0"; + assert.equal(Board.isAcceptablePort(response.port), true); + + done(); + }); + + it("can identify an unacceptable port", done => { + response.port.comName = "/dev/tty.Bluetooth-Incoming-Port"; + assert.equal(Board.isAcceptablePort(response.port), false); + + response.port.comName = "/dev/someotherthing"; + assert.equal(Board.isAcceptablePort(response.port), false); + + done(); + }); + + it("invokes callback with an acceptable port: usb", done => { + response.port.comName = "/dev/usb.whatever"; + + Board.requestPort((error, port) => { + assert.equal(port, response.port); + done(); + }); + }); + + it("invokes callback with an acceptable port: acm", done => { + response.port.comName = "/dev/ttyACM0"; + + Board.requestPort((error, port) => { + assert.equal(port, response.port); + done(); + }); + }); + + it("invokes callback with an acceptable port: com", done => { + response.port.comName = "COM0"; + + Board.requestPort((error, port) => { + assert.equal(port, response.port); + done(); + }); + }); + + it("doesn't call callback with an unacceptable port: Bluetooth-Incoming-Port", done => { + response.port.comName = "/dev/tty.Bluetooth-Incoming-Port"; + + Board.requestPort((error, port) => { + assert.equal(port, null); + assert.equal(error.message, "No Acceptable Port Found"); + done(); + }); + }); + + it("produces an error when there is no Transfer.list method", done => { + com.list = null; + + Board.requestPort((error, port) => { + assert.equal(port, null); + assert.equal(error.message, "No Transport provided"); + done(); + }); + }); + + it("produces an error when there is no Transfer", done => { + Board.test.transport = null; + + Board.requestPort((error, port) => { + assert.equal(port, null); + assert.equal(error.message, "No Transport provided"); + Board.test.restoreTransport(); + done(); + }); + }); +}); + + +describe("Board: data handling", () => { + + let SerialPort; + let transportWrite; + let transport; + let initCallback; + let board; + + beforeEach(() => { + initCallback = sandbox.spy(); + SerialPort = sandbox.spy(com, "SerialPort"); + transportWrite = sandbox.spy(SerialPort.prototype, "write"); + transport = new SerialPort("/path/to/fake/usb"); + board = new Board(transport, initCallback); + }); + + afterEach(() => { + Board.test.i2cActive.clear(); + sandbox.restore(); + }); + + describe("MIDI_RESPONSE", () => { + + it("must discard a bad response that meets 3 byte MIDI_RESPONSE criteria", done => { + transport.emit("data", [NaN, NaN, NaN]); + assert.equal(board.buffer.length, 0); + done(); + }); + + describe("REPORT_VERSION", () => { + + it("must ignore unexpected adc data until REPORT_VERSION", done => { + + const parts = [ + fixtures.unexpected.adc.slice(0, 200), + fixtures.unexpected.adc.slice(200, 400), + fixtures.unexpected.adc.slice(400, 513), + ]; + + const am = sandbox.spy(Board.MIDI_RESPONSE, ANALOG_MESSAGE); + const rv = sandbox.spy(Board.MIDI_RESPONSE, REPORT_VERSION); + + assert.equal(am.callCount, 0); + assert.equal(rv.callCount, 0); + assert.equal(board.buffer.length, 0); + + for (let i = 0; i < parts[0].length; i++) { + transport.emit("data", [parts[0][i]]); + } + + // There are several I2C_REPLY messages in this data, + // none should trigger the I2C_REPLY handler. + assert.equal(am.callCount, 0); + assert.equal(rv.callCount, 0); + + + // The REPORT_VERSION byte is at index 38 + const reportVersionAtByteIndex = 38; + // We won't know it's been seen until all three + // bytes have been read and processed. + let reportVersionCalledAtIndex = -1; + let isVersioned = false; + // This contains a valid REPORT_VERSION message + // + for (let j = 0; j < parts[1].length; j++) { + transport.emit("data", [parts[1][j]]); + + if (rv.callCount === 1 && !isVersioned) { + isVersioned = true; + reportVersionCalledAtIndex = j; + } + } + + // There are several I2C_REPLY messages in this data, + // none should trigger the I2C_REPLY handler. + assert.equal(am.callCount, 0); + + // The REPORT_VERSION was received near the end (index 38) + assert.equal(rv.callCount, 1); + assert.equal(reportVersionCalledAtIndex - 2, reportVersionAtByteIndex); + + + for (let k = 0; k < parts[2].length; k++) { + transport.emit("data", [parts[2][k]]); + + if (rv.callCount === 1 && !isVersioned) { + isVersioned = true; + reportVersionCalledAtIndex = k; + } + } + + // A single I2C_REPLY exists in the third data set + assert.equal(am.callCount, 1); + // No more REPORT_VERSION calls arrived + assert.equal(rv.callCount, 1); + // The buffer is empty + assert.equal(board.buffer.length, 0); + + // Another complete I2C_REPLY arrives... + transport.emit("data", [0xe0, 0x7f, 0x03]); + + assert.equal(am.callCount, 2); + assert.equal(board.buffer.length, 0); + + done(); + }); + + it("must ignore unexpected i2c data until REPORT_VERSION", done => { + + const parts = [ + fixtures.unexpected.i2c.slice(0, 200), + fixtures.unexpected.i2c.slice(200, 400), + fixtures.unexpected.i2c.slice(400, 697), + ]; + + const ir = sandbox.spy(Board.SYSEX_RESPONSE, I2C_REPLY); + const rv = sandbox.spy(Board.MIDI_RESPONSE, REPORT_VERSION); + + assert.equal(ir.callCount, 0); + assert.equal(rv.callCount, 0); + assert.equal(board.buffer.length, 0); + + for (let i = 0; i < parts[0].length; i++) { + transport.emit("data", [parts[0][i]]); + } + + // There are several I2C_REPLY messages in this data, + // none should trigger the I2C_REPLY handler. + assert.equal(ir.callCount, 0); + assert.equal(rv.callCount, 0); + + + // The REPORT_VERSION byte is at index 194 + const reportVersionAtByteIndex = 194; + // We won't know it's been seen until all three + // bytes have been read and processed. + let reportVersionCalledAtIndex = -1; + let isVersioned = false; + // This contains a valid REPORT_VERSION message + // + for (let j = 0; j < parts[1].length; j++) { + transport.emit("data", [parts[1][j]]); + + if (rv.callCount === 1 && !isVersioned) { + isVersioned = true; + reportVersionCalledAtIndex = j; + } + } + + // There are several I2C_REPLY messages in this data, + // none should trigger the I2C_REPLY handler. + assert.equal(ir.callCount, 0); + + // The REPORT_VERSION was received near the end (index 194) + assert.equal(rv.callCount, 1); + assert.equal(reportVersionCalledAtIndex - 2, reportVersionAtByteIndex); + + + for (let k = 0; k < parts[2].length; k++) { + transport.emit("data", [parts[2][k]]); + + if (rv.callCount === 1 && !isVersioned) { + isVersioned = true; + reportVersionCalledAtIndex = k; + } + } + + // A single I2C_REPLY exists in the third data set + assert.equal(ir.callCount, 1); + // No more REPORT_VERSION calls arrived + assert.equal(rv.callCount, 1); + // The buffer is empty + assert.equal(board.buffer.length, 0); + + // Another complete I2C_REPLY arrives... + transport.emit("data", [0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7]); + + assert.equal(ir.callCount, 2); + assert.equal(board.buffer.length, 0); + + done(); + }); + + it("must ignore unexpected serial data until REPORT_VERSION", done => { + + const parts = [ + fixtures.unexpected.serial.slice(0, 200), + fixtures.unexpected.serial.slice(200, 400), + fixtures.unexpected.serial.slice(400, 697), + ]; + + const sr = sandbox.spy(Board.SYSEX_RESPONSE, SERIAL_MESSAGE); + const rv = sandbox.spy(Board.MIDI_RESPONSE, REPORT_VERSION); + + assert.equal(sr.callCount, 0); + assert.equal(rv.callCount, 0); + assert.equal(board.buffer.length, 0); + + for (let i = 0; i < parts[0].length; i++) { + transport.emit("data", [parts[0][i]]); + } + + // There are several SERIAL_MESSAGE messages in this data, + // none should trigger the SERIAL_MESSAGE handler. + assert.equal(sr.callCount, 0); + assert.equal(rv.callCount, 0); + + + // The REPORT_VERSION byte is at index 86 + const reportVersionAtByteIndex = 86; + // We won't know it's been seen until all three + // bytes have been read and processed. + let reportVersionCalledAtIndex = -1; + let isVersioned = false; + // This contains a valid REPORT_VERSION message + // + for (let j = 0; j < parts[1].length; j++) { + transport.emit("data", [parts[1][j]]); + + if (rv.callCount === 1 && !isVersioned) { + isVersioned = true; + reportVersionCalledAtIndex = j; + } + } + + // There are several SERIAL_MESSAGE messages in this data, + // none should trigger the SERIAL_MESSAGE handler. + assert.equal(sr.callCount, 0); + + // The REPORT_VERSION was received near the end (index 86) + assert.equal(rv.callCount, 1); + assert.equal(reportVersionCalledAtIndex - 2, reportVersionAtByteIndex); + + + for (let k = 0; k < parts[2].length; k++) { + transport.emit("data", [parts[2][k]]); + + if (rv.callCount === 1 && !isVersioned) { + isVersioned = true; + reportVersionCalledAtIndex = k; + } + } + + // A single SERIAL_MESSAGE exists in the third data set + assert.equal(sr.callCount, 1); + // No more REPORT_VERSION calls arrived + assert.equal(rv.callCount, 1); + // The buffer is empty + assert.equal(board.buffer.length, 0); + + // Another complete SERIAL_MESSAGE arrives... + transport.emit("data", [0xf0, 0x60, 0x48, 0x19, 0x01, 0xf7]); + + assert.equal(sr.callCount, 2); + assert.equal(board.buffer.length, 0); + + done(); + }); + }); + }); + + describe("SYSEX_RESPONSE", () => { + it("QUERY_FIRMWARE", done => { + const qf = sandbox.spy(Board.SYSEX_RESPONSE, QUERY_FIRMWARE); + + board.versionReceived = true; + + transport.emit("data", [ + START_SYSEX, + QUERY_FIRMWARE, + // Version + 2, + 3, + // Firmware name + // "StandardFirmata" + 83, 0, + 116, 0, + 97, 0, + 110, 0, + 100, 0, + 97, 0, + 114, 0, + 100, 0, + 70, 0, + 105, 0, + 114, 0, + 109, 0, + 97, 0, + 116, 0, + 97, 0, + END_SYSEX + ]); + + assert.equal(qf.callCount, 1); + assert.deepEqual(board.firmware, { + name: "StandardFirmata", + version: { + major: 2, + minor: 3 + } + }); + done(); + }); + + it("CAPABILITY_RESPONSE", done => { + const cr = sandbox.spy(Board.SYSEX_RESPONSE, CAPABILITY_RESPONSE); + + board.versionReceived = true; + + // Received over multiple data events + transport.emit("data", [ + START_SYSEX, + CAPABILITY_RESPONSE, + 0, 1, 1, 1, 4, 14, 127, + 0, 1, 1, 1, 3, 8, 4, 14, 127, + ]); + transport.emit("data", [ + 0, 1, 1, 1, 3, 8, 4, 14, 127, + 0, 1, 1, 1, 4, 14, 127, + END_SYSEX + ]); + + assert.equal(cr.callCount, 1); + done(); + }); + + it("ONEWIRE_DATA", done => { + board.versionReceived = true; + const handler = sandbox.spy(Board.SYSEX_RESPONSE, ONEWIRE_SEARCH_REPLY); + const emit = sandbox.spy(); + const bogusSubCommand = 0xE7; + + // No such sub command exists. This will hit the early return condition + Board.SYSEX_RESPONSE[ONEWIRE_DATA]({ + buffer: [0, 0, bogusSubCommand], + emit, + }); + + Board.SYSEX_RESPONSE[ONEWIRE_DATA]({ + buffer: [0, 0, ONEWIRE_SEARCH_REPLY], + emit, + }); + + assert.equal(handler.callCount, 1); + assert.equal(emit.callCount, 1); + done(); + }); + + it("PIN_STATE_RESPONSE", done => { + const cr = sandbox.spy(Board.SYSEX_RESPONSE, PIN_STATE_RESPONSE); + + board.versionReceived = true; + + transport.emit("data", [ + START_SYSEX, + CAPABILITY_RESPONSE, + 0, 1, 1, 1, 4, 14, 127, + 0, 1, 1, 1, 3, 8, 4, 14, 127, + 0, 1, 1, 1, 3, 8, 4, 14, 127, + 0, 1, 1, 1, 4, 14, 127, + END_SYSEX + ]); + + transport.emit("data", [ + START_SYSEX, + PIN_STATE_RESPONSE, + 0, 1, + END_SYSEX + ]); + + // Garbage data... + transport.emit("data", [ + 1, 1, 1, 1, + ]); + + transport.emit("data", [ + START_SYSEX, + PIN_STATE_RESPONSE, + 1, 1, + END_SYSEX + ]); + + // Garbage data followed by valid data + transport.emit("data", [ + 1, 1, 1, 1, + START_SYSEX, + PIN_STATE_RESPONSE, + 2, 1, + END_SYSEX + ]); + + transport.emit("data", [ + START_SYSEX, + PIN_STATE_RESPONSE, + 3, 1, + END_SYSEX + ]); + + // minimum state response to set pin 0 + transport.emit("data", [ + START_SYSEX, + PIN_STATE_RESPONSE, + // pin, mode, state + 0, 1, 1, + END_SYSEX + ]); + + assert.equal(board.pins[0].mode, 1); + assert.equal(board.pins[0].state, 1); + + // minimum state response to change pin 0 + transport.emit("data", [ + START_SYSEX, + PIN_STATE_RESPONSE, + // pin, mode, state + 0, 2, 2, + END_SYSEX + ]); + + assert.equal(board.pins[0].mode, 2); + assert.equal(board.pins[0].state, 2); + + // > 6 bytes of data: + // + // the 5 byte will be shifted 7 bits to the right + // and or'ed with state. + transport.emit("data", [ + START_SYSEX, + PIN_STATE_RESPONSE, + // pin, mode, state, state 2 + 0, 2, 2, 1, + END_SYSEX + ]); + + assert.equal(board.pins[0].mode, 2); + assert.equal(board.pins[0].state, 130); // 2 | (1 << 7) + + // > 7 bytes of data: + // + // the 6 byte will be shifted 14 bits to the right + // and or'ed with state. + transport.emit("data", [ + START_SYSEX, + PIN_STATE_RESPONSE, + // pin, mode, state, state 2 + 0, 2, 2, 1, 1, + END_SYSEX + ]); + + assert.equal(board.pins[0].mode, 2); + assert.equal(board.pins[0].state, 16514); // 130 | (1 << 14) + + assert.equal(cr.callCount, 8); + done(); + }); + + it("ANALOG_MAPPING_RESPONSE", done => { + const amr = sandbox.spy(Board.SYSEX_RESPONSE, ANALOG_MAPPING_RESPONSE); + + board.versionReceived = true; + + transport.emit("data", [ + START_SYSEX, + CAPABILITY_RESPONSE, + 0, 1, 1, 1, 4, 14, 127, + 0, 1, 1, 1, 3, 8, 4, 14, 127, + 0, 1, 1, 1, 3, 8, 4, 14, 127, + 0, 1, 1, 1, 4, 14, 127, + END_SYSEX + ]); + + transport.emit("data", [ + START_SYSEX, + ANALOG_MAPPING_RESPONSE, + 127, 127, 0, 1, + END_SYSEX + ]); + + // Garbage data... + transport.emit("data", [ + 1, 1, 1, 1, + ]); + + transport.emit("data", [ + START_SYSEX, + ANALOG_MAPPING_RESPONSE, + 0, 1, + ]); + + transport.emit("data", [ + 2, 3, + END_SYSEX + ]); + + // Garbage data followed by valid data + transport.emit("data", [ + 1, 1, 1, 1, + START_SYSEX, + ANALOG_MAPPING_RESPONSE, + 2, 1, + END_SYSEX + ]); + + assert.equal(amr.callCount, 3); + done(); + }); + }); +}); + +describe("Board: initialization", () => { + it("Always returns a Board instance", done => { + assert.equal(new Board("/path/to/fake1") instanceof Board, true); + done(); + }); + + it("Is a subclass of EventEmitter", done => { + assert.equal(new Board("/path/to/fake1") instanceof Emitter, true); + done(); + }); + + it("Default RESOLUTION.* values are null", done => { + const board = new Board("/path/to/fake1"); + + assert.equal(typeof board.RESOLUTION, "object"); + assert.notEqual(board.RESOLUTION, null); + assert.equal(board.RESOLUTION.ADC, null); + assert.equal(board.RESOLUTION.PWM, null); + assert.equal(board.RESOLUTION.DAC, null); + done(); + }); +}); + +describe("Board: lifecycle", function() { + + let SerialPort = sandbox.spy(com, "SerialPort"); + let transportWrite = sandbox.spy(SerialPort.prototype, "write"); + let initCallback = sandbox.spy(error => { + assert.equal(typeof error, "undefined"); + }); + let initNoop = sandbox.spy(); + + let transport = new SerialPort("/path/to/fake/usb"); + let board = new Board(transport, initCallback); + + const context = this; + + beforeEach(() => { + Board.test.i2cActive.clear(); + + transport.spy = sandbox.spy(com, "SerialPort"); + + board._events.length = 0; + }); + + afterEach(() => { + Board.SYSEX_RESPONSE[NON_STANDARD_REPLY] = undefined; + sandbox.restore(); + }); + + describe("Writing To Transport", () => { + + beforeEach(() => { + board.pending = 0; + }); + + afterEach(() => { + board.pending = 0; + }); + + it("increments pending on writeToTransport", done => { + sandbox.spy(board.transport, "write"); + + assert.equal(board.pending, 0); + Board.test.writeToTransport(board, [1, 2, 3, 4]); + assert.equal(board.pending, 1); + + const args = board.transport.write.lastCall.args; + + assert.ok(args[0].equals(Buffer.from([1, 2, 3, 4]))); + + args[1](); + assert.equal(board.pending, 0); + done(); + }); + }); + + + it("has a name", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, initNoop); + + assert.equal(board.name, "Firmata"); + done(); + }); + + // Legacy + it("emits 'connect' event when transport emits 'open'.", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, initNoop); + + board.on("connect", () => done()); + + transport.emit("open"); + }); + + it("forwards 'open' events from transport.", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, initNoop); + + board.on("open", () => done()); + + transport.emit("open"); + }); + + it("emits 'ready' after handshakes complete (skipCapabilities)", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, {skipCapabilities: true}, initNoop); + let oc = 0; + + board.on("open", () => { + assert.ok(true); + oc++; + }); + + board.on("connect", () => { + assert.ok(true); + oc++; + }); + + board.on("ready", function() { + assert.equal(oc, 2); + assert.equal(this.isReady, true); + done(); + }); + + transport.emit("open"); + board.emit("reportversion"); + board.emit("queryfirmware"); + }); + + it("emits 'ready' after handshakes complete", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, initNoop); + let oc = 0; + + board.on("open", () => { + assert.ok(true); + oc++; + }); + + board.on("connect", () => { + assert.ok(true); + oc++; + }); + + board.on("ready", function() { + assert.equal(oc, 2); + assert.equal(this.isReady, true); + done(); + }); + + transport.emit("open"); + board.emit("reportversion"); + board.emit("queryfirmware"); + board.emit("capability-query"); + board.emit("analog-mapping-query"); + }); + + it("reports errors during connect/ready", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, err => { + assert.equal("test error", err); + done(); + }); + + transport.emit("error", "test error"); + }); + + it("forwards 'close' events from transport", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, initNoop); + + board.on("close", done); + + transport.emit("close"); + }); + + it("forwards 'disconnect' events from transport", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, initNoop); + + board.on("disconnect", done); + + // https://github.com/node-serialport/node-serialport/blob/5.0.0/UPGRADE_GUIDE.md#opening-and-closing + transport.emit("close", { + disconnect: true, + disconnected: true, + }); + }); + + it("forwards 'error' event from transport", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, initNoop); + + board.on("error", done); + + board.isReady = true; + transport.emit("error"); + }); + + it("When reportVersion and queryFirmware timeout, call noop", done => { + context.timeout(50); + sandbox.stub(Board.prototype, "reportVersion"); + sandbox.stub(Board.prototype, "queryFirmware"); + const clock = sandbox.useFakeTimers(); + const transport = new SerialPort("/path/to/fake/usb"); + const opt = { + reportVersionTimeout: 1 + }; + const board = new Board(transport, opt, initNoop); + board.versionReceived = false; + + clock.tick(2); + + assert.equal(board.reportVersion.callCount, 1); + assert.equal(board.queryFirmware.callCount, 1); + + assert.equal(board.reportVersion.getCall(0).args[0](), undefined); + assert.equal(board.queryFirmware.getCall(0).args[0](), undefined); + + done(); + }); + + it("sends 'REPORT_VERSION' and 'QUERY_FIRMWARE' if it hasnt received the version within the timeout", done => { + context.timeout(50000); + const transport = new SerialPort("/path/to/fake/usb"); + const opt = { + reportVersionTimeout: 1 + }; + const board = new Board(transport, opt, initNoop); + + // rcheck for report version + transport.once("write", data => { + assert.deepEqual(data, [REPORT_VERSION]); + // check for query firmware + transport.once("write", data => { + assert.deepEqual(data, [240, 121, 247]); + done(); + }); + }); + }); + + it("receives the version on startup", done => { + //"send" report version command back from arduino + transport.emit("data", [REPORT_VERSION]); + transport.emit("data", [0x02]); + + //subscribe to the "data" event to capture the event + transport.once("data", buffer => { + assert.equal(board.version.major, 2); + assert.equal(board.version.minor, 3); + done(); + }); + + //send the last byte of command to get "data" event to fire when the report version function is called + transport.emit("data", [0x03]); + }); + + it("receives the firmware after the version", done => { + board.once("queryfirmware", () => { + assert.equal(board.firmware.version.major, 2); + assert.equal(board.firmware.version.minor, 3); + assert.equal(board.firmware.name, "StandardFirmata"); + done(); + }); + transport.emit("data", [240]); + transport.emit("data", [121]); + transport.emit("data", [2]); + transport.emit("data", [3]); + transport.emit("data", [83]); + transport.emit("data", [0]); + transport.emit("data", [116]); + transport.emit("data", [0]); + transport.emit("data", [97]); + transport.emit("data", [0]); + transport.emit("data", [110]); + transport.emit("data", [0]); + transport.emit("data", [100]); + transport.emit("data", [0]); + transport.emit("data", [97]); + transport.emit("data", [0]); + transport.emit("data", [114]); + transport.emit("data", [0]); + transport.emit("data", [100]); + transport.emit("data", [0]); + transport.emit("data", [70]); + transport.emit("data", [0]); + transport.emit("data", [105]); + transport.emit("data", [0]); + transport.emit("data", [114]); + transport.emit("data", [0]); + transport.emit("data", [109]); + transport.emit("data", [0]); + transport.emit("data", [97]); + transport.emit("data", [0]); + transport.emit("data", [116]); + transport.emit("data", [0]); + transport.emit("data", [97]); + transport.emit("data", [0]); + transport.emit("data", [247]); + }); + + it("Optionally call setSamplingInterval after queryfirmware", done => { + sandbox.spy(Board.prototype, "setSamplingInterval"); + sandbox.spy(SerialPort.prototype, "write"); + + const transport = new SerialPort("/path/to/fake/usb"); + const options = { + skipCapabilities: true, + samplingInterval: 100 + }; + const board = new Board(transport, options, error => { + assert.deepEqual(Array.from(transport.write.lastCall.args[0]), [ + 0xf0, 0x7a, 0x64, 0x00, 0xf7 + ]); + assert.equal(board.setSamplingInterval.callCount, 1); + assert.ok(board.setSamplingInterval.calledWith(100)); + done(); + }); + + // Trigger fake "reportversion" + transport.emit("data", [REPORT_VERSION, 0x02, 0x03]); + + // Trigger fake "queryfirmware" + transport.emit("data", [ + 240, 121, 2, 3, 83, 0, 116, 0, 97, 0, 110, 0, 100, 0, + 97, 0, 114, 0, 100, 0, 70, 0, 105, 0, 114, 0, 109, 0, + 97, 0, 116, 0, 97, 0, 247 + ]); + }); + + it("Does not call setSamplingInterval after queryfirmware by default", done => { + sandbox.spy(Board.prototype, "setSamplingInterval"); + sandbox.spy(SerialPort.prototype, "write"); + + const transport = new SerialPort("/path/to/fake/usb"); + const options = { + skipCapabilities: true, + }; + + const board = new Board(transport, options, () => { + assert.equal(board.setSamplingInterval.callCount, 0); + assert.equal(transport.write.callCount, 0); + done(); + }); + + // Trigger fake "reportversion" + transport.emit("data", [REPORT_VERSION, 0x02, 0x03]); + + // Trigger fake "queryfirmware" + transport.emit("data", [ + 240, 121, 2, 3, 83, 0, 116, 0, 97, 0, 110, 0, 100, 0, + 97, 0, 114, 0, 100, 0, 70, 0, 105, 0, 114, 0, 109, 0, + 97, 0, 116, 0, 97, 0, 247 + ]); + }); + + it("Returns the present samplingInterval", done => { + board.settings.samplingInterval = Infinity; + + assert.equal(board.getSamplingInterval(), Infinity); + done(); + }); + + it("gets the capabilities after the firmware", done => { + //[START_SYSEX, CAPABILITY_QUERY, END_SYSEX] + assert.deepEqual(transport.lastWrite, [START_SYSEX, CAPABILITY_QUERY, END_SYSEX]); + + //report back mock capabilities + //taken from boards.h for arduino uno + transport.emit("data", [START_SYSEX]); + transport.emit("data", [CAPABILITY_RESPONSE]); + + for (let i = 0; i < 20; i++) { + // if "pin" is digital it can be input and output + if (i >= 2 && i <= 19) { + //input is on + transport.emit("data", [0]); + transport.emit("data", [1]); + //output is on + transport.emit("data", [1]); + transport.emit("data", [1]); + } + //if pin is analog + if (i >= 14 && i <= 19) { + transport.emit("data", [0x02]); + transport.emit("data", [10]); + } + //if pin is PWM + if ([3, 5, 6, 10, 11].includes(i)) { + transport.emit("data", [0x03]); + transport.emit("data", [8]); + } + //all pins are servo + if (i >= 2) { + transport.emit("data", [0x04]); + transport.emit("data", [14]); + } + //signal end of command for pin + transport.emit("data", [127]); + } + + //capture the event once to make all pin modes are set correctly + transport.once("data", () => { + assert.equal(board.pins.length, 20); + board.pins.forEach((pin, index) => { + if (index >= 2 && index <= 19) { + + assert.notEqual(pin.supportedModes.indexOf(0), -1); + assert.notEqual(pin.supportedModes.indexOf(1), -1); + } else { + assert.equal(pin.supportedModes.length, 0); + } + if (index >= 14 && index <= 19) { + assert.notEqual(pin.supportedModes.indexOf(0x02), -1); + } else { + assert.equal(pin.supportedModes.indexOf(0x02), -1); + } + if ([3, 5, 6, 10, 11].includes(index)) { + assert.notEqual(pin.supportedModes.indexOf(0x03), -1); + } else { + assert.equal(pin.supportedModes.indexOf(0x03), -1); + } + if (index >= 2) { + assert.notEqual(pin.supportedModes.indexOf(0x04), -1); + } + }); + done(); + }); + //end the sysex message + transport.emit("data", [END_SYSEX]); + }); + + it("capabilities response is an idempotent operation", done => { + + let count = 0; + let i = 0; + + transport.on("data", function data() { + count++; + + // Should be 20 after both responses. + assert.equal(board.pins.length, 20); + + if (count === 2) { + transport.removeListener("data", data); + done(); + } + }); + + // Fake two capabilities responses... + // 1 + transport.emit("data", [START_SYSEX, CAPABILITY_RESPONSE]); + for (i = 0; i < 20; i++) { + transport.emit("data", [0, 1, 1, 1, 127]); + } + transport.emit("data", [END_SYSEX]); + // 2 + transport.emit("data", [START_SYSEX, CAPABILITY_RESPONSE]); + for (i = 0; i < 20; i++) { + transport.emit("data", [0, 1, 1, 1, 127]); + } + transport.emit("data", [END_SYSEX]); + }); + + it("board.RESOLUTION.* properties recieve values via CAPABILITY_RESPONSE", done => { + assert.equal(board.RESOLUTION.ADC, 0x3FF); + assert.equal(board.RESOLUTION.PWM, 0x0FF); + done(); + }); + + + it("querys analog mappings after capabilities", done => { + //[START_SYSEX, ANALOG_MAPPING_QUERY, END_SYSEX] + assert.deepEqual(transport.lastWrite, [START_SYSEX, ANALOG_MAPPING_QUERY, END_SYSEX]); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [ANALOG_MAPPING_RESPONSE]); + for (let i = 0; i < 20; i++) { + if (i >= 14 && i < 20) { + transport.emit("data", [i - 14]); + } else { + transport.emit("data", [127]); + } + } + + transport.once("data", () => { + assert.equal(board.pins[14].analogChannel, 0); + assert.equal(board.pins[15].analogChannel, 1); + assert.equal(board.pins[16].analogChannel, 2); + assert.equal(board.pins[17].analogChannel, 3); + assert.equal(board.pins[18].analogChannel, 4); + assert.equal(board.pins[19].analogChannel, 5); + assert.equal(board.analogPins.length, 6); + assert.equal(board.analogPins[0], 14); + assert.equal(board.analogPins[1], 15); + assert.equal(board.analogPins[2], 16); + assert.equal(board.analogPins[3], 17); + assert.equal(board.analogPins[4], 18); + assert.equal(board.analogPins[5], 19); + done(); + }); + transport.emit("data", [END_SYSEX]); + }); + + it("must be ready", done => { + assert.equal(board.isReady, true); + assert.equal(initCallback.callCount, 1); + done(); + }); + + it("allows setting a valid sampling interval", done => { + const spy = sandbox.spy(board.transport, "write"); + + // Valid sampling interval + board.setSamplingInterval(20); + assert.ok(Buffer.from([0xf0, 0x7a, 0x14, 0x00, 0xf7]).equals(spy.lastCall.args[0])); + + // Invalid sampling interval is constrained to a valid interval + // > 65535 => 65535 + board.setSamplingInterval(65540); + assert.ok(Buffer.from([0xf0, 0x7a, 0x7f, 0x7f, 0xf7]).equals(spy.lastCall.args[0])); + + // Invalid sampling interval is constrained to a valid interval + // < 10 => 10 + board.setSamplingInterval(0); + assert.ok(Buffer.from([0xf0, 0x7a, 0x0a, 0x00, 0xf7]).equals(spy.lastCall.args[0])); + + spy.restore(); + done(); + }); + + it("must be able to reset (SYSTEM_RESET)", done => { + board.reset(); + assert.equal(transport.lastWrite[0], SYSTEM_RESET); + done(); + }); + + it("must be able to set pin mode on digital pin (INPUT)", done => { + board.pinMode(2, board.MODES.INPUT); + assert.equal(transport.lastWrite[0], PIN_MODE); + assert.equal(transport.lastWrite[1], 2); + assert.equal(transport.lastWrite[2], board.MODES.INPUT); + assert.equal(board.pins[2].mode, board.MODES.INPUT); + done(); + }); + + it("must be able to read value of digital pin (INPUT)", done => { + let counter = 0; + const order = [1, 0, 1, 0]; + board.digitalRead(2, value => { + if (value === 1) { + counter++; + } + if (value === 0) { + counter++; + } + if (order[0] === value) { + order.shift(); + } + if (counter === 4) { + assert.equal(order.length, 0); + done(); + } + }); + + // Digital reporting turned on... + assert.deepEqual(transport.lastWrite, [208, 1]); + + // Single Byte + transport.emit("data", [DIGITAL_MESSAGE]); + transport.emit("data", [4 % 128]); + transport.emit("data", [4 >> 7]); + + transport.emit("data", [DIGITAL_MESSAGE]); + transport.emit("data", [0x00]); + transport.emit("data", [0x00]); + + // Multi Byte + transport.emit("data", [DIGITAL_MESSAGE, 4 % 128, 4 >> 7]); + transport.emit("data", [DIGITAL_MESSAGE, 0x00, 0x00]); + }); + + it("must be able to set pin mode on digital pin (PULLUP)", done => { + board.pinMode(3, board.MODES.PULLUP); + assert.equal(transport.lastWrite[0], PIN_MODE); + assert.equal(transport.lastWrite[1], 3); + assert.equal(transport.lastWrite[2], board.MODES.PULLUP); + assert.equal(board.pins[3].mode, board.MODES.PULLUP); + done(); + }); + + it("must be able to read value of digital pin (PULLUP)", done => { + let counter = 0; + const order = [1, 0, 1, 0]; + board.pinMode(2, board.MODES.PULLUP); + board.digitalRead(2, value => { + if (value === 1) { + counter++; + } + if (value === 0) { + counter++; + } + if (order[0] === value) { + order.shift(); + } + if (counter === 4) { + assert.equal(order.length, 0); + done(); + } + }); + + // Digital reporting turned on... + assert.deepEqual(transport.lastWrite, [208, 1]); + + // Single Byte + transport.emit("data", [DIGITAL_MESSAGE]); + transport.emit("data", [4 % 128]); + transport.emit("data", [4 >> 7]); + + transport.emit("data", [DIGITAL_MESSAGE]); + transport.emit("data", [0x00]); + transport.emit("data", [0x00]); + + // Multi Byte + transport.emit("data", [DIGITAL_MESSAGE, 4 % 128, 4 >> 7]); + transport.emit("data", [DIGITAL_MESSAGE, 0x00, 0x00]); + }); + + it("must be able to set mode on analog pins", done => { + board.pinMode(board.analogPins[0], board.MODES.INPUT); + assert.equal(transport.lastWrite[0], PIN_MODE); + assert.equal(transport.lastWrite[1], board.analogPins[0]); + assert.equal(transport.lastWrite[2], board.MODES.INPUT); + done(); + }); + + it("must be able to read value of analog pin", done => { + let counter = 0; + const order = [1023, 0, 1023, 0]; + board.analogRead(1, value => { + if (value === 1023) { + counter++; + } + if (value === 0) { + counter++; + } + if (order[0] === value) { + order.shift(); + } + if (counter === 4) { + assert.equal(order.length, 0); + done(); + } + }); + + // Analog reporting turned on... + assert.deepEqual(transport.lastWrite, [193, 1]); + + // Single Byte + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF)]); + transport.emit("data", [1023 % 128]); + transport.emit("data", [1023 >> 7]); + + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF)]); + transport.emit("data", [0 % 128]); + transport.emit("data", [0 >> 7]); + + // Multi Byte + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF), 1023 % 128, 1023 >> 7]); + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF), 0 % 128, 0 >> 7]); + }); + + + it("must be able to read value of analog pin on a board that skipped capabilities check", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, {skipCapabilities: true, analogPins: [14,15,16,17,18,19]}, initNoop); + + board.on("ready", () => { + let counter = 0; + let order = [1023, 0, 1023, 0]; + board.analogRead(1, value => { + if (value === 1023) { + counter++; + } + if (value === 0) { + counter++; + } + if (order[0] === value) { + order.shift(); + } + if (counter === 4) { + assert.equal(order.length, 0); + done(); + } + }); + + // Analog reporting turned on... + assert.deepEqual(transport.lastWrite, [193, 1]); + + // Single Byte + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF)]); + transport.emit("data", [1023 % 128]); + transport.emit("data", [1023 >> 7]); + + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF)]); + transport.emit("data", [0 % 128]); + transport.emit("data", [0 >> 7]); + + // Multi Byte + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF), 1023 % 128, 1023 >> 7]); + transport.emit("data", [ANALOG_MESSAGE | (1 & 0xF), 0 % 128, 0 >> 7]); + }); + + transport.emit("open"); + board.emit("reportversion"); + board.emit("queryfirmware"); + }); + + it("must be able to write a value to a digital output", done => { + + const write = sandbox.stub(SerialPort.prototype, "write"); + const expect = [ + [ 144, 1, 0 ], + [ 144, 2, 0 ], + [ 144, 4, 0 ], + [ 144, 8, 0 ], + [ 144, 16, 0 ], + [ 144, 32, 0 ], + [ 144, 64, 0 ], + [ 144, 0, 1 ], + [ 145, 1, 0 ], + [ 145, 2, 0 ], + [ 145, 4, 0 ], + [ 145, 8, 0 ], + [ 145, 16, 0 ], + [ 145, 32, 0 ], + [ 145, 64, 0 ], + [ 145, 0, 1 ], + [ 146, 1, 0 ], + [ 146, 2, 0 ], + [ 146, 4, 0 ], + [ 146, 8, 0 ], + ]; + + for (let i = 0; i < board.pins.length; i++) { + board.digitalWrite(i, board.HIGH); + assert.deepEqual(Array.from(write.lastCall.args[0]), expect[i]); + + board.digitalWrite(i, board.LOW); + } + done(); + }); + + it("must be able to enqueue a series of digital writes and then update the ports on demand", done => { + + const write = sandbox.stub(SerialPort.prototype, "write"); + const expect = [ + [ 144, 20, 0 ], + [ 145, 5, 0 ] + ]; + + board.digitalWrite(2, board.HIGH, true); + board.digitalWrite(3, board.LOW, true); + board.digitalWrite(4, board.HIGH, true); + board.digitalWrite(5, board.LOW, true); + + // Should not call write yet + assert.equal(write.callCount, 0); + + board.digitalWrite(8, board.HIGH, true); + board.digitalWrite(9, board.LOW, true); + board.digitalWrite(10, board.HIGH, true); + board.digitalWrite(11, board.LOW, true); + + // Should not call write yet + assert.equal(write.callCount, 0); + + // Write the ports + board.flushDigitalPorts(); + + // We are updating both ports 0 and 1 + assert.equal(write.callCount, 2); + + assert.deepEqual(Array.from(write.getCall(0).args[0]), expect[0]); + assert.deepEqual(Array.from(write.getCall(1).args[0]), expect[1]); + + // Reset pins to low + [2, 4, 8, 10].forEach(pin => { + board.digitalWrite(pin, board.LOW); + }); + + done(); + }); + + it("must be able to track digital writes via ports property", done => { + for (let i = 0; i < board.pins.length; i++) { + board.pins[i].mode = board.MODES.UNKNOWN; + } + + const write = sandbox.stub(SerialPort.prototype, "write"); + const expecting = [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 1, + 2, + 4, + 8, + ]; + + for (let j = 0; j < board.pins.length; j++) { + const port = j >> 3; + const expect = expecting[j]; + + board.digitalWrite(j, board.HIGH); + + assert.equal(board.ports[port], expect); + + board.digitalWrite(j, board.LOW); + } + done(); + }); + + it("must be able to write and read to a digital port without garbling state", done => { + /* This test will change the value of port 1 as follows: + + 0b00000001 + 0b00000000 + 0b00000001 + 0b00000101 + 0b00000000 + 0b00000101 + 0b00000001 + */ + + const write = sandbox.stub(SerialPort.prototype, "write"); + const state = 0; + let calls = 0; + const expecting = [ + // 10 is high, 9 is low, 8 is high + "101", + // 10 is low, 9 is low, 8 is low + "0", + // 10 is high, 9 is low, 8 is (still) low + "100", + // 10 is low, 9 is low, 8 is high + "1" + ]; + + for (let i = 0; i < board.pins.length; i++) { + board.pins[i].mode = board.MODES.UNKNOWN; + } + + for (let j = 0; j < board.ports.length; j++) { + board.ports[j] = 0; + } + + // No Pins are high on this port + assert.equal(board.ports[1].toString(2), "0"); + + + board.pinMode(8, board.MODES.OUTPUT); + board.pinMode(10, board.MODES.INPUT); + board.digitalRead(10, data => { + assert.equal(board.ports[1].toString(2), expecting[calls++]); + + if (calls === 4) { + done(); + } + }); + /* + Pin Byte high Value + 8 0b00000001 1 + 9 0b00000010 2 + 10 0b00000100 4 + 11 0b00001000 8 + 12 0b00010000 16 + 13 0b00100000 32 + 14 0b01000000 64 + 15 0b10000000 128 + */ + + // Pin 8 is bit 0 of port byte 1, it should now be ON + board.digitalWrite(8, 1); + assert.equal(board.ports[1].toString(2), "1"); + + + // Pin 8 is bit 0 of port byte 1, it should now be OFF + board.digitalWrite(8, 0); + assert.equal(board.ports[1].toString(2), "0"); + + + // Pin 8 is bit 0 of port byte 1, it should now be ON + board.digitalWrite(8, 1); + assert.equal(board.ports[1].toString(2), "1"); + + + transport.emit("data", [DIGITAL_MESSAGE | 1, 4, 0]); + board.digitalWrite(8, 0); + // Pin 10 is bit 2 (value = 4) of port byte 1, it should now be ON + // Pin 8 is bit 0 (value = 1) of port byte 1, it should now be OFF + assert.equal(board.ports[1].toString(2), "100"); + + + transport.emit("data", [DIGITAL_MESSAGE | 1, 0, 0]); + // Pin 10 is bit 2 (value = 4) of port byte 1, it should now be OFF + // Pin 8 is bit 0 (value = 1) of port byte 1, it should now be OFF + assert.equal(board.ports[1].toString(2), "0"); + + + // Pin 10 is bit 2 (value = 4) of port byte 1, it should now be ON + // Pin 8 is bit 0 (value = 1) of port byte 1, it should now be ON + transport.emit("data", [DIGITAL_MESSAGE | 1, 4, 0]); + board.digitalWrite(8, 1); + assert.equal(board.ports[1].toString(2), "101"); + + + // Pin 10 is bit 2 (value = 4) of port byte 1, it should now be OFF + // Pin 8 is bit 0 (value = 1) of port byte 1, it should now be ON + transport.emit("data", [DIGITAL_MESSAGE | 1, 0, 0]); + board.digitalWrite(8, 1); + assert.equal(board.ports[1].toString(2), "1"); + }); + + it("must be able to write a value to a digital output to a board that skipped capabilities check", done => { + const transport = new SerialPort("/path/to/fake/usb"); + const board = new Board(transport, {skipCapabilities: true}, initNoop); + + board.on("ready", () => { + board.digitalWrite(3, board.HIGH); + assert.deepEqual(transport.lastWrite, [DIGITAL_MESSAGE, 8, 0]); + + board.digitalWrite(3, board.LOW); + assert.deepEqual(transport.lastWrite, [DIGITAL_MESSAGE, 0, 0]); + done(); + }); + + transport.emit("open"); + board.emit("reportversion"); + board.emit("queryfirmware"); + + }); + + it("must be able to write a value to an analog pin being used as a digital output", done => { + board.ports[2] = 0; + + // `DIGITAL_MESSAGE | 2` => Digital Message on Port 2 + // + board.digitalWrite(19, board.HIGH); + assert.deepEqual(transport.lastWrite, [DIGITAL_MESSAGE | 2, 8, 0]); + + board.digitalWrite(19, board.LOW); + assert.deepEqual(transport.lastWrite, [DIGITAL_MESSAGE | 2, 0, 0]); + + done(); + }); + + it("analogWrite is an alias of pwmWrite (for backward compatibility)", done => { + assert.ok(board.pwmWrite === board.analogWrite); + done(); + }); + + it("must be able to write a PWM value to a capable output", done => { + board.pwmWrite(board.analogPins[1], 1023); + assert.deepEqual(transport.lastWrite, [ANALOG_MESSAGE | board.analogPins[1], 127, 7]); + + board.pwmWrite(board.analogPins[1], 0); + assert.deepEqual(transport.lastWrite, [ANALOG_MESSAGE | board.analogPins[1], 0, 0]); + done(); + }); + + it("must be able to write a value to an extended analog output", done => { + const length = board.pins.length; + + board.pins[46] = { + supportedModes: [0, 1, 4], + mode: 4, + value: 0, + report: 1, + analogChannel: 127 + }; + + board.pwmWrite(46, 180); + assert.deepEqual(transport.lastWrite, [ + START_SYSEX, + EXTENDED_ANALOG, + 46, 52, 1, + END_SYSEX, + ]); + + board.pwmWrite(46, 0); + assert.deepEqual(transport.lastWrite, [ + START_SYSEX, + EXTENDED_ANALOG, + 46, 0, 0, + END_SYSEX, + ]); + + board.pwmWrite(46, 0x00004001); + assert.deepEqual(transport.lastWrite, [ + START_SYSEX, + EXTENDED_ANALOG, + 46, 1, 0, 1, + END_SYSEX, + ]); + + board.pwmWrite(46, 0x00200001); + assert.deepEqual(transport.lastWrite, [ + START_SYSEX, + EXTENDED_ANALOG, + 46, 1, 0, 0, 1, + END_SYSEX, + ]); + + board.pwmWrite(46, 0x10000001); + assert.deepEqual(transport.lastWrite, [ + START_SYSEX, + EXTENDED_ANALOG, + 46, 1, 0, 0, 0, 1, + END_SYSEX, + ]); + + // Restore to original length + board.pins.length = length; + + done(); + }); + + + it("must be able to send a string", done => { + const bytes = Buffer.from("test string", "utf8"); + const length = bytes.length; + board.sendString(bytes); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], STRING_DATA); + for (let i = 0; i < length; i++) { + assert.equal(transport.lastWrite[i * 2 + 2], bytes[i] & 0x7F); + assert.equal(transport.lastWrite[i * 2 + 3], (bytes[i + 1] >> 7) & 0x7F); + } + assert.equal(transport.lastWrite[length * 2 + 2], 0); + assert.equal(transport.lastWrite[length * 2 + 3], 0); + assert.equal(transport.lastWrite[length * 2 + 4], END_SYSEX); + done(); + }); + it("must emit a string event", done => { + board.on("string", string => { + assert.equal(string, "test string"); + done(); + }); + transport.emit("data", [START_SYSEX]); + transport.emit("data", [STRING_DATA]); + const bytes = Buffer.from("test string", "utf8"); + Array.prototype.forEach.call(bytes, (value, index) => { + transport.emit("data", [value]); + }); + transport.emit("data", [END_SYSEX]); + }); + + it("can query pin state", done => { + board.queryPinState(2, () => { + assert.equal(board.pins[2].state, 1024); + done(); + }); + assert.deepEqual(transport.lastWrite, [START_SYSEX, PIN_STATE_QUERY, 2, END_SYSEX]); + transport.emit("data", [START_SYSEX]); + transport.emit("data", [PIN_STATE_RESPONSE]); + transport.emit("data", [2]); + transport.emit("data", [board.MODES.INPUT]); + transport.emit("data", [0x00]); + transport.emit("data", [0x08]); + transport.emit("data", [END_SYSEX]); + }); + + it("must ignore invalid query firmware data", done => { + board.once("queryfirmware", () => { + assert.equal(board.firmware.version.major, 2); + assert.equal(board.firmware.version.minor, 5); + assert.equal(board.firmware.name.substring(0, 3), "Sta"); + done(); + }); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [QUERY_FIRMWARE]); + transport.emit("data", [0x02]); + transport.emit("data", [0x05]); + transport.emit("data", [0x53]); + transport.emit("data", [0x00]); + transport.emit("data", [0x74]); + transport.emit("data", [0x00]); + transport.emit("data", [0x61]); + transport.emit("data", [0x00]); + transport.emit("data", [0x6e]); //<<< + transport.emit("data", [0x61]); //<<< + transport.emit("data", [0x00]); + transport.emit("data", [0x2e]); + transport.emit("data", [0x00]); + transport.emit("data", [0x69]); + transport.emit("data", [0x00]); + transport.emit("data", [0x6e]); + transport.emit("data", [0x00]); + transport.emit("data", [0x6f]); + transport.emit("data", [0x1]); + transport.emit("data", [0x00]); + transport.emit("data", [END_SYSEX]); + }); + + it("cannot pingRead without PingFirmata", done => { + assert.throws(() => { + board.pingRead({ + pin: 3 + }); + }); + + done(); + }); + + it("can send a pingRead without a timeout and without a pulse out", done => { + board.pins[3].supportedModes.push(PING_READ); + board.pingRead({ + pin: 3, + value: board.HIGH, + timeout: 1000000 + }, duration => { + assert.equal(duration, 0); + done(); + }); + assert.deepEqual(transport.lastWrite, [START_SYSEX, PING_READ, 3, board.HIGH, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 66, 0, 64, 0, END_SYSEX]); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [PING_READ]); + transport.emit("data", [3]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + }); + + it("can send a pingRead with a timeout and a pulse out", done => { + board.pingRead({ + pin: 3, + value: board.HIGH, + pulseOut: 5, + timeout: 1000000 + }, duration => { + assert.equal(duration, 1000000); + done(); + }); + assert.deepEqual(transport.lastWrite, [START_SYSEX, PING_READ, 3, board.HIGH, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 15, 0, 66, 0, 64, 0, END_SYSEX]); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [PING_READ]); + transport.emit("data", [3]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [15]); + transport.emit("data", [0]); + transport.emit("data", [66]); + transport.emit("data", [0]); + transport.emit("data", [64]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + }); + it("can send a pingRead with a pulse out and without a timeout ", done => { + board.pingRead({ + pin: 3, + value: board.HIGH, + pulseOut: 5 + }, duration => { + assert.equal(duration, 1000000); + done(); + }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PING_READ); + assert.equal(transport.lastWrite[2], 3); + assert.equal(transport.lastWrite[3], board.HIGH); + assert.equal(transport.lastWrite[4], 0); + assert.equal(transport.lastWrite[5], 0); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 0); + assert.equal(transport.lastWrite[8], 0); + assert.equal(transport.lastWrite[9], 0); + assert.equal(transport.lastWrite[10], 5); + assert.equal(transport.lastWrite[11], 0); + assert.equal(transport.lastWrite[12], 0); + assert.equal(transport.lastWrite[13], 0); + assert.equal(transport.lastWrite[14], 15); + assert.equal(transport.lastWrite[15], 0); + assert.equal(transport.lastWrite[16], 66); + assert.equal(transport.lastWrite[17], 0); + assert.equal(transport.lastWrite[18], 64); + assert.equal(transport.lastWrite[19], 0); + assert.equal(transport.lastWrite[20], END_SYSEX); + transport.emit("data", [START_SYSEX]); + transport.emit("data", [PING_READ]); + transport.emit("data", [3]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [15]); + transport.emit("data", [0]); + transport.emit("data", [66]); + transport.emit("data", [0]); + transport.emit("data", [64]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + }); + + it("can send a stepper config for a driver configuration", done => { + board.stepperConfig(0, board.STEPPER.TYPE.DRIVER, 200, 2, 3); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], STEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], board.STEPPER.TYPE.DRIVER); + assert.equal(transport.lastWrite[5], 200 & 0x7F); + assert.equal(transport.lastWrite[6], (200 >> 7) & 0x7F); + assert.equal(transport.lastWrite[7], 2); + assert.equal(transport.lastWrite[8], 3); + assert.equal(transport.lastWrite[9], END_SYSEX); + done(); + }); + + it("can send a stepper config for a two wire configuration", done => { + board.stepperConfig(0, board.STEPPER.TYPE.TWO_WIRE, 200, 2, 3); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], STEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], board.STEPPER.TYPE.TWO_WIRE); + assert.equal(transport.lastWrite[5], 200 & 0x7F); + assert.equal(transport.lastWrite[6], (200 >> 7) & 0x7F); + assert.equal(transport.lastWrite[7], 2); + assert.equal(transport.lastWrite[8], 3); + assert.equal(transport.lastWrite[9], END_SYSEX); + done(); + }); + + it("can send a stepper config for a four wire configuration", done => { + board.stepperConfig(0, board.STEPPER.TYPE.FOUR_WIRE, 200, 2, 3, 4, 5); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], STEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], board.STEPPER.TYPE.FOUR_WIRE); + assert.equal(transport.lastWrite[5], 200 & 0x7F); + assert.equal(transport.lastWrite[6], (200 >> 7) & 0x7F); + assert.equal(transport.lastWrite[7], 2); + assert.equal(transport.lastWrite[8], 3); + assert.equal(transport.lastWrite[9], 4); + assert.equal(transport.lastWrite[10], 5); + assert.equal(transport.lastWrite[11], END_SYSEX); + done(); + }); + + it("can send a stepper move without acceleration or deceleration", done => { + board.stepperStep(2, board.STEPPER.DIRECTION.CCW, 10000, 2000, complete => { + assert.equal(complete, true); + done(); + }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], STEPPER); + assert.equal(transport.lastWrite[2], 1); + assert.equal(transport.lastWrite[3], 2); + assert.equal(transport.lastWrite[4], board.STEPPER.DIRECTION.CCW); + assert.equal(transport.lastWrite[5], 10000 & 0x7F); + assert.equal(transport.lastWrite[6], (10000 >> 7) & 0x7F); + assert.equal(transport.lastWrite[7], (10000 >> 14) & 0x7F); + assert.equal(transport.lastWrite[8], 2000 & 0x7F); + assert.equal(transport.lastWrite[9], (2000 >> 7) & 0x7F); + assert.equal(transport.lastWrite[9], (2000 >> 7) & 0x7F); + assert.equal(transport.lastWrite[10], END_SYSEX); + transport.emit("data", [START_SYSEX]); + transport.emit("data", [STEPPER]); + transport.emit("data", [2]); + transport.emit("data", [END_SYSEX]); + }); + + it("can send a stepper move with acceleration and deceleration", done => { + board.stepperStep(3, board.STEPPER.DIRECTION.CCW, 10000, 2000, 3000, 8000, complete => { + assert.equal(complete, true); + done(); + }); + + const message = [START_SYSEX, STEPPER, 1, 3, board.STEPPER.DIRECTION.CCW, 10000 & 0x7F, (10000 >> 7) & 0x7F, (10000 >> 14) & 0x7F, 2000 & 0x7F, (2000 >> 7) & 0x7F, 3000 & 0x7F, (3000 >> 7) & 0x7F, 8000 & 0x7F, (8000 >> 7) & 0x7F, END_SYSEX]; + assert.deepEqual(transport.lastWrite, message); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [STEPPER]); + transport.emit("data", [3]); + transport.emit("data", [END_SYSEX]); + }); + + it("can send a accelStepper config for a driver configuration with enable and invert", done => { + board.accelStepperConfig({ deviceNum: 0, type: board.STEPPER.TYPE.DRIVER, stepPin: 5, directionPin: 6, enablePin: 2, invertPins: [2] }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0x11); + assert.equal(transport.lastWrite[5], 5); + assert.equal(transport.lastWrite[6], 6); + assert.equal(transport.lastWrite[7], 2); + assert.equal(transport.lastWrite[8], 16); + assert.equal(transport.lastWrite[9], END_SYSEX); + done(); + }); + + it("can send a accelStepper config for a two wire configuration", done => { + board.accelStepperConfig({ deviceNum: 0, type: board.STEPPER.TYPE.TWO_WIRE, motorPin1: 5, motorPin2: 6, invertPins: [5, 6] }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0x20); + assert.equal(transport.lastWrite[5], 5); + assert.equal(transport.lastWrite[6], 6); + assert.equal(transport.lastWrite[7], 3); + assert.equal(transport.lastWrite[8], END_SYSEX); + done(); + }); + + it("can send a accelStepper config for a four wire configuration", done => { + board.accelStepperConfig({ deviceNum: 0, type: board.STEPPER.TYPE.FOUR_WIRE, motorPin1: 5, motorPin2: 6, motorPin3: 3, motorPin4: 4 }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0x40); + assert.equal(transport.lastWrite[5], 5); + assert.equal(transport.lastWrite[6], 6); + assert.equal(transport.lastWrite[7], 3); + assert.equal(transport.lastWrite[8], 4); + assert.equal(transport.lastWrite[9], 0); + assert.equal(transport.lastWrite[10], END_SYSEX); + done(); + }); + + it("can send a accelStepper config for a four wire, half step configuration", done => { + board.accelStepperConfig({ deviceNum: 0, type: board.STEPPER.TYPE.FOUR_WIRE, stepSize: board.STEPPER.STEP_SIZE.HALF, motorPin1: 5, motorPin2: 6, motorPin3: 3, motorPin4: 4 }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0x42); + assert.equal(transport.lastWrite[5], 5); + assert.equal(transport.lastWrite[6], 6); + assert.equal(transport.lastWrite[7], 3); + assert.equal(transport.lastWrite[8], 4); + assert.equal(transport.lastWrite[9], 0); + assert.equal(transport.lastWrite[10], END_SYSEX); + done(); + }); + + it("can send a accelStepper config with four wire and whole step as defaults", done => { + board.accelStepperConfig({ deviceNum: 0, motorPin1: 5, motorPin2: 6, motorPin3: 3, motorPin4: 4 }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0x40); + assert.equal(transport.lastWrite[5], 5); + assert.equal(transport.lastWrite[6], 6); + assert.equal(transport.lastWrite[7], 3); + assert.equal(transport.lastWrite[8], 4); + assert.equal(transport.lastWrite[9], 0); + assert.equal(transport.lastWrite[10], END_SYSEX); + done(); + }); + + it("can send a accelStepper config for a default four wire configuration with inverted motor and enable pins", done => { + board.accelStepperConfig({ deviceNum: 0, motorPin1: 5, motorPin2: 6, motorPin3: 3, motorPin4: 4, enablePin: 2, invertPins: [2, 3, 4, 5, 6] }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0x41); + assert.equal(transport.lastWrite[5], 5); + assert.equal(transport.lastWrite[6], 6); + assert.equal(transport.lastWrite[7], 3); + assert.equal(transport.lastWrite[8], 4); + assert.equal(transport.lastWrite[9], 2); + assert.equal(transport.lastWrite[10], 31); + assert.equal(transport.lastWrite[11], END_SYSEX); + done(); + }); + + it("can send a accelStepper step", done => { + board.accelStepperStep(0, 12345, value => { + assert.equal(value, 12345); + done(); + }); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 2); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 57); + assert.equal(transport.lastWrite[5], 96); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 0); + assert.equal(transport.lastWrite[8], 0); + assert.equal(transport.lastWrite[9], END_SYSEX); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [ACCELSTEPPER]); + transport.emit("data", [0x0A]); + transport.emit("data", [0]); + transport.emit("data", [57]); + transport.emit("data", [96]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + }); + + it("can send a accelStepper step w/o a callback", done => { + board.accelStepperStep(0, 12345); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 2); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 57); + assert.equal(transport.lastWrite[5], 96); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 0); + assert.equal(transport.lastWrite[8], 0); + assert.equal(transport.lastWrite[9], END_SYSEX); + + done(); + }); + + it("can send a accelStepper zero", done => { + board.accelStepperZero(0); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 1); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], END_SYSEX); + done(); + }); + + it("can send a accelStepper enable", done => { + board.accelStepperEnable(0, true); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 4); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 1); + assert.equal(transport.lastWrite[5], END_SYSEX); + done(); + }); + + it("can send a accelStepper enable using default value", done => { + board.accelStepperEnable(0); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 4); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 1); + assert.equal(transport.lastWrite[5], END_SYSEX); + done(); + }); + + it("can can send a accelStepper disable", done => { + board.accelStepperEnable(0, false); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 4); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0); + assert.equal(transport.lastWrite[5], END_SYSEX); + done(); + }); + + it("can send a accelStepper move to as specified position", done => { + board.accelStepperTo(0, 2000, value => { + assert.equal(value, 2000); + done(); + }); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 3); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 80); + assert.equal(transport.lastWrite[5], 15); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 0); + assert.equal(transport.lastWrite[8], 0); + assert.equal(transport.lastWrite[9], END_SYSEX); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [ACCELSTEPPER]); + transport.emit("data", [0x0A]); + transport.emit("data", [0]); + transport.emit("data", [80]); + transport.emit("data", [15]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + }); + + it("can send a accelStepper move to as specified position w/o a callback", done => { + board.accelStepperTo(0, 2000); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 3); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 80); + assert.equal(transport.lastWrite[5], 15); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 0); + assert.equal(transport.lastWrite[8], 0); + assert.equal(transport.lastWrite[9], END_SYSEX); + + done(); + }); + + it("can send an accelStepper stop", done => { + + board.accelStepperStop(0); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 5); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], END_SYSEX); + + done(); + + }); + + it("can send a accelStepper reportPosition", done => { + board.accelStepperReportPosition(0, () => done()); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 6); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], END_SYSEX); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [ACCELSTEPPER]); + transport.emit("data", [0x06]); + transport.emit("data", [0]); + transport.emit("data", [80]); + transport.emit("data", [15]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + + }); + + it("can send a accelStepper set speed", done => { + board.accelStepperSpeed(0, 123.4); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 9); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 82); + assert.equal(transport.lastWrite[5], 9); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 40); + assert.equal(transport.lastWrite[8], END_SYSEX); + done(); + }); + + it("can send a accelStepper set acceleration", done => { + board.accelStepperAcceleration(0, 199.9); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 8); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 24); + assert.equal(transport.lastWrite[5], 1); + assert.equal(transport.lastWrite[6], 122); + assert.equal(transport.lastWrite[7], 28); + assert.equal(transport.lastWrite[8], END_SYSEX); + done(); + }); + + it("can configure a multiStepper", done => { + board.multiStepperConfig({ groupNum: 0, devices: [0, 1, 2] }); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0x20); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 0); + assert.equal(transport.lastWrite[5], 1); + assert.equal(transport.lastWrite[6], 2); + assert.equal(transport.lastWrite[7], END_SYSEX); + done(); + }); + + it("can send a multiStepper stop", done => { + board.multiStepperStop(0); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0x23); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], END_SYSEX); + done(); + }); + + it("multiStepperStop(-1)", done => { + assert.throws(() => { + board.multiStepperStop(-1); + }); + done(); + }); + + it("multiStepperStop(6)", done => { + assert.throws(() => { + board.multiStepperStop(6); + }); + done(); + }); + + it("can send a multiStepper to", done => { + board.multiStepperTo(0, [200, 400, 600], () => done()); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0x21); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 72); + assert.equal(transport.lastWrite[5], 1); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 0); + assert.equal(transport.lastWrite[8], 0); + assert.equal(transport.lastWrite[9], 16); + assert.equal(transport.lastWrite[10], 3); + assert.equal(transport.lastWrite[11], 0); + assert.equal(transport.lastWrite[12], 0); + assert.equal(transport.lastWrite[13], 0); + assert.equal(transport.lastWrite[14], 88); + assert.equal(transport.lastWrite[15], 4); + assert.equal(transport.lastWrite[16], 0); + assert.equal(transport.lastWrite[17], 0); + assert.equal(transport.lastWrite[18], 0); + assert.equal(transport.lastWrite[19], END_SYSEX); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [ACCELSTEPPER]); + transport.emit("data", [0x24]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + + }); + + it("can send a multiStepper to w/o a callback", done => { + board.multiStepperTo(0, [200, 400, 600]); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], ACCELSTEPPER); + assert.equal(transport.lastWrite[2], 0x21); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], 72); + assert.equal(transport.lastWrite[5], 1); + assert.equal(transport.lastWrite[6], 0); + assert.equal(transport.lastWrite[7], 0); + assert.equal(transport.lastWrite[8], 0); + assert.equal(transport.lastWrite[9], 16); + assert.equal(transport.lastWrite[10], 3); + assert.equal(transport.lastWrite[11], 0); + assert.equal(transport.lastWrite[12], 0); + assert.equal(transport.lastWrite[13], 0); + assert.equal(transport.lastWrite[14], 88); + assert.equal(transport.lastWrite[15], 4); + assert.equal(transport.lastWrite[16], 0); + assert.equal(transport.lastWrite[17], 0); + assert.equal(transport.lastWrite[18], 0); + assert.equal(transport.lastWrite[19], END_SYSEX); + + done(); + + }); + + it("multiStepperTo(-1)", done => { + assert.throws(() => { + board.multiStepperTo(-1); + }); + done(); + }); + + it("multiStepperTo(6)", done => { + assert.throws(() => { + board.multiStepperStop(6); + }); + done(); + }); + + it("can receive a stepper position", done => { + board.once("stepper-position-0", value => { + assert.equal(value, 1234); + done(); + }); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [ACCELSTEPPER]); + transport.emit("data", [0x06]); + transport.emit("data", [0]); + transport.emit("data", [82]); + transport.emit("data", [9]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + + }); + + it("can receive a multStepper done", done => { + board.once("multi-stepper-done-0", () => done()); + + transport.emit("data", [START_SYSEX]); + transport.emit("data", [ACCELSTEPPER]); + transport.emit("data", [0x24]); + transport.emit("data", [0]); + transport.emit("data", [END_SYSEX]); + + }); + + it("must be able to send a 1-wire config with parasitic power enabled", done => { + board.sendOneWireConfig(1, true); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_CONFIG_REQUEST); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + assert.equal(transport.lastWrite[4], ONEWIRE_RESET_REQUEST_BIT); + assert.equal(transport.lastWrite[5], END_SYSEX); + done(); + }); + it("must be able to send a 1-wire config with parasitic power disabled", done => { + board.sendOneWireConfig(1, false); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_CONFIG_REQUEST); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + assert.equal(transport.lastWrite[4], 0x00); + assert.equal(transport.lastWrite[5], END_SYSEX); + done(); + }); + it("must be able to send a 1-wire search request and recieve a reply", done => { + board.sendOneWireSearch(1, (error, devices) => { + assert.equal(devices.length, 1); + done(); + }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_SEARCH_REQUEST); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + assert.equal(transport.lastWrite[4], END_SYSEX); + + transport.emit("data", [START_SYSEX, PULSE_OUT, ONEWIRE_SEARCH_REPLY, ONEWIRE_RESET_REQUEST_BIT, 0x28, 0x36, 0x3F, 0x0F, 0x52, 0x00, 0x00, 0x00, 0x5D, 0x00, END_SYSEX]); + }); + it("must be able to send a 1-wire search alarm request and recieve a reply", done => { + board.sendOneWireAlarmsSearch(1, (error, devices) => { + assert.equal(devices.length, 1); + done(); + }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_SEARCH_ALARMS_REQUEST); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + assert.equal(transport.lastWrite[4], END_SYSEX); + + transport.emit("data", [START_SYSEX, PULSE_OUT, ONEWIRE_SEARCH_ALARMS_REPLY, ONEWIRE_RESET_REQUEST_BIT, 0x28, 0x36, 0x3F, 0x0F, 0x52, 0x00, 0x00, 0x00, 0x5D, 0x00, END_SYSEX]); + }); + it("must be able to send a 1-wire write read", done => { + sandbox.spy(board, Board.test.symbols.SYM_sendOneWireRequest); + board.sendOneWireRead(1, 1, 1, () => {}); + + board[Board.test.symbols.SYM_sendOneWireRequest].lastCall.args[8](); + done(); + }); + it("must be able to send a 1-wire reset request", done => { + board.sendOneWireReset(1); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_RESET_REQUEST_BIT); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + + done(); + }); + it("must be able to send a 1-wire delay request", done => { + const delay = 1000; + + board.sendOneWireDelay(1, delay); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_WITHDATA_REQUEST_BITS); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + + // decode delay from request + const request = Encoder7Bit.from7BitArray(transport.lastWrite.slice(4, transport.lastWrite.length - 1)); + const sentDelay = request[12] | (request[13] << 8) | (request[14] << 12) | request[15] << 24; + assert.equal(sentDelay, delay); + + done(); + }); + + it("must be able to send a 1-wire write request", done => { + const device = [40, 219, 239, 33, 5, 0, 0, 93]; + const data = 0x33; + + board.sendOneWireWrite(1, device, data); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_WITHDATA_REQUEST_BITS); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + + // decode delay from request + const request = Encoder7Bit.from7BitArray(transport.lastWrite.slice(4, transport.lastWrite.length - 1)); + + // should select the passed device + assert.equal(request[0], device[0]); + assert.equal(request[1], device[1]); + assert.equal(request[2], device[2]); + assert.equal(request[3], device[3]); + assert.equal(request[4], device[4]); + assert.equal(request[5], device[5]); + assert.equal(request[6], device[6]); + assert.equal(request[7], device[7]); + + // and send the passed data + assert.equal(request[16], data); + + done(); + }); + + it("must be able to send a 1-wire write request (Array)", done => { + const device = [40, 219, 239, 33, 5, 0, 0, 93]; + const data = 0x33; + + board.sendOneWireWrite(1, device, [data]); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_WITHDATA_REQUEST_BITS); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + + // decode delay from request + const request = Encoder7Bit.from7BitArray(transport.lastWrite.slice(4, transport.lastWrite.length - 1)); + + // should select the passed device + assert.equal(request[0], device[0]); + assert.equal(request[1], device[1]); + assert.equal(request[2], device[2]); + assert.equal(request[3], device[3]); + assert.equal(request[4], device[4]); + assert.equal(request[5], device[5]); + assert.equal(request[6], device[6]); + assert.equal(request[7], device[7]); + + // and send the passed data + assert.equal(request[16], data); + + done(); + }); + it("must be able to send a 1-wire write and read request and recieve a reply", done => { + const device = [40, 219, 239, 33, 5, 0, 0, 93]; + const data = 0x33; + const output = [ONEWIRE_RESET_REQUEST_BIT, 0x02]; + + board.sendOneWireWriteAndRead(1, device, data, 2, (error, received) => { + + assert.deepEqual(received, output); + done(); + }); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_WITHDATA_REQUEST_BITS); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + + // decode delay from request + const request = Encoder7Bit.from7BitArray(transport.lastWrite.slice(4, transport.lastWrite.length - 1)); + + // should select the passed device + assert.equal(request[0], device[0]); + assert.equal(request[1], device[1]); + assert.equal(request[2], device[2]); + assert.equal(request[3], device[3]); + assert.equal(request[4], device[4]); + assert.equal(request[5], device[5]); + assert.equal(request[6], device[6]); + assert.equal(request[7], device[7]); + + // and send the passed data + assert.equal(request[16], data); + + const dataSentFromBoard = []; + + // respond with the same correlation id + dataSentFromBoard[0] = request[10]; + dataSentFromBoard[1] = request[11]; + + // data "read" from the 1-wire device + dataSentFromBoard[2] = output[0]; + dataSentFromBoard[3] = output[1]; + + transport.emit("data", [START_SYSEX, PULSE_OUT, ONEWIRE_READ_REPLY, ONEWIRE_RESET_REQUEST_BIT].concat(Encoder7Bit.to7BitArray(dataSentFromBoard)).concat([END_SYSEX])); + }); + + it("must be able to send a 1-wire write and read request and recieve a reply (array)", done => { + const device = [40, 219, 239, 33, 5, 0, 0, 93]; + const data = 0x33; + const output = [ONEWIRE_RESET_REQUEST_BIT, 0x02]; + + board.sendOneWireWriteAndRead(1, device, [data], 2, (error, received) => { + assert.deepEqual(received, output); + done(); + }); + + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], PULSE_OUT); + assert.equal(transport.lastWrite[2], ONEWIRE_WITHDATA_REQUEST_BITS); + assert.equal(transport.lastWrite[3], ONEWIRE_RESET_REQUEST_BIT); + + // decode delay from request + const request = Encoder7Bit.from7BitArray(transport.lastWrite.slice(4, transport.lastWrite.length - 1)); + + // should select the passed device + assert.equal(request[0], device[0]); + assert.equal(request[1], device[1]); + assert.equal(request[2], device[2]); + assert.equal(request[3], device[3]); + assert.equal(request[4], device[4]); + assert.equal(request[5], device[5]); + assert.equal(request[6], device[6]); + assert.equal(request[7], device[7]); + + // and send the passed data + assert.equal(request[16], data); + + const dataSentFromBoard = []; + + // respond with the same correlation id + dataSentFromBoard[0] = request[10]; + dataSentFromBoard[1] = request[11]; + + // data "read" from the 1-wire device + dataSentFromBoard[2] = output[0]; + dataSentFromBoard[3] = output[1]; + + transport.emit("data", [START_SYSEX, PULSE_OUT, ONEWIRE_READ_REPLY, ONEWIRE_RESET_REQUEST_BIT].concat(Encoder7Bit.to7BitArray(dataSentFromBoard)).concat([END_SYSEX])); + }); + + describe("Servo", () => { + it("can configure a servo pwm range", done => { + board.servoConfig(3, 1000, 2000); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], SERVO_CONFIG); + assert.equal(transport.lastWrite[2], 0x03); + + assert.equal(transport.lastWrite[3], 1000 & 0x7F); + assert.equal(transport.lastWrite[4], (1000 >> 7) & 0x7F); + + assert.equal(transport.lastWrite[5], 2000 & 0x7F); + assert.equal(transport.lastWrite[6], (2000 >> 7) & 0x7F); + done(); + }); + + it("can configure a servo pwm range, with object", done => { + board.servoConfig({ + pin: 3, + min: 1000, + max: 2000, + }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[1], SERVO_CONFIG); + assert.equal(transport.lastWrite[2], 0x03); + + assert.equal(transport.lastWrite[3], 1000 & 0x7F); + assert.equal(transport.lastWrite[4], (1000 >> 7) & 0x7F); + + assert.equal(transport.lastWrite[5], 2000 & 0x7F); + assert.equal(transport.lastWrite[6], (2000 >> 7) & 0x7F); + done(); + }); + + it("will throw if servoConfig is missing any parameters", done => { + + assert.throws(() => { + board.servoConfig(); + }); + + assert.throws(() => { + board.servoConfig(3, 1000); + }); + + assert.throws(() => { + board.servoConfig({ + min: 1000, + max: 2000, + }); + }); + + assert.throws(() => { + board.servoConfig({ + pin: 3, + max: 2000, + }); + }); + + assert.throws(() => { + board.servoConfig({ + pin: 3, + min: 1000, + }); + }); + + assert.throws(() => { + board.servoConfig({}); + }); + done(); + }); + + it("calls analogWrite with arguments", done => { + const aw = sandbox.stub(board, "analogWrite"); + + board.servoWrite(9, 180); + assert.deepEqual(aw.lastCall.args, [9, 180]); + + board.servoWrite(9, 600); + assert.deepEqual(aw.lastCall.args, [9, 600]); + done(); + }); + + }); + + describe("I2C", () => { + + it("throws if i2c not enabled", done => { + + assert.throws(() => { + board.i2cRead(1, 1, initNoop); + }); + assert.throws(() => { + board.i2cReadOnce(1, 1, initNoop); + }); + assert.throws(() => { + board.i2cWrite(1, [1, 2, 3]); + }); + assert.throws(() => { + board.i2cWriteReg(1, 1, 1); + }); + done(); + }); + + it("must be able to send an i2c config (empty)", done => { + board.i2cConfig(); + assert.deepEqual(transport.lastWrite, [START_SYSEX, I2C_CONFIG, 0, 0, END_SYSEX]); + done(); + }); + + it("calls i2cConfig (sendI2CConfig)", done => { + + const ic = sandbox.stub(board, "i2cConfig"); + + board.sendI2CConfig(); + assert.equal(ic.callCount, 1); + done(); + }); + + it("must be able to send an i2c config (number)", done => { + board.i2cConfig(1); + assert.deepEqual(transport.lastWrite, [START_SYSEX, I2C_CONFIG, 1 & 0xFF, (1 >> 8) & 0xFF, END_SYSEX]); + done(); + }); + + it("must be able to send an i2c config (object with delay property)", done => { + board.i2cConfig({ delay: 1 }); + assert.deepEqual(transport.lastWrite, [START_SYSEX, I2C_CONFIG, 1 & 0xFF, (1 >> 8) & 0xFF, END_SYSEX]); + done(); + }); + + it("must be able to send an i2c request", done => { + board.i2cConfig(1); + board.sendI2CWriteRequest(0x68, [1, 2, 3]); + const request = [START_SYSEX, I2C_REQUEST, 0x68, 0 << 3, 1 & 0x7F, (1 >> 7) & 0x7F, 2 & 0x7F, (2 >> 7) & 0x7F, 3 & 0x7F, (3 >> 7) & 0x7F, END_SYSEX]; + assert.deepEqual(transport.lastWrite, request); + done(); + }); + + it("must be able to receive an i2c reply", done => { + const handler = sandbox.spy(() => {}); + board.i2cConfig(1); + board.sendI2CReadRequest(0x68, 4, handler); + assert.deepEqual(transport.lastWrite, [START_SYSEX, I2C_REQUEST, 0x68, 1 << 3, 4 & 0x7F, (4 >> 7) & 0x7F, END_SYSEX]); + + // Start + transport.emit("data", [START_SYSEX]); + // Reply + transport.emit("data", [I2C_REPLY]); + // Address + transport.emit("data", [0x68 % 128]); + transport.emit("data", [0x68 >> 7]); + // Register + transport.emit("data", [0]); + transport.emit("data", [0]); + // Data 0 + transport.emit("data", [1 & 0x7F]); + transport.emit("data", [(1 >> 7) & 0x7F]); + // Data 1 + transport.emit("data", [2 & 0x7F]); + transport.emit("data", [(2 >> 7) & 0x7F]); + // Data 2 + transport.emit("data", [3 & 0x7F]); + transport.emit("data", [(3 >> 7) & 0x7F]); + // Data 3 + transport.emit("data", [4 & 0x7F]); + transport.emit("data", [(4 >> 7) & 0x7F]); + // End + transport.emit("data", [END_SYSEX]); + + assert.equal(handler.callCount, 1); + assert.deepEqual(handler.getCall(0).args[0], [1, 2, 3, 4]); + done(); + }); + + it("does not create default settings for an i2c peripheral, when call to i2cConfig does not include address", done => { + board.i2cConfig(); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { delay: 0 }); + done(); + }); + + it("creates default settings for an i2c peripheral, with call to i2cConfig that includes address", done => { + board.i2cConfig({ + address: 0x00 + }); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: true, + }, + delay: 0, + }); + done(); + }); + + it("creates default settings for an i2c peripheral, without call to i2cConfig for that peripheral (i2cWrite)", done => { + // This has to be called no matter what, + // but it might be the case that it's called once in a program, + // where there are several different i2c peripherals. + board.i2cConfig(); + + board.i2cWrite(0x00, [0x01, 0x02]); + board.i2cWrite(0x05, [0x06, 0x07]); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: true, + }, + 5: { + stopTX: true, + }, + delay: 0, + }); + done(); + }); + + it("creates default settings for an i2c peripheral, without call to i2cConfig for that peripheral (i2cWriteReg)", done => { + // This has to be called no matter what, + // but it might be the case that it's called once in a program, + // where there are several different i2c peripherals. + board.i2cConfig(); + + board.i2cWriteReg(0x00, 0x01, 0x02); + board.i2cWriteReg(0x05, 0x06, 0x07); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: true, + }, + 5: { + stopTX: true, + }, + delay: 0, + }); + done(); + }); + + it("creates default settings for an i2c peripheral, without call to i2cConfig for that peripheral (i2cRead w/ Register)", done => { + // This has to be called no matter what, + // but it might be the case that it's called once in a program, + // where there are several different i2c peripherals. + board.i2cConfig(); + + board.i2cRead(0x00, 0x01, 1, initNoop); + board.i2cRead(0x05, 0x06, 1, initNoop); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: true, + }, + 5: { + stopTX: true, + }, + delay: 0, + }); + done(); + }); + + it("creates default settings for an i2c peripheral, without call to i2cConfig for that peripheral (i2cRead w/o Register)", done => { + // This has to be called no matter what, + // but it might be the case that it's called once in a program, + // where there are several different i2c peripherals. + board.i2cConfig(); + + board.i2cRead(0x00, 1, initNoop); + board.i2cRead(0x05, 1, initNoop); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: true, + }, + 5: { + stopTX: true, + }, + delay: 0, + }); + done(); + }); + + it("does nothing when i2cStop()", done => { + board.i2cConfig(); + + assert.equal(transportWrite.callCount, 0); + + board.i2cRead(0x00, 1, initNoop); + board.i2cStop(); + assert.equal(transportWrite.callCount, 0); + done(); + }); + + it("can stop a continuous read with i2cStop(address)", done => { + board.i2cConfig(); + + Object.keys(board._events).forEach(event => { + if (event.startsWith("I2C-reply-")) { + board.removeAllListeners(event); + } + }); + const removeAllListeners = sandbox.spy(board, "removeAllListeners"); + + + board.i2cRead(0x00, 1, initNoop); + board.i2cStop(0x00); + + assert.equal(transport.lastWrite[2], 0x00); + assert.equal(transport.lastWrite[3], board.I2C_MODES.STOP_READING << 3); + assert.equal(transport.lastWrite[4], END_SYSEX); + assert.equal(removeAllListeners.callCount, 1); + done(); + }); + + it("can stop a continuous read with i2cStop({address})", done => { + board.i2cConfig(); + + Object.keys(board._events).forEach(event => { + if (event.startsWith("I2C-reply-")) { + board.removeAllListeners(event); + } + }); + const removeAllListeners = sandbox.spy(board, "removeAllListeners"); + + board.i2cRead(0x00, 1, initNoop); + board.i2cStop({ address: 0x00 }); + + assert.equal(transport.lastWrite[2], 0x00); + assert.equal(transport.lastWrite[3], board.I2C_MODES.STOP_READING << 3); + assert.equal(transport.lastWrite[4], END_SYSEX); + assert.equal(removeAllListeners.callCount, 1); + done(); + }); + + + it("creates default settings for an i2c peripheral, without call to i2cConfig for that peripheral (i2cReadOnce w/ Register)", done => { + // This has to be called no matter what, + // but it might be the case that it's called once in a program, + // where there are several different i2c peripherals. + board.i2cConfig(); + + board.i2cReadOnce(0x00, 0x01, 1, initNoop); + board.i2cReadOnce(0x05, 0x06, 1, initNoop); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: true, + }, + 5: { + stopTX: true, + }, + delay: 0, + }); + done(); + }); + + it("creates default settings for an i2c peripheral, without call to i2cConfig for that peripheral (i2cReadOnce w/o Register)", done => { + // This has to be called no matter what, + // but it might be the case that it's called once in a program, + // where there are several different i2c peripherals. + board.i2cConfig(); + + board.i2cReadOnce(0x00, 1, initNoop); + board.i2cReadOnce(0x05, 1, initNoop); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: true, + }, + 5: { + stopTX: true, + }, + delay: 0, + }); + done(); + }); + + it("can store arbitrary settings for an i2c peripheral via i2cConfig", done => { + board.i2cConfig({ + address: 0x00, + settings: { + whatever: true, + } + }); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + delay: 0, + 0: { + stopTX: true, + whatever: true, + } + }); + done(); + }); + + it("allows stored i2c peripheral settings to be reconfigured via i2cConfig", done => { + board.i2cConfig({ + address: 0x00, + settings: { + stopTX: false, + } + }); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: false, + }, + delay: 0, + }); + + board.i2cConfig({ + address: 0x00, + settings: { + stopTX: true, + } + }); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + delay: 0, + 0: { + stopTX: true, + } + }); + done(); + }); + + it("allows an i2c peripheral's stopTX to be overridden", done => { + // var spy = sandbox.spy(board.transport, "write"); + const mask = 0x48; // 01001000 + + board.i2cConfig({ + address: 0x00, + settings: { + stopTX: true, + } + }); + + board.i2cReadOnce(0x00, 0x01, 1, initNoop); + + assert.deepEqual(transport.lastWrite, [240, 118, 0, 8, 1, 0, 1, 0, 247]); + + board.i2cConfig({ + address: 0x00, + settings: { + stopTX: false, + } + }); + + assert.deepEqual(Board.test.i2cPeripheralSettings(board), { + 0: { + stopTX: false, + }, + delay: 0, + }); + + board.i2cReadOnce(0x00, 0x01, 1, initNoop); + + assert.deepEqual(transport.lastWrite, [240, 118, 0, 72, 1, 0, 1, 0, 247]); + + board.i2cRead(0x00, 0x01, 1, initNoop); + + assert.deepEqual(transport.lastWrite, [240, 118, 0, 80, 1, 0, 1, 0, 247]); + done(); + }); + + it("has an i2cWrite method, that writes a data array", done => { + const spy = sandbox.spy(transport, "write"); + + board.i2cConfig(0); + board.i2cWrite(0x53, [1, 2]); + + assert.deepEqual(transport.lastWrite, [240, 118, 83, 0, 1, 0, 2, 0, 247]); + assert.equal(spy.callCount, 2); + spy.restore(); + done(); + }); + + it("has an i2cWrite method, that writes a byte", done => { + const spy = sandbox.spy(transport, "write"); + + board.i2cConfig(0); + board.i2cWrite(0x53, 1); + + assert.deepEqual(transport.lastWrite, [240, 118, 83, 0, 1, 0, 247]); + assert.equal(spy.callCount, 2); + spy.restore(); + done(); + }); + + it("has an i2cWrite method, that writes a data array to a register", done => { + const spy = sandbox.spy(transport, "write"); + + board.i2cConfig(0); + board.i2cWrite(0x53, 0xB2, [1, 2]); + + assert.deepEqual(transport.lastWrite, [240, 118, 83, 0, 50, 1, 1, 0, 2, 0, 247]); + assert.equal(spy.callCount, 2); + spy.restore(); + done(); + }); + + it("has an i2cWrite method, that writes a data byte to a register", done => { + const spy = sandbox.spy(transport, "write"); + + board.i2cConfig(0); + board.i2cWrite(0x53, 0xB2, 1); + + assert.deepEqual(transport.lastWrite, [240, 118, 83, 0, 50, 1, 1, 0, 247]); + assert.equal(spy.callCount, 2); + spy.restore(); + done(); + }); + + it("has an i2cWriteReg method, that writes a data byte to a register", done => { + const spy = sandbox.spy(transport, "write"); + + board.i2cConfig(0); + board.i2cWrite(0x53, 0xB2, 1); + + assert.deepEqual(transport.lastWrite, [240, 118, 83, 0, 50, 1, 1, 0, 247]); + assert.equal(spy.callCount, 2); + spy.restore(); + done(); + }); + + it("has an i2cRead method that reads continuously", done => { + const handler = sandbox.spy(() => {}); + + board.i2cConfig(0); + board.i2cRead(0x53, 0x04, handler); + + for (let i = 0; i < 5; i++) { + transport.emit("data", [ + START_SYSEX, I2C_REPLY, 83, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX + ]); + } + + assert.equal(handler.callCount, 5); + assert.equal(handler.getCall(0).args[0].length, 4); + assert.equal(handler.getCall(1).args[0].length, 4); + assert.equal(handler.getCall(2).args[0].length, 4); + assert.equal(handler.getCall(3).args[0].length, 4); + assert.equal(handler.getCall(4).args[0].length, 4); + done(); + }); + + it("has an i2cRead method that reads a register continuously", done => { + const handler = sandbox.spy(() => {}); + + board.i2cConfig(0); + board.i2cRead(0x53, 0xB2, 0x04, handler); + + for (let i = 0; i < 5; i++) { + transport.emit("data", [ + START_SYSEX, I2C_REPLY, 83, 0, 50, 1, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX + ]); + } + + assert.equal(handler.callCount, 5); + assert.equal(handler.getCall(0).args[0].length, 4); + assert.equal(handler.getCall(1).args[0].length, 4); + assert.equal(handler.getCall(2).args[0].length, 4); + assert.equal(handler.getCall(3).args[0].length, 4); + assert.equal(handler.getCall(4).args[0].length, 4); + done(); + }); + + + it("has an i2cRead method that reads continuously", done => { + const handler = sandbox.spy(() => {}); + + board.i2cConfig(0); + board.i2cRead(0x53, 0x04, handler); + + for (let i = 0; i < 5; i++) { + transport.emit("data", [ + START_SYSEX, I2C_REPLY, 83, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX + ]); + } + + assert.equal(handler.callCount, 5); + assert.equal(handler.getCall(0).args[0].length, 4); + assert.equal(handler.getCall(1).args[0].length, 4); + assert.equal(handler.getCall(2).args[0].length, 4); + assert.equal(handler.getCall(3).args[0].length, 4); + assert.equal(handler.getCall(4).args[0].length, 4); + done(); + }); + + it("has an i2cReadOnce method that reads a register once", done => { + const handler = sandbox.spy(() => {}); + + board.i2cConfig(0); + board.i2cReadOnce(0x53, 0xB2, 0x04, handler); + + // Emit data enough times to potentially break it. + for (let i = 0; i < 5; i++) { + transport.emit("data", [ + START_SYSEX, I2C_REPLY, 83, 0, 50, 1, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX + ]); + } + + assert.equal(handler.callCount, 1); + assert.equal(handler.getCall(0).args[0].length, 4); + done(); + }); + + it("has an i2cReadOnce method that reads a register once", done => { + const handler = sandbox.spy(() => {}); + + board.i2cConfig(0); + board.i2cReadOnce(0x53, 0xB2, 0x04, handler); + + // Emit data enough times to potentially break it. + for (let i = 0; i < 5; i++) { + transport.emit("data", [ + START_SYSEX, I2C_REPLY, 83, 0, 50, 1, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX + ]); + } + + assert.equal(handler.callCount, 1); + assert.equal(handler.getCall(0).args[0].length, 4); + done(); + }); + }); + + describe("Serial", () => { + + it("has a SERIAL_MODES property", done => { + + assert.deepEqual(board.SERIAL_MODES, { + CONTINUOUS_READ: 0x00, + STOP_READING: 0x01, + }); + done(); + }); + + it("has a SERIAL_PORT_IDs property", done => { + + assert.deepEqual(board.SERIAL_PORT_IDs, { + HW_SERIAL0: 0x00, + HW_SERIAL1: 0x01, + HW_SERIAL2: 0x02, + HW_SERIAL3: 0x03, + SW_SERIAL0: 0x08, + SW_SERIAL1: 0x09, + SW_SERIAL2: 0x10, + SW_SERIAL3: 0x11, + DEFAULT: 0x08, + }); + done(); + }); + + // SERIAL_PIN_TYPES is currently unused. + // it("has a SERIAL_PIN_TYPES property", done => { + + // assert.deepEqual(board.SERIAL_PORT_IDs, { + // RES_RX0: 0x00, + // RES_TX0: 0x01, + // RES_RX1: 0x02, + // RES_TX1: 0x03, + // RES_RX2: 0x04, + // RES_TX2: 0x05, + // RES_RX3: 0x06, + // RES_TX3: 0x07, + // }); + + // done(); + // }); + + it("can configure a software serial port", done => { + board.serialConfig({ + portId: 0x08, + baud: 9600, + rxPin: 10, + txPin: 11 + }); + assert.equal(transport.lastWrite[0], START_SYSEX); + assert.equal(transport.lastWrite[2], SERIAL_CONFIG | 0x08); + + assert.equal(transport.lastWrite[3], 9600 & 0x007F); + assert.equal(transport.lastWrite[4], (9600 >> 7) & 0x007F); + assert.equal(transport.lastWrite[5], (9600 >> 14) & 0x007F); + + assert.equal(transport.lastWrite[6], 10); + assert.equal(transport.lastWrite[7], 11); + + assert.equal(transport.lastWrite[8], END_SYSEX); + done(); + }); + + it("can configure a hardware serial port", done => { + board.serialConfig({ + portId: 0x01, + buad: 57600 + }); + assert.equal(transport.lastWrite[2], SERIAL_CONFIG | 0x01); + + assert.equal(transport.lastWrite[3], 57600 & 0x007F); + assert.equal(transport.lastWrite[4], (57600 >> 7) & 0x007F); + assert.equal(transport.lastWrite[5], (57600 >> 14) & 0x007F); + + assert.equal(transport.lastWrite[6], END_SYSEX); + done(); + }); + + it("throws an error if no serial port id is passed", done => { + assert.throws(() => { + board.serialConfig({ + buad: 57600 + }); + }); + done(); + }); + + it("throws an error if both RX and TX pins are not defined when using Software Serial", done => { + // throw error if both pins are not specified + assert.throws(() => { + board.serialConfig({ + portId: 8, + buad: 57600 + }); + }); + + // throw error if only one serial pin is specified + assert.throws(() => { + board.serialConfig({ + portId: 8, + buad: 57600, + txPin: 0 + }); + }); + done(); + }); + + it("can write a single byte to a serial port", done => { + board.serialWrite(0x08, [1]); + assert.equal(transport.lastWrite[2], SERIAL_WRITE | 0x08); + assert.equal(transport.lastWrite[3], 1 & 0x7F); + assert.equal(transport.lastWrite[4], (1 >> 7) & 0x7F); + assert.equal(transport.lastWrite[5], END_SYSEX); + done(); + }); + + it("can write a byte array to a serial port", done => { + board.serialWrite(0x08, [252, 253, 254]); + assert.equal(transport.lastWrite[2], SERIAL_WRITE | 0x08); + assert.equal(transport.lastWrite[3], 252 & 0x7F); + assert.equal(transport.lastWrite[4], (252 >> 7) & 0x7F); + assert.equal(transport.lastWrite[7], 254 & 0x7F); + assert.equal(transport.lastWrite[8], (254 >> 7) & 0x7F); + assert.equal(transport.lastWrite[9], END_SYSEX); + done(); + }); + + it("has a serialRead method that sets READ_CONTINUOUS mode", done => { + const handler = sandbox.spy(() => {}); + board.serialRead(0x08, handler); + + assert.equal(transport.lastWrite[2], SERIAL_READ | 0x08); + assert.equal(transport.lastWrite[3], 0); + assert.equal(transport.lastWrite[4], END_SYSEX); + done(); + }); + + it("has a serialRead method that reads continuously", done => { + const inBytes = [ + 242 & 0x7F, + (242 >> 7) & 0x7F, + 243 & 0x7F, + (243 >> 7) & 0x7F, + 244 & 0x7F, + (244 >> 7) & 0x7F, + ]; + + const handler = sandbox.spy(() => {}); + board.serialRead(0x08, handler); + + for (let i = 0; i < 5; i++) { + transport.emit("data", [ + START_SYSEX, + SERIAL_MESSAGE, + SERIAL_REPLY | 0x08, + inBytes[0], + inBytes[1], + inBytes[2], + inBytes[3], + inBytes[4], + inBytes[5], + END_SYSEX + ]); + } + + assert.equal(handler.callCount, 5); + assert.equal(handler.getCall(0).args[0].length, 3); + assert.equal(handler.getCall(0).args[0][0], 242); + assert.equal(handler.getCall(0).args[0][2], 244); + assert.equal(handler.getCall(1).args[0].length, 3); + assert.equal(handler.getCall(2).args[0].length, 3); + assert.equal(handler.getCall(3).args[0].length, 3); + assert.equal(handler.getCall(4).args[0].length, 3); + done(); + }); + + it("serialRead accepts an optional maxBytesToRead parameter", done => { + const maxBytesToRead = 4; + const handler = sandbox.spy(() => {}); + board.serialRead(0x08, maxBytesToRead, handler); + + assert.equal(transport.lastWrite[4], 4); + assert.equal(transport.lastWrite[5], 0); + assert.equal(transport.lastWrite[6], END_SYSEX); + done(); + }); + + it("has a serialStop method that sets STOP_READING mode", done => { + board.serialStop(0x08); + assert.equal(transport.lastWrite[2], SERIAL_READ | 0x08); + assert.equal(transport.lastWrite[3], 1); + assert.equal(transport.lastWrite[4], END_SYSEX); + done(); + }); + + it("has a serialClose method", done => { + board.serialClose(0x09); + assert.equal(transport.lastWrite[2], SERIAL_CLOSE | 0x09); + done(); + }); + + it("has a serialFlush method", done => { + board.serialFlush(0x02); + assert.equal(transport.lastWrite[2], SERIAL_FLUSH | 0x02); + done(); + }); + + it("has a serialListen method that switches software serial port", done => { + const spy = sandbox.spy(transport, "write"); + board.serialListen(0x08); + assert.equal(transport.lastWrite[2], SERIAL_LISTEN | 0x08); + assert.equal(transport.lastWrite[3], END_SYSEX); + assert.equal(spy.callCount, 1); + spy.restore(); + done(); + }); + + it("must not send a SERIAL_LISTEN message for a hardware serial port", done => { + const spy = sandbox.spy(transport, "write"); + board.serialListen(0x01); + assert.equal(spy.callCount, 0); + spy.restore(); + done(); + }); + + }); + + describe("sysex: custom messages and response handlers", () => { + + it("must allow custom SYSEX_RESPONSE handlers", done => { + + assert.equal(Board.SYSEX_RESPONSE[NON_STANDARD_REPLY], undefined); + + Board.SYSEX_RESPONSE[NON_STANDARD_REPLY] = board => { + const payload = []; + const sub = board.buffer[2]; + + for (let i = 3, length = board.buffer.length - 1; i < length; i += 2) { + payload.push(board.buffer[i] | (board.buffer[i + 1] << 7)); + } + + board.emit(`non-standard-reply-${sub}`, payload); + }; + + // User code may add this emitter + board.on("non-standard-reply-4", payload => { + assert.deepEqual(payload, [0, 1, 2, 3, 4]); + done(); + }); + + // Emit mock data to trigger the NON_STANDARD_REPLY handler + transport.emit("data", [ + // SUB Data... + START_SYSEX, NON_STANDARD_REPLY, 0x04, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX + ]); + }); + + it("must provide a SAFE API to define custom SYSEX_RESPONSE handlers", done => { + + const incoming = [START_SYSEX, NON_STANDARD_REPLY, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX]; + + board.sysexResponse(NON_STANDARD_REPLY, data => { + // Data does NOT include: + // [0] START_SYSEX + // [1] NON_STANDARD_REPLY + // [n] END_SYSEX + + assert.deepEqual(data, [0, 0, 1, 0, 2, 0, 3, 0, 4, 0]); + assert.deepEqual(Board.decode(data), [0, 1, 2, 3, 4]); + + done(); + }); + + transport.emit("data", incoming); + }); + + it("SYSEX_RESPONSE handler context is board", done => { + + const incoming = [START_SYSEX, NON_STANDARD_REPLY, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, END_SYSEX]; + + board.sysexResponse(NON_STANDARD_REPLY, function(data) { + assert.equal(this, board); + done(); + }); + + transport.emit("data", incoming); + }); + + it("fail when overwriting SYSEX_RESPONSE command byte", done => { + Board.SYSEX_RESPONSE[0xFF] = () => {}; + + assert.throws(() => { + board.sysexResponse(0xFF); + }); + done(); + }); + + it("fail when calling sysexCommand with empty array", done => { + assert.throws(() => { + board.sysexCommand(); + }); + assert.throws(() => { + board.sysexCommand([]); + }); + done(); + }); + + it("must allow sending arbitrary sysex commands", done => { + + const write = sandbox.stub(transport, "write"); + + board.sysexCommand([ + I2C_REQUEST, 0x68, 0 << 3, 1 & 0x7F, (1 >> 7) & 0x7F, + ]); + + const sent = write.lastCall.args[0]; + + assert.equal(sent[0], START_SYSEX); + assert.equal(sent[1], I2C_REQUEST); + assert.equal(sent[2], 0x68); + assert.equal(sent[3], 0 << 3); + assert.equal(sent[4], 1 & 0x7F); + assert.equal(sent[5], (1 >> 7) & 0x7F); + assert.equal(sent[6], END_SYSEX); + done(); + }); + + it("allows clearing handler for SYSEX_RESPONSE command byte", done => { + Board.SYSEX_RESPONSE[0xFF] = () => {}; + + board.clearSysexResponse(0xFF); + + assert.doesNotThrow(() => { + board.sysexResponse(0xFF); + }); + done(); + }); + }); + + describe("parser", () => { + + beforeEach(() => { + board.buffer = []; + }); + + it("must parse a command from the beginning of a data packet", done => { + const spy = sandbox.spy(); + const incoming = [REPORT_VERSION, 0x02, 0x03]; + board.versionReceived = false; + board.on("reportversion", spy); + transport.emit("data", incoming); + assert.equal(spy.callCount, 1); + done(); + }); + + it("must parse a command from the middle of a data packet", done => { + const spy = sandbox.spy(); + // includes: analog input, report version, query firmware (incomplete) + const incoming = [ + 0xe0, 0x07, 0x07, 0xf9, 0x02, 0x05, 0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, 0x00, 0x61, + 0x00, 0x6e, 0x00, 0x64, 0x00 + ]; + board.versionReceived = false; + board.on("reportversion", spy); + transport.emit("data", incoming); + assert.equal(spy.callCount, 1); + done(); + }); + + it("must not emit command events until REPORT_VERSION is received", done => { + const spyAnalog = sandbox.spy(); + const spyVersion = sandbox.spy(); + // includes: analog input, report version, query firmware (incomplete) and junk + // between analog input and report version + const incoming = [ + 0xe0, 0x00, 0x71, 0xf9, 0x02, 0x05, 0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, + 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00 + ]; + board.versionReceived = false; + board.on("analog-read-0", spyAnalog); + board.on("reportversion", spyVersion); + transport.emit("data", incoming); + assert.equal(spyAnalog.callCount, 0); + assert.equal(spyVersion.callCount, 1); + done(); + }); + + it("must parse multiple commands from a single packet", done => { + const spyAnalog = sandbox.spy(); + const spyVersion = sandbox.spy(); + // includes: report version, analog input, query firmware (incomplete) and junk + // between analog input and report version + const incoming = [ + 0xf9, 0x02, 0x05, 0xe0, 0x00, 0x71, 0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, + 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00 + ]; + board.versionReceived = false; + board.on("reportversion", spyVersion); + board.on("analog-read-0", spyAnalog); + transport.emit("data", incoming); + assert.equal(spyVersion.callCount, 1); + assert.equal(spyAnalog.callCount, 1); + done(); + }); + + it("must parse a complete sysex command after an incomplete sysex command", done => { + const spy = sandbox.spy(); + // includes: query firmware (incomplete sysex), pin state response (pin 2) + const incoming = [ + 0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, + 0xf0, 0x6e, 0x02, 0x01, 0x01, 0xf7 + ]; + board.versionReceived = true; + board.on("pin-state-2", spy); + transport.emit("data", incoming); + assert.equal(spy.callCount, 1); + done(); + }); + + it("must parse a non-sysex command after an incomplete sysex command", done => { + const spy = sandbox.spy(); + // includes: query firmware (incomplete sysex), analog input + const incoming = [ + 0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, + 0xe0, 0x00, 0x71 + ]; + board.versionReceived = true; + board.on("analog-read-0", spy); + transport.emit("data", incoming); + assert.equal(spy.callCount, 1); + done(); + }); + + it("must parse a command spread across multiple data packets", done => { + const spy = sandbox.spy(); + // query firmware split across 3 packets with first packet preceeded by junk + const incoming1 = [0x07, 0x04, 240, 121, 2, 3, 83, 0, 116, 0, 97, 0, 110, 0, 100, 0]; + const incoming2 = [97, 0, 114, 0, 100, 0, 70, 0, 105, 0, 114, 0, 109, 0]; + const incoming3 = [97, 0, 116, 0, 97, 0, 247]; + + board.versionReceived = true; + board.on("queryfirmware", spy); + transport.emit("data", incoming1); + transport.emit("data", incoming2); + transport.emit("data", incoming3); + assert.equal(spy.callCount, 1); + done(); + }); + + it("must parse a command spread across multiple single byte transfers", done => { + const spy = sandbox.spy(); + const incoming = [REPORT_VERSION, 0x02, 0x03]; + + board.versionReceived = true; + board.on("reportversion", spy); + for (let i = 0; i < incoming.length; i++) { + transport.emit("data", [incoming[i]]); + } + assert.equal(spy.callCount, 1); + done(); + }); + }); +}); + +describe("Numeric encoding/decoding and formatting", () => { + + it("must encode 32 bit signed integers", done => { + assert.deepEqual(Board.test.encode32BitSignedInteger(5786), [26, 45, 0, 0, 0]); + done(); + }); + + it("must encode 32 bit signed integers when they are negative", done => { + assert.deepEqual(Board.test.encode32BitSignedInteger(-5786), [26, 45, 0, 0, 8]); + done(); + }); + + it("must decode 32 bit signed integers", done => { + assert.equal(Board.test.decode32BitSignedInteger([26, 45, 0, 0, 0]), 5786); + done(); + }); + + it("must decode 32 bit signed integers when they are negative", done => { + assert.equal(Board.test.decode32BitSignedInteger([26, 45, 0, 0, 8]), -5786); + done(); + }); + + it("must encode custom floats", done => { + assert.deepEqual(Board.test.encodeCustomFloat(123.456), [0, 45, 75, 28]); + done(); + }); + + it("must encode custom floats (even when they are integers)", done => { + assert.deepEqual(Board.test.encodeCustomFloat(100), [1, 0, 0, 52]); + done(); + }); + + it("must encode custom floats when they are negative", done => { + assert.deepEqual(Board.test.encodeCustomFloat(-7321.783), [54, 113, 62, 99]); + done(); + }); + + it("must encode custom floats when they are less than 1", done => { + assert.deepEqual(Board.test.encodeCustomFloat(0.000325), [79, 46, 70, 5]); + done(); + }); + + it("must decode custom floats", done => { + assert.equal(Board.test.decodeCustomFloat([110, 92, 44, 32]), 732.782); + done(); + }); + + it("must decode custom floats when they are negative", done => { + assert.equal(Board.test.decodeCustomFloat([110, 92, 44, 96]), -732.782); + done(); + }); +}); + +describe("Board.encode/Board.decode", () => { + + describe("Board.encode", () => { + it("must encode arbitrary data", done => { + assert.deepEqual(Board.encode([0, 1, 2, 3, 4]), [0, 0, 1, 0, 2, 0, 3, 0, 4, 0]); + done(); + }); + it("returns a fresh array", done => { + const data = []; + assert.notEqual(Board.encode(data), data); + done(); + }); + }); + + describe("Board.decode", () => { + it("must decode arbitrary data", done => { + assert.deepEqual(Board.decode([0, 0, 1, 0, 2, 0, 3, 0, 4, 0]), [0, 1, 2, 3, 4]); + done(); + }); + + it("must fail to decode uneven data", done => { + assert.throws(() => { + Board.decode([0, 0, 1, 0, 2, 0, 3, 0, 4]); + }); + done(); + }); + + it("returns a fresh array", done => { + const data = []; + assert.notEqual(Board.decode(data), data); + done(); + }); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/entry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/entry.js new file mode 100644 index 00000000..fdc391d1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/entry.js @@ -0,0 +1 @@ +var Firmata = require("../../../packages/firmata.js/lib/firmata"); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-adc.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-adc.js new file mode 100644 index 00000000..f78eb670 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-adc.js @@ -0,0 +1,5 @@ +module.exports = [0x42, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x3f, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x3f, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x40, 0x02, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x44, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x3f, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x43, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x3f, 0x02, 0xe0, 0x40, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x42, 0x02, 0xe0, 0x41, 0x02, 0xe0, 0x40, 0x02, + +/* REPORT_VERSION start */ 0xf9, 0x02, 0x05, /* REPORT_VERSION end */ + +0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x46, 0x00, 0x69, 0x00, 0x72, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x74, 0x00, 0x61, 0x00, 0x50, 0x00, 0x6c, 0x00, 0x75, 0x00, 0x73, 0x00, 0x2e, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0xf7, 0xf0, 0x6c, 0x7f, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x06, 0x01, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x06, 0x01, 0x7f, 0xf7, 0xf0, 0x6a, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0xf7, 0xe0, 0x7f, 0x03]; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-i2c.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-i2c.js new file mode 100644 index 00000000..d644e8c0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-i2c.js @@ -0,0 +1,6 @@ +module.exports = [0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0x00, 0x40, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x05, 0x00, 0x39, 0x01, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x40, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x40, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0x00, 0x40, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x05, 0x00, 0x39, 0x01, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x40, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x40, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0x00, 0x40, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x05, 0x00, 0x39, 0x01, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x40, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x40, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5e, 0x00, 0x05, 0x00, 0x48, 0x01, 0x05, 0x00, 0x1b, 0x01, 0x05, 0x00, 0x3f, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x42, 0x01, 0xf7, + +/* REPORT_VERSION start */ 0xf9, 0x02, 0x05, /* REPORT_VERSION end */ + +0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x46, 0x00, 0x69, 0x00, 0x72, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x74, 0x00, 0x61, 0x00, 0x50, 0x00, 0x6c, 0x00, 0x75, 0x00, 0x73, 0x00, 0x2e, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0xf7, 0xf0, 0x6c, 0x7f, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x06, 0x01, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x06, 0x01, 0x7f, 0xf7, 0xf0, 0x6a, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0xf7, 0xf0, 0x77, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x5d, 0x00, 0x05, 0x00, 0x40, 0x01, 0x05, 0x00, 0x41, 0x01, 0x05, 0x00, 0x41, 0x01, 0x04, 0x00, 0x16, 0x00, 0x05, 0x00, 0x40, 0x01, 0xf7, +]; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-serial.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-serial.js new file mode 100644 index 00000000..8f2fa204 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/fixtures/unexpected-data-serial.js @@ -0,0 +1,6 @@ +module.exports = [0x00, 0x2c, 0x00, 0x30, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x30, 0x00, 0x30, 0x00, 0x2c, 0x00, 0x2a, 0x00, 0x37, 0x00, 0x31, 0x00, 0x0d, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x30, 0x00, 0x30, 0x00, 0x2c, 0x00, 0x2a, 0x00, 0x37, 0x00, 0x31, 0x00, 0x0d, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x30, 0x00, 0x30, 0x00, 0x2c, 0x00, 0x2a, 0x00, 0x37, 0x00, 0x31, 0x00, 0x0d, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x30, 0x00, 0x30, 0x00, 0x2c, 0x00, 0x2a, 0x00, 0x37, 0x00, 0x31, 0x00, 0x0d, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x30, 0x00, 0x30, 0x00, 0x2c, 0x00, 0x2a, 0x00, 0x37, 0x00, 0x31, 0x00, 0x0d, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x30, 0x00, 0x30, 0x00, 0x2c, 0x00, 0x2a, 0x00, 0x37, 0x00, 0x31, 0x00, 0x0d, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x30, 0x00, 0x30, 0x00, 0x2c, 0x00, 0x2a, 0x00, 0x37, 0x00, 0x31, 0x00, 0x0d, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x0a, 0x00, 0x24, 0x00, 0x47, 0x00, 0x50, 0x00, 0x52, 0x00, 0x4d, 0x00, 0x43, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x2c, 0x00, 0x2c, 0x00, 0x56, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x2c, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x2c, 0x00, 0x4e, 0x00, 0x2a, 0x00, 0x35, 0x00, 0x33, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x24, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x47, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x50, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x47, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x47, 0x00, 0xf7, 0xf0, 0x60, 0x48, 0x41, 0xfe, 0xf0, 0x79, 0x02, 0x05, 0x53, 0x00, 0x74, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x46, 0x00, 0x69, 0x00, 0x72, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x74, 0x00, 0x61, 0x00, 0x50, 0x00, 0x6c, 0x00, 0x75, 0x00, 0x73, 0x00, 0x2e, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0xf7, + +/* REPORT_VERSION start */ 0xf9, 0x02, 0x05, /* REPORT_VERSION end */ + + +0x05, 0x53, 0x00, 0x74, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x46, 0x00, 0x69, 0x00, 0x72, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x74, 0x00, 0x61, 0x00, 0x50, 0x00, 0x6c, 0x00, 0x75, 0x00, 0x73, 0x00, 0x2e, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0xf7, 0xf0, 0x6c, 0x7f, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x03, 0x08, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x06, 0x01, 0x7f, 0x00, 0x01, 0x0b, 0x01, 0x01, 0x01, 0x02, 0x0a, 0x04, 0x0e, 0x06, 0x01, 0x7f, 0xf7, 0xf0, 0x6a, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0xf7, 0xf0, 0x60, 0x48, 0x19, 0x01, 0xf7]; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/onewireutils.test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/onewireutils.test.js new file mode 100644 index 00000000..445f02c8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/firmata/test/unit/onewireutils.test.js @@ -0,0 +1,69 @@ +require("../common/bootstrap"); + +const sandbox = sinon.sandbox.create(); + +describe("OneWire.crc8/OneWire.readDevices", () => { + + afterEach(() => { + sandbox.restore(); + }); + + describe("OneWire.crc8", () => { + it("must CRC check data read from firmata", done => { + const input = [0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D]; + const crcByte = OneWire.crc8(input.slice(0, input.length - 1)); + + assert.equal(crcByte, input[input.length - 1]); + + done(); + }); + it("must return an invalid CRC check for corrupt data", done => { + const input = [0x28, 0xDB, 0xEF, 0x22, 0x05, 0x00, 0x00, 0x5D]; + const crcByte = OneWire.crc8(input.slice(0, input.length - 1)); + + crcByte.should.not.equal(input[input.length - 1]); + + done(); + }); + }); + describe("OneWire.readDevices", () => { + it("must read device identifier", done => { + const input = Encoder7Bit.to7BitArray([0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D]); + const devices = OneWire.readDevices(input); + + assert.equal(devices.length, 1); + + done(); + }); + it("must read device identifiers", done => { + const input = Encoder7Bit.to7BitArray([0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D, 0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D]); + const devices = OneWire.readDevices(input); + + assert.equal(devices.length, 2); + + done(); + }); + it("must read only complete device identifiers", done => { + const input = Encoder7Bit.to7BitArray([0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D, 0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D, 0x00, 0x01, 0x02]); + const devices = OneWire.readDevices(input); + + assert.equal(devices.length, 2); + + done(); + }); + + it("detects and logs invalid ROM", done => { + + sandbox.stub(console, "error").callsFake(() => {}); + sandbox.stub(OneWire, "crc8").callsFake(() => null); + + const input = Encoder7Bit.to7BitArray([0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D, 0x28, 0xDB, 0xEF, 0x21, 0x05, 0x00, 0x00, 0x5D, 0x00, 0x01, 0x02]); + const devices = OneWire.readDevices(input); + + assert.equal(devices.length, 2); + assert.equal(console.error.lastCall.args[0], "ROM invalid!"); + + done(); + }); + }); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/LICENSE new file mode 100644 index 00000000..cb757e5d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Mathias Buus + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/README.md new file mode 100644 index 00000000..62b33742 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/README.md @@ -0,0 +1,26 @@ +# fs-constants + +Small module that allows you to get the fs constants across +Node and the browser. + +``` +npm install fs-constants +``` + +Previously you would use `require('constants')` for this in node but that has been +deprecated and changed to `require('fs').constants` which does not browserify. + +This module uses `require('constants')` in the browser and `require('fs').constants` in node to work around this + + +## Usage + +``` js +var constants = require('fs-constants') + +console.log('constants:', constants) +``` + +## License + +MIT diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/browser.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/browser.js new file mode 100644 index 00000000..3c87638d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/browser.js @@ -0,0 +1 @@ +module.exports = require('constants') diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/index.js new file mode 100644 index 00000000..2a3aadf3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/index.js @@ -0,0 +1 @@ +module.exports = require('fs').constants || require('constants') diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/package.json new file mode 100644 index 00000000..fafd734e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs-constants/package.json @@ -0,0 +1,47 @@ +{ + "_from": "fs-constants@^1.0.0", + "_id": "fs-constants@1.0.0", + "_inBundle": false, + "_integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "_location": "/node-red-contrib-johnny-five/fs-constants", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs-constants@^1.0.0", + "name": "fs-constants", + "escapedName": "fs-constants", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/tar-stream" + ], + "_resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "_shasum": "6be0de9be998ce16af8afc24497b9ee9b7ccd9ad", + "_spec": "fs-constants@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/tar-stream", + "author": { + "name": "Mathias Buus", + "url": "@mafintosh" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/mafintosh/fs-constants/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Require constants across node and the browser", + "devDependencies": {}, + "homepage": "https://github.com/mafintosh/fs-constants", + "license": "MIT", + "main": "index.js", + "name": "fs-constants", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/fs-constants.git" + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/LICENSE new file mode 100644 index 00000000..5bd884c2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/README.md new file mode 100644 index 00000000..a42ceac6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/index.js new file mode 100644 index 00000000..b09c7c7e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/old.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/old.js new file mode 100644 index 00000000..b40305e7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/package.json new file mode 100644 index 00000000..143854b0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/fs.realpath/package.json @@ -0,0 +1,59 @@ +{ + "_from": "fs.realpath@^1.0.0", + "_id": "fs.realpath@1.0.0", + "_inBundle": false, + "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "_location": "/node-red-contrib-johnny-five/fs.realpath", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs.realpath@^1.0.0", + "name": "fs.realpath", + "escapedName": "fs.realpath", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/glob" + ], + "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "_spec": "fs.realpath@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "devDependencies": {}, + "files": [ + "old.js", + "index.js" + ], + "homepage": "https://github.com/isaacs/fs.realpath#readme", + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "license": "ISC", + "main": "index.js", + "name": "fs.realpath", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/LICENSE new file mode 100644 index 00000000..e7560529 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/README.md new file mode 100644 index 00000000..bdd60e38 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/README.md @@ -0,0 +1,399 @@ +gauge +===== + +A nearly stateless terminal based horizontal gauge / progress bar. + +```javascript +var Gauge = require("gauge") + +var gauge = new Gauge() + +gauge.show("test", 0.20) + +gauge.pulse("this") + +gauge.hide() +``` + +![](gauge-demo.gif) + + +### CHANGES FROM 1.x + +Gauge 2.x is breaking release, please see the [changelog] for details on +what's changed if you were previously a user of this module. + +[changelog]: CHANGELOG.md + +### THE GAUGE CLASS + +This is the typical interface to the module– it provides a pretty +fire-and-forget interface to displaying your status information. + +``` +var Gauge = require("gauge") + +var gauge = new Gauge([stream], [options]) +``` + +* **stream** – *(optional, default STDERR)* A stream that progress bar + updates are to be written to. Gauge honors backpressure and will pause + most writing if it is indicated. +* **options** – *(optional)* An option object. + +Constructs a new gauge. Gauges are drawn on a single line, and are not drawn +if **stream** isn't a tty and a tty isn't explicitly provided. + +If **stream** is a terminal or if you pass in **tty** to **options** then we +will detect terminal resizes and redraw to fit. We do this by watching for +`resize` events on the tty. (To work around a bug in verisons of Node prior +to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to +larger window sizes will be clean, but shrinking the window will always +result in some cruft. + +**IMPORTANT:** If you prevously were passing in a non-tty stream but you still +want output (for example, a stream wrapped by the `ansi` module) then you +need to pass in the **tty** option below, as `gauge` needs access to +the underlying tty in order to do things like terminal resizes and terminal +width detection. + +The **options** object can have the following properties, all of which are +optional: + +* **updateInterval**: How often gauge updates should be drawn, in miliseconds. +* **fixedFramerate**: Defaults to false on node 0.8, true on everything + else. When this is true a timer is created to trigger once every + `updateInterval` ms, when false, updates are printed as soon as they come + in but updates more often than `updateInterval` are ignored. The reason + 0.8 doesn't have this set to true is that it can't `unref` its timer and + so it would stop your program from exiting– if you want to use this + feature with 0.8 just make sure you call `gauge.disable()` before you + expect your program to exit. +* **themes**: A themeset to use when selecting the theme to use. Defaults + to `gauge/themes`, see the [themes] documentation for details. +* **theme**: Select a theme for use, it can be a: + * Theme object, in which case the **themes** is not used. + * The name of a theme, which will be looked up in the current *themes* + object. + * A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + + If no theme is selected then a default is picked using a combination of our + best guesses at your OS, color support and unicode support. +* **template**: Describes what you want your gauge to look like. The + default is what npm uses. Detailed [documentation] is later in this + document. +* **hideCursor**: Defaults to true. If true, then the cursor will be hidden + while the gauge is displayed. +* **tty**: The tty that you're ultimately writing to. Defaults to the same + as **stream**. This is used for detecting the width of the terminal and + resizes. The width used is `tty.columns - 1`. If no tty is available then + a width of `79` is assumed. +* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true + the gauge starts enabled. If disabled then all update commands are + ignored and no gauge will be printed until you call `.enable()`. +* **Plumbing**: The class to use to actually generate the gauge for + printing. This defaults to `require('gauge/plumbing')` and ordinarly you + shouldn't need to override this. +* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit + handler to make sure your cursor is turned back on and the progress bar + erased when your process exits, even if you Ctrl-C out or otherwise exit + unexpectedly. You can disable this and it won't register the exit handler. + +[has-unicode]: https://www.npmjs.com/package/has-unicode +[themes]: #themes +[documentation]: #templates + +#### `gauge.show(section | status, [completed])` + +The first argument is either the section, the name of the current thing +contributing to progress, or an object with keys like **section**, +**subsection** & **completed** (or any others you have types for in a custom +template). If you don't want to update or set any of these you can pass +`null` and it will be ignored. + +The second argument is the percent completed as a value between 0 and 1. +Without it, completion is just not updated. You'll also note that completion +can be passed in as part of a status object as the first argument. If both +it and the completed argument are passed in, the completed argument wins. + +#### `gauge.hide([cb])` + +Removes the gauge from the terminal. Optionally, callback `cb` after IO has +had an opportunity to happen (currently this just means after `setImmediate` +has called back.) + +It turns out this is important when you're pausing the progress bar on one +filehandle and printing to another– otherwise (with a big enough print) node +can end up printing the "end progress bar" bits to the progress bar filehandle +while other stuff is printing to another filehandle. These getting interleaved +can cause corruption in some terminals. + +#### `gauge.pulse([subsection])` + +* **subsection** – *(optional)* The specific thing that triggered this pulse + +Spins the spinner in the gauge to show output. If **subsection** is +included then it will be combined with the last name passed to `gauge.show`. + +#### `gauge.disable()` + +Hides the gauge and ignores further calls to `show` or `pulse`. + +#### `gauge.enable()` + +Shows the gauge and resumes updating when `show` or `pulse` is called. + +#### `gauge.isEnabled()` + +Returns true if the gauge is enabled. + +#### `gauge.setThemeset(themes)` + +Change the themeset to select a theme from. The same as the `themes` option +used in the constructor. The theme will be reselected from this themeset. + +#### `gauge.setTheme(theme)` + +Change the active theme, will be displayed with the next show or pulse. This can be: + +* Theme object, in which case the **themes** is not used. +* The name of a theme, which will be looked up in the current *themes* + object. +* A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + +If no theme is selected then a default is picked using a combination of our +best guesses at your OS, color support and unicode support. + +#### `gauge.setTemplate(template)` + +Change the active template, will be displayed with the next show or pulse + +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet + +### THEMES + +``` +var themes = require('gauge/themes') + +// fetch the default color unicode theme for this platform +var ourTheme = themes({hasUnicode: true, hasColor: true}) + +// fetch the default non-color unicode theme for osx +var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'}) + +// create a new theme based on the color ascii theme for this platform +// that brackets the progress bar with arrows +var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), { + preProgressbar: '→', + postProgressbar: '←' +}) +``` + +The object returned by `gauge/themes` is an instance of the `ThemeSet` class. + +``` +var ThemeSet = require('gauge/theme-set') +var themes = new ThemeSet() +// or +var themes = require('gauge/themes') +var mythemes = themes.newThemeset() // creates a new themeset based on the default themes +``` + +#### themes(opts) +#### themes.getDefault(opts) + +Theme objects are a function that fetches the default theme based on +platform, unicode and color support. + +Options is an object with the following properties: + +* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is + available then a non-unicode theme will be used. +* **hasColor** - If true, fetch a color theme, if no color theme is + available a non-color theme will be used. +* **platform** (optional) - Defaults to `process.platform`. If no + platform match is available then `fallback` is used instead. + +If no compatible theme can be found then an error will be thrown with a +`code` of `EMISSINGTHEME`. + +#### themes.addTheme(themeName, themeObj) +#### themes.addTheme(themeName, [parentTheme], newTheme) + +Adds a named theme to the themeset. You can pass in either a theme object, +as returned by `themes.newTheme` or the arguments you'd pass to +`themes.newTheme`. + +#### themes.getThemeNames() + +Return a list of all of the names of the themes in this themeset. Suitable +for use in `themes.getTheme(…)`. + +#### themes.getTheme(name) + +Returns the theme object from this theme set named `name`. + +If `name` does not exist in this themeset an error will be thrown with +a `code` of `EMISSINGTHEME`. + +#### themes.setDefault([opts], themeName) + +`opts` is an object with the following properties. + +* **platform** - Defaults to `'fallback'`. If your theme is platform + specific, specify that here with the platform from `process.platform`, eg, + `win32`, `darwin`, etc. +* **hasUnicode** - Defaults to `false`. If your theme uses unicode you + should set this to true. +* **hasColor** - Defaults to `false`. If your theme uses color you should + set this to true. + +`themeName` is the name of the theme (as given to `addTheme`) to use for +this set of `opts`. + +#### themes.newTheme([parentTheme,] newTheme) + +Create a new theme object based on `parentTheme`. If no `parentTheme` is +provided then a minimal parentTheme that defines functions for rendering the +activity indicator (spinner) and progress bar will be defined. (This +fallback parent is defined in `gauge/base-theme`.) + +newTheme should be a bare object– we'll start by discussing the properties +defined by the default themes: + +* **preProgressbar** - displayed prior to the progress bar, if the progress + bar is displayed. +* **postProgressbar** - displayed after the progress bar, if the progress bar + is displayed. +* **progressBarTheme** - The subtheme passed through to the progress bar + renderer, it's an object with `complete` and `remaining` properties + that are the strings you want repeated for those sections of the progress + bar. +* **activityIndicatorTheme** - The theme for the activity indicator (spinner), + this can either be a string, in which each character is a different step, or + an array of strings. +* **preSubsection** - Displayed as a separator between the `section` and + `subsection` when the latter is printed. + +More generally, themes can have any value that would be a valid value when rendering +templates. The properties in the theme are used when their name matches a type in +the template. Their values can be: + +* **strings & numbers** - They'll be included as is +* **function (values, theme, width)** - Should return what you want in your output. + *values* is an object with values provided via `gauge.show`, + *theme* is the theme specific to this item (see below) or this theme object, + and *width* is the number of characters wide your result should be. + +There are a couple of special prefixes: + +* **pre** - Is shown prior to the property, if its displayed. +* **post** - Is shown after the property, if its displayed. + +And one special suffix: + +* **Theme** - Its value is passed to a function-type item as the theme. + +#### themes.addToAllThemes(theme) + +This *mixes-in* `theme` into all themes currently defined. It also adds it +to the default parent theme for this themeset, so future themes added to +this themeset will get the values from `theme` by default. + +#### themes.newThemeset() + +Copy the current themeset into a new one. This allows you to easily inherit +one themeset from another. + +### TEMPLATES + +A template is an array of objects and strings that, after being evaluated, +will be turned into the gauge line. The default template is: + +```javascript +[ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} +] +``` + +The various template elements can either be **plain strings**, in which case they will +be be included verbatum in the output, or objects with the following properties: + +* *type* can be any of the following plus any keys you pass into `gauge.show` plus + any keys you have on a custom theme. + * `section` – What big thing you're working on now. + * `subsection` – What component of that thing is currently working. + * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme` + from your active theme. + * `progressbar` – A progress bar representing your current `completed` + using the `progressbarTheme` from your active theme. +* *kerning* – Number of spaces that must be between this item and other + items, if this item is displayed at all. +* *maxLength* – The maximum length for this element. If its value is longer it + will be truncated. +* *minLength* – The minimum length for this element. If its value is shorter it + will be padded according to the *align* value. +* *align* – (Default: left) Possible values "left", "right" and "center". Works + as you'd expect from word processors. +* *length* – Provides a single value for both *minLength* and *maxLength*. If both + *length* and *minLength or *maxLength* are specifed then the latter take precedence. +* *value* – A literal value to use for this template item. +* *default* – A default value to use for this template item if a value + wasn't otherwise passed in. + +### PLUMBING + +This is the super simple, assume nothing, do no magic internals used by gauge to +implement its ordinary interface. + +``` +var Plumbing = require('gauge/plumbing') +var gauge = new Plumbing(theme, template, width) +``` + +* **theme**: The theme to use. +* **template**: The template to use. +* **width**: How wide your gauge should be + +#### `gauge.setTheme(theme)` + +Change the active theme. + +#### `gauge.setTemplate(template)` + +Change the active template. + +#### `gauge.setWidth(width)` + +Change the width to render at. + +#### `gauge.hide()` + +Return the string necessary to hide the progress bar + +#### `gauge.hideCursor()` + +Return a string to hide the cursor. + +#### `gauge.showCursor()` + +Return a string to show the cursor. + +#### `gauge.show(status)` + +Using `status` for values, render the provided template with the theme and return +a string that is suitable for printing to update the gauge. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/base-theme.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/base-theme.js new file mode 100644 index 00000000..0b67638e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/base-theme.js @@ -0,0 +1,14 @@ +'use strict' +var spin = require('./spin.js') +var progressBar = require('./progress-bar.js') + +module.exports = { + activityIndicator: function (values, theme, width) { + if (values.spun == null) return + return spin(theme, values.spun) + }, + progressbar: function (values, theme, width) { + if (values.completed == null) return + return progressBar(theme, width, values.completed) + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/error.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/error.js new file mode 100644 index 00000000..d9914ba5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/error.js @@ -0,0 +1,24 @@ +'use strict' +var util = require('util') + +var User = exports.User = function User (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, User) + err.code = 'EGAUGE' + return err +} + +exports.MissingTemplateValue = function MissingTemplateValue (item, values) { + var err = new User(util.format('Missing template value "%s"', item.type)) + Error.captureStackTrace(err, MissingTemplateValue) + err.template = item + err.values = values + return err +} + +exports.Internal = function Internal (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, Internal) + err.code = 'EGAUGEINTERNAL' + return err +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/has-color.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/has-color.js new file mode 100644 index 00000000..e283a256 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/has-color.js @@ -0,0 +1,12 @@ +'use strict' + +module.exports = isWin32() || isColorTerm() + +function isWin32 () { + return process.platform === 'win32' +} + +function isColorTerm () { + var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i + return !!process.env.COLORTERM || termHasColor.test(process.env.TERM) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/index.js new file mode 100644 index 00000000..c5532400 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/index.js @@ -0,0 +1,233 @@ +'use strict' +var Plumbing = require('./plumbing.js') +var hasUnicode = require('has-unicode') +var hasColor = require('./has-color.js') +var onExit = require('signal-exit') +var defaultThemes = require('./themes') +var setInterval = require('./set-interval.js') +var process = require('./process.js') +var setImmediate = require('./set-immediate') + +module.exports = Gauge + +function callWith (obj, method) { + return function () { + return method.call(obj) + } +} + +function Gauge (arg1, arg2) { + var options, writeTo + if (arg1 && arg1.write) { + writeTo = arg1 + options = arg2 || {} + } else if (arg2 && arg2.write) { + writeTo = arg2 + options = arg1 || {} + } else { + writeTo = process.stderr + options = arg1 || arg2 || {} + } + + this._status = { + spun: 0, + section: '', + subsection: '' + } + this._paused = false // are we paused for back pressure? + this._disabled = true // are all progress bar updates disabled? + this._showing = false // do we WANT the progress bar on screen + this._onScreen = false // IS the progress bar on screen + this._needsRedraw = false // should we print something at next tick? + this._hideCursor = options.hideCursor == null ? true : options.hideCursor + this._fixedFramerate = options.fixedFramerate == null + ? !(/^v0\.8\./.test(process.version)) + : options.fixedFramerate + this._lastUpdateAt = null + this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval + + this._themes = options.themes || defaultThemes + this._theme = options.theme + var theme = this._computeTheme(options.theme) + var template = options.template || [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} + ] + this.setWriteTo(writeTo, options.tty) + var PlumbingClass = options.Plumbing || Plumbing + this._gauge = new PlumbingClass(theme, template, this.getWidth()) + + this._$$doRedraw = callWith(this, this._doRedraw) + this._$$handleSizeChange = callWith(this, this._handleSizeChange) + + this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit + this._removeOnExit = null + + if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { + this.enable() + } else { + this.disable() + } +} +Gauge.prototype = {} + +Gauge.prototype.isEnabled = function () { + return !this._disabled +} + +Gauge.prototype.setTemplate = function (template) { + this._gauge.setTemplate(template) + if (this._showing) this._requestRedraw() +} + +Gauge.prototype._computeTheme = function (theme) { + if (!theme) theme = {} + if (typeof theme === 'string') { + theme = this._themes.getTheme(theme) + } else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { + var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode + var useColor = theme.hasColor == null ? hasColor : theme.hasColor + theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) + } + return theme +} + +Gauge.prototype.setThemeset = function (themes) { + this._themes = themes + this.setTheme(this._theme) +} + +Gauge.prototype.setTheme = function (theme) { + this._gauge.setTheme(this._computeTheme(theme)) + if (this._showing) this._requestRedraw() + this._theme = theme +} + +Gauge.prototype._requestRedraw = function () { + this._needsRedraw = true + if (!this._fixedFramerate) this._doRedraw() +} + +Gauge.prototype.getWidth = function () { + return ((this._tty && this._tty.columns) || 80) - 1 +} + +Gauge.prototype.setWriteTo = function (writeTo, tty) { + var enabled = !this._disabled + if (enabled) this.disable() + this._writeTo = writeTo + this._tty = tty || + (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || + (writeTo.isTTY && writeTo) || + this._tty + if (this._gauge) this._gauge.setWidth(this.getWidth()) + if (enabled) this.enable() +} + +Gauge.prototype.enable = function () { + if (!this._disabled) return + this._disabled = false + if (this._tty) this._enableEvents() + if (this._showing) this.show() +} + +Gauge.prototype.disable = function () { + if (this._disabled) return + if (this._showing) { + this._lastUpdateAt = null + this._showing = false + this._doRedraw() + this._showing = true + } + this._disabled = true + if (this._tty) this._disableEvents() +} + +Gauge.prototype._enableEvents = function () { + if (this._cleanupOnExit) { + this._removeOnExit = onExit(callWith(this, this.disable)) + } + this._tty.on('resize', this._$$handleSizeChange) + if (this._fixedFramerate) { + this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) + if (this.redrawTracker.unref) this.redrawTracker.unref() + } +} + +Gauge.prototype._disableEvents = function () { + this._tty.removeListener('resize', this._$$handleSizeChange) + if (this._fixedFramerate) clearInterval(this.redrawTracker) + if (this._removeOnExit) this._removeOnExit() +} + +Gauge.prototype.hide = function (cb) { + if (this._disabled) return cb && process.nextTick(cb) + if (!this._showing) return cb && process.nextTick(cb) + this._showing = false + this._doRedraw() + cb && setImmediate(cb) +} + +Gauge.prototype.show = function (section, completed) { + this._showing = true + if (typeof section === 'string') { + this._status.section = section + } else if (typeof section === 'object') { + var sectionKeys = Object.keys(section) + for (var ii = 0; ii < sectionKeys.length; ++ii) { + var key = sectionKeys[ii] + this._status[key] = section[key] + } + } + if (completed != null) this._status.completed = completed + if (this._disabled) return + this._requestRedraw() +} + +Gauge.prototype.pulse = function (subsection) { + this._status.subsection = subsection || '' + this._status.spun ++ + if (this._disabled) return + if (!this._showing) return + this._requestRedraw() +} + +Gauge.prototype._handleSizeChange = function () { + this._gauge.setWidth(this._tty.columns - 1) + this._requestRedraw() +} + +Gauge.prototype._doRedraw = function () { + if (this._disabled || this._paused) return + if (!this._fixedFramerate) { + var now = Date.now() + if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return + this._lastUpdateAt = now + } + if (!this._showing && this._onScreen) { + this._onScreen = false + var result = this._gauge.hide() + if (this._hideCursor) { + result += this._gauge.showCursor() + } + return this._writeTo.write(result) + } + if (!this._showing && !this._onScreen) return + if (this._showing && !this._onScreen) { + this._onScreen = true + this._needsRedraw = true + if (this._hideCursor) { + this._writeTo.write(this._gauge.hideCursor()) + } + } + if (!this._needsRedraw) return + if (!this._writeTo.write(this._gauge.show(this._status))) { + this._paused = true + this._writeTo.on('drain', callWith(this, function () { + this._paused = false + this._doRedraw() + })) + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/package.json new file mode 100644 index 00000000..91eee1d6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/package.json @@ -0,0 +1,91 @@ +{ + "_from": "gauge@~2.7.3", + "_id": "gauge@2.7.4", + "_inBundle": false, + "_integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "_location": "/node-red-contrib-johnny-five/gauge", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "gauge@~2.7.3", + "name": "gauge", + "escapedName": "gauge", + "rawSpec": "~2.7.3", + "saveSpec": null, + "fetchSpec": "~2.7.3" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/npmlog" + ], + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "_shasum": "2c03405c7538c39d7eb37b317022e325fb018bf7", + "_spec": "gauge@~2.7.3", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/gauge/issues" + }, + "bundleDependencies": false, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "deprecated": false, + "description": "A terminal based horizontal guage", + "devDependencies": { + "readable-stream": "^2.0.6", + "require-inject": "^1.4.0", + "standard": "^7.1.2", + "tap": "^5.7.2", + "through2": "^2.0.0" + }, + "files": [ + "base-theme.js", + "CHANGELOG.md", + "error.js", + "has-color.js", + "index.js", + "LICENSE", + "package.json", + "plumbing.js", + "process.js", + "progress-bar.js", + "README.md", + "render-template.js", + "set-immediate.js", + "set-interval.js", + "spin.js", + "template-item.js", + "theme-set.js", + "themes.js", + "wide-truncate.js" + ], + "homepage": "https://github.com/iarna/gauge", + "keywords": [ + "progressbar", + "progress", + "gauge" + ], + "license": "ISC", + "main": "index.js", + "name": "gauge", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/gauge.git" + }, + "scripts": { + "prepublish": "rm -f *~", + "test": "standard && tap test/*.js --coverage" + }, + "version": "2.7.4" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/plumbing.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/plumbing.js new file mode 100644 index 00000000..1afb4af6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/plumbing.js @@ -0,0 +1,48 @@ +'use strict' +var consoleControl = require('console-control-strings') +var renderTemplate = require('./render-template.js') +var validate = require('aproba') + +var Plumbing = module.exports = function (theme, template, width) { + if (!width) width = 80 + validate('OAN', [theme, template, width]) + this.showing = false + this.theme = theme + this.width = width + this.template = template +} +Plumbing.prototype = {} + +Plumbing.prototype.setTheme = function (theme) { + validate('O', [theme]) + this.theme = theme +} + +Plumbing.prototype.setTemplate = function (template) { + validate('A', [template]) + this.template = template +} + +Plumbing.prototype.setWidth = function (width) { + validate('N', [width]) + this.width = width +} + +Plumbing.prototype.hide = function () { + return consoleControl.gotoSOL() + consoleControl.eraseLine() +} + +Plumbing.prototype.hideCursor = consoleControl.hideCursor + +Plumbing.prototype.showCursor = consoleControl.showCursor + +Plumbing.prototype.show = function (status) { + var values = Object.create(this.theme) + for (var key in status) { + values[key] = status[key] + } + + return renderTemplate(this.width, this.template, values).trim() + + consoleControl.color('reset') + + consoleControl.eraseLine() + consoleControl.gotoSOL() +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/process.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/process.js new file mode 100644 index 00000000..05e85694 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/process.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = process diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/progress-bar.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/progress-bar.js new file mode 100644 index 00000000..7f8dd68b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/progress-bar.js @@ -0,0 +1,35 @@ +'use strict' +var validate = require('aproba') +var renderTemplate = require('./render-template.js') +var wideTruncate = require('./wide-truncate') +var stringWidth = require('string-width') + +module.exports = function (theme, width, completed) { + validate('ONN', [theme, width, completed]) + if (completed < 0) completed = 0 + if (completed > 1) completed = 1 + if (width <= 0) return '' + var sofar = Math.round(width * completed) + var rest = width - sofar + var template = [ + {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, + {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} + ] + return renderTemplate(width, template, theme) +} + +// lodash's way of repeating +function repeat (string, width) { + var result = '' + var n = width + do { + if (n % 2) { + result += string + } + n = Math.floor(n / 2) + /*eslint no-self-assign: 0*/ + string += string + } while (n && stringWidth(result) < width) + + return wideTruncate(result, width) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/render-template.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/render-template.js new file mode 100644 index 00000000..3261bfbe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/render-template.js @@ -0,0 +1,181 @@ +'use strict' +var align = require('wide-align') +var validate = require('aproba') +var objectAssign = require('object-assign') +var wideTruncate = require('./wide-truncate') +var error = require('./error') +var TemplateItem = require('./template-item') + +function renderValueWithValues (values) { + return function (item) { + return renderValue(item, values) + } +} + +var renderTemplate = module.exports = function (width, template, values) { + var items = prepareItems(width, template, values) + var rendered = items.map(renderValueWithValues(values)).join('') + return align.left(wideTruncate(rendered, width), width) +} + +function preType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'pre' + cappedTypeName +} + +function postType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'post' + cappedTypeName +} + +function hasPreOrPost (item, values) { + if (!item.type) return + return values[preType(item)] || values[postType(item)] +} + +function generatePreAndPost (baseItem, parentValues) { + var item = objectAssign({}, baseItem) + var values = Object.create(parentValues) + var template = [] + var pre = preType(item) + var post = postType(item) + if (values[pre]) { + template.push({value: values[pre]}) + values[pre] = null + } + item.minLength = null + item.length = null + item.maxLength = null + template.push(item) + values[item.type] = values[item.type] + if (values[post]) { + template.push({value: values[post]}) + values[post] = null + } + return function ($1, $2, length) { + return renderTemplate(length, template, values) + } +} + +function prepareItems (width, template, values) { + function cloneAndObjectify (item, index, arr) { + var cloned = new TemplateItem(item, width) + var type = cloned.type + if (cloned.value == null) { + if (!(type in values)) { + if (cloned.default == null) { + throw new error.MissingTemplateValue(cloned, values) + } else { + cloned.value = cloned.default + } + } else { + cloned.value = values[type] + } + } + if (cloned.value == null || cloned.value === '') return null + cloned.index = index + cloned.first = index === 0 + cloned.last = index === arr.length - 1 + if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values) + return cloned + } + + var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) + + var outputLength = 0 + var remainingSpace = width + var variableCount = output.length + + function consumeSpace (length) { + if (length > remainingSpace) length = remainingSpace + outputLength += length + remainingSpace -= length + } + + function finishSizing (item, length) { + if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') + if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') + if (length != null) item.length = length + item.minLength = null + item.maxLength = null + --variableCount + item.finished = true + if (item.length == null) item.length = item.getBaseLength() + if (item.length == null) throw new error.Internal('Finished template items must have a length') + consumeSpace(item.getLength()) + } + + output.forEach(function (item) { + if (!item.kerning) return + var prevPadRight = item.first ? 0 : output[item.index - 1].padRight + if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight + if (!item.last) item.padRight = item.kerning + }) + + // Finish any that have a fixed (literal or intuited) length + output.forEach(function (item) { + if (item.getBaseLength() == null) return + finishSizing(item) + }) + + var resized = 0 + var resizing + var hunkSize + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.maxLength) return + if (item.getMaxLength() < hunkSize) { + finishSizing(item, item.maxLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + + resized = 0 + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.minLength) return + if (item.getMinLength() >= hunkSize) { + finishSizing(item, item.minLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + finishSizing(item, hunkSize) + }) + + return output +} + +function renderFunction (item, values, length) { + validate('OON', arguments) + if (item.type) { + return item.value(values, values[item.type + 'Theme'] || {}, length) + } else { + return item.value(values, {}, length) + } +} + +function renderValue (item, values) { + var length = item.getBaseLength() + var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value + if (value == null || value === '') return '' + var alignWith = align[item.align] || align.left + var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' + var rightPadding = item.padRight ? align.right('', item.padRight) : '' + var truncated = wideTruncate(String(value), length) + var aligned = alignWith(truncated, length) + return leftPadding + aligned + rightPadding +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/set-immediate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/set-immediate.js new file mode 100644 index 00000000..6650a485 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/set-immediate.js @@ -0,0 +1,7 @@ +'use strict' +var process = require('./process') +try { + module.exports = setImmediate +} catch (ex) { + module.exports = process.nextTick +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/set-interval.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/set-interval.js new file mode 100644 index 00000000..57619879 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/set-interval.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = setInterval diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/spin.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/spin.js new file mode 100644 index 00000000..34142ee3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/spin.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = function spin (spinstr, spun) { + return spinstr[spun % spinstr.length] +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/template-item.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/template-item.js new file mode 100644 index 00000000..e46f447c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/template-item.js @@ -0,0 +1,73 @@ +'use strict' +var stringWidth = require('string-width') + +module.exports = TemplateItem + +function isPercent (num) { + if (typeof num !== 'string') return false + return num.slice(-1) === '%' +} + +function percent (num) { + return Number(num.slice(0, -1)) / 100 +} + +function TemplateItem (values, outputLength) { + this.overallOutputLength = outputLength + this.finished = false + this.type = null + this.value = null + this.length = null + this.maxLength = null + this.minLength = null + this.kerning = null + this.align = 'left' + this.padLeft = 0 + this.padRight = 0 + this.index = null + this.first = null + this.last = null + if (typeof values === 'string') { + this.value = values + } else { + for (var prop in values) this[prop] = values[prop] + } + // Realize percents + if (isPercent(this.length)) { + this.length = Math.round(this.overallOutputLength * percent(this.length)) + } + if (isPercent(this.minLength)) { + this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) + } + if (isPercent(this.maxLength)) { + this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) + } + return this +} + +TemplateItem.prototype = {} + +TemplateItem.prototype.getBaseLength = function () { + var length = this.length + if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + length = stringWidth(this.value) + } + return length +} + +TemplateItem.prototype.getLength = function () { + var length = this.getBaseLength() + if (length == null) return null + return length + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMaxLength = function () { + if (this.maxLength == null) return null + return this.maxLength + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMinLength = function () { + if (this.minLength == null) return null + return this.minLength + this.padLeft + this.padRight +} + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/theme-set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/theme-set.js new file mode 100644 index 00000000..68971d5d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/theme-set.js @@ -0,0 +1,115 @@ +'use strict' +var objectAssign = require('object-assign') + +module.exports = function () { + return ThemeSetProto.newThemeSet() +} + +var ThemeSetProto = {} + +ThemeSetProto.baseTheme = require('./base-theme.js') + +ThemeSetProto.newTheme = function (parent, theme) { + if (!theme) { + theme = parent + parent = this.baseTheme + } + return objectAssign({}, parent, theme) +} + +ThemeSetProto.getThemeNames = function () { + return Object.keys(this.themes) +} + +ThemeSetProto.addTheme = function (name, parent, theme) { + this.themes[name] = this.newTheme(parent, theme) +} + +ThemeSetProto.addToAllThemes = function (theme) { + var themes = this.themes + Object.keys(themes).forEach(function (name) { + objectAssign(themes[name], theme) + }) + objectAssign(this.baseTheme, theme) +} + +ThemeSetProto.getTheme = function (name) { + if (!this.themes[name]) throw this.newMissingThemeError(name) + return this.themes[name] +} + +ThemeSetProto.setDefault = function (opts, name) { + if (name == null) { + name = opts + opts = {} + } + var platform = opts.platform == null ? 'fallback' : opts.platform + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + this.defaults[platform][hasUnicode][hasColor] = name +} + +ThemeSetProto.getDefault = function (opts) { + if (!opts) opts = {} + var platformName = opts.platform || process.platform + var platform = this.defaults[platformName] || this.defaults.fallback + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform[hasUnicode][hasColor]) { + if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { + hasUnicode = false + hasColor = false + } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (platform === this.defaults.fallback) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } + } + if (platform[hasUnicode][hasColor]) { + return this.getTheme(platform[hasUnicode][hasColor]) + } else { + return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + } +} + +ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { + var err = new Error('Could not find a gauge theme named "' + name + '"') + Error.captureStackTrace.call(err, newMissingThemeError) + err.theme = name + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + + ' platform = ' + platformName + '\n' + + ' hasUnicode = ' + hasUnicode + '\n' + + ' hasColor = ' + hasColor) + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newThemeSet = function () { + var themeset = function (opts) { + return themeset.getDefault(opts) + } + return objectAssign(themeset, ThemeSetProto, { + themes: objectAssign({}, this.themes), + baseTheme: objectAssign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})) + }) +} + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/themes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/themes.js new file mode 100644 index 00000000..eb5a4f5b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/themes.js @@ -0,0 +1,54 @@ +'use strict' +var consoleControl = require('console-control-strings') +var ThemeSet = require('./theme-set.js') + +var themes = module.exports = new ThemeSet() + +themes.addTheme('ASCII', { + preProgressbar: '[', + postProgressbar: ']', + progressbarTheme: { + complete: '#', + remaining: '.' + }, + activityIndicatorTheme: '-\\|/', + preSubsection: '>' +}) + +themes.addTheme('colorASCII', themes.getTheme('ASCII'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '.', + postRemaining: consoleControl.color('reset') + } +}) + +themes.addTheme('brailleSpinner', { + preProgressbar: '⸨', + postProgressbar: '⸩', + progressbarTheme: { + complete: '░', + remaining: '⠂' + }, + activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', + preSubsection: '>' +}) + +themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '░', + postRemaining: consoleControl.color('reset') + } +}) + +themes.setDefault({}, 'ASCII') +themes.setDefault({hasColor: true}, 'colorASCII') +themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/wide-truncate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/wide-truncate.js new file mode 100644 index 00000000..c531bc49 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/gauge/wide-truncate.js @@ -0,0 +1,25 @@ +'use strict' +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') + +module.exports = wideTruncate + +function wideTruncate (str, target) { + if (stringWidth(str) === 0) return str + if (target <= 0) return '' + if (stringWidth(str) <= target) return str + + // We compute the number of bytes of ansi sequences here and add + // that to our initial truncation to ensure that we don't slice one + // that we want to keep in half. + var noAnsi = stripAnsi(str) + var ansiSize = str.length + noAnsi.length + var truncated = str.slice(0, target + ansiSize) + + // we have to shrink the result to account for our ansi sequence buffer + // (if an ansi sequence was truncated) and double width characters. + while (stringWidth(truncated) > target) { + truncated = truncated.slice(0, -1) + } + return truncated +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/.travis.yml new file mode 100644 index 00000000..895dbd36 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/example/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/example/package.json new file mode 100644 index 00000000..03494f48 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/example/package.json @@ -0,0 +1,8 @@ +{ + "name": "beep-boop", + "version": "1.2.3", + "repository" : { + "type" : "git", + "url": "git@github.com:substack/beep-boop.git" + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/example/url.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/example/url.js new file mode 100644 index 00000000..138fb8a6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/example/url.js @@ -0,0 +1,3 @@ +var github = require('../'); +var url = github(require('./package.json')); +console.log(url); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/index.js new file mode 100644 index 00000000..3d1d657b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/index.js @@ -0,0 +1,17 @@ +module.exports = function (pkg) { + var m; + if (m = match(JSON.stringify(pkg.repository))) { + return m; + } + else if (m = match(JSON.stringify(pkg))) { + return m; + } + return undefined; +}; + +function match (str) { + var m = /\bgithub.com[:\/]([^\/"]+)\/([^\/"]+)/.exec(str); + if (m) { + return 'https://github.com/' + m[1] + '/' + m[2].replace(/\.git$/, ''); + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/package.json new file mode 100644 index 00000000..926cc8af --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/package.json @@ -0,0 +1,58 @@ +{ + "_from": "github-from-package@0.0.0", + "_id": "github-from-package@0.0.0", + "_inBundle": false, + "_integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", + "_location": "/node-red-contrib-johnny-five/github-from-package", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "github-from-package@0.0.0", + "name": "github-from-package", + "escapedName": "github-from-package", + "rawSpec": "0.0.0", + "saveSpec": null, + "fetchSpec": "0.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/prebuild-install" + ], + "_resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "_shasum": "97fb5d96bfde8973313f20e8288ef9a167fa64ce", + "_spec": "github-from-package@0.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/prebuild-install", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/github-from-package/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "return the github url from a package.json file", + "devDependencies": { + "tap": "~0.3.0", + "tape": "~0.1.5" + }, + "homepage": "https://github.com/substack/github-from-package", + "keywords": [ + "github", + "package.json", + "npm", + "repository" + ], + "license": "MIT", + "main": "index.js", + "name": "github-from-package", + "repository": { + "type": "git", + "url": "git://github.com/substack/github-from-package.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "0.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/readme.markdown b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/readme.markdown new file mode 100644 index 00000000..5ba397da --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/readme.markdown @@ -0,0 +1,53 @@ +# github-from-package + +return the github url from a package.json file + +[![build status](https://secure.travis-ci.org/substack/github-from-package.png)](http://travis-ci.org/substack/github-from-package) + +# example + +For the `./package.json` file: + +``` json +{ + "name": "beep-boop", + "version": "1.2.3", + "repository" : { + "type" : "git", + "url": "git@github.com:substack/beep-boop.git" + } +} +``` + +``` js +var github = require('github-from-package'); +var url = github(require('./package.json')); +console.log(url); +``` + +``` +https://github.com/substack/beep-boop +``` + +# methods + +``` js +var github = require('github-from-package') +``` + +## var url = github(pkg) + +Return the most likely github url from the package.json contents `pkg`. If no +github url can be determined, return `undefined`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install github-from-package +``` + +# license + +MIT diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/a.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/a.json new file mode 100644 index 00000000..03494f48 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/a.json @@ -0,0 +1,8 @@ +{ + "name": "beep-boop", + "version": "1.2.3", + "repository" : { + "type" : "git", + "url": "git@github.com:substack/beep-boop.git" + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/b.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/b.json new file mode 100644 index 00000000..02093257 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/b.json @@ -0,0 +1,5 @@ +{ + "name": "beep-boop", + "version": "1.2.3", + "repository" : "git@github.com:substack/beep-boop.git" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/c.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/c.json new file mode 100644 index 00000000..65f6ddad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/c.json @@ -0,0 +1,5 @@ +{ + "name": "beep-boop", + "version": "1.2.3", + "repository" : "https://github.com/substack/beep-boop.git" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/d.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/d.json new file mode 100644 index 00000000..c61f3cd3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/d.json @@ -0,0 +1,7 @@ +{ + "name": "beep-boop", + "version": "1.2.3", + "repository" : { + "url": "https://github.com/substack/beep-boop" + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/e.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/e.json new file mode 100644 index 00000000..770b4384 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/e.json @@ -0,0 +1,5 @@ +{ + "name": "beep-boop", + "version": "1.2.3", + "homepage": "https://github.com/substack/beep-boop/issues" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/url.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/url.js new file mode 100644 index 00000000..d5a0a667 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/github-from-package/test/url.js @@ -0,0 +1,19 @@ +var test = require('tape'); +var github = require('../'); +var packages = { + a : require('./a.json'), + b : require('./b.json'), + c : require('./c.json'), + d : require('./d.json'), + e : require('./e.json') +}; + +test(function (t) { + t.plan(5); + var url = 'https://github.com/substack/beep-boop'; + t.equal(url, github(packages.a), 'a.json comparison'); + t.equal(url, github(packages.b), 'b.json comparison'); + t.equal(url, github(packages.c), 'c.json comparison'); + t.equal(url, github(packages.d), 'd.json comparison'); + t.equal(url, github(packages.e), 'e.json comparison'); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/LICENSE new file mode 100644 index 00000000..734076d8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/README.md new file mode 100644 index 00000000..3bec5c78 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/README.md @@ -0,0 +1,109 @@ +glob-parent [![Build Status](https://travis-ci.org/es128/glob-parent.svg)](https://travis-ci.org/es128/glob-parent) [![Coverage Status](https://img.shields.io/coveralls/es128/glob-parent.svg)](https://coveralls.io/r/es128/glob-parent?branch=master) +====== +Javascript module to extract the non-magic parent path from a glob string. + +[![NPM](https://nodei.co/npm/glob-parent.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/glob-parent/) +[![NPM](https://nodei.co/npm-dl/glob-parent.png?height=3&months=9)](https://nodei.co/npm-dl/glob-parent/) + +Usage +----- +```sh +npm install glob-parent --save +``` + +**Examples** + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) +``` + +## Escaping + +The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: + +- `?` (question mark) +- `*` (star) +- `|` (pipe) +- `(` (opening parenthesis) +- `)` (closing parenthesis) +- `{` (opening curly brace) +- `}` (closing curly brace) +- `[` (opening bracket) +- `]` (closing bracket) + +**Example** + +```js +globParent('foo/[bar]/') // 'foo' +globParent('foo/\\[bar]/') // 'foo/[bar]' +``` + +## Limitations + +#### Braces & Brackets +This library attempts a quick and imperfect method of determining which path +parts have glob magic without fully parsing/lexing the pattern. There are some +advanced use cases that can trip it up, such as nested braces where the outer +pair is escaped and the inner one contains a path separator. If you find +yourself in the unlikely circumstance of being affected by this or need to +ensure higher-fidelity glob handling in your library, it is recommended that you +pre-process your input with [expand-braces] and/or [expand-brackets]. + +#### Windows +Backslashes are not valid path separators for globs. If a path with backslashes +is provided anyway, for simple cases, glob-parent will replace the path +separator for you and return the non-glob parent path (now with +forward-slashes, which are still valid as Windows path separators). + +This cannot be used in conjunction with escape characters. + +```js +// BAD +globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' + +// GOOD +globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' +``` + +If you are using escape characters for a pattern without path parts (i.e. +relative to `cwd`), prefix with `./` to avoid confusing glob-parent. + +```js +// BAD +globParent('foo \\[bar]') // 'foo ' +globParent('foo \\[bar]*') // 'foo ' + +// GOOD +globParent('./foo \\[bar]') // 'foo [bar]' +globParent('./foo \\[bar]*') // '.' +``` + + +Change Log +---------- +[See release notes page on GitHub](https://github.com/es128/glob-parent/releases) + +License +------- +[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE) + +[expand-braces]: https://github.com/jonschlinkert/expand-braces +[expand-brackets]: https://github.com/jonschlinkert/expand-brackets diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/index.js new file mode 100644 index 00000000..3a14a539 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/index.js @@ -0,0 +1,24 @@ +'use strict'; + +var path = require('path'); +var isglob = require('is-glob'); +var pathDirname = require('path-dirname'); +var isWin32 = require('os').platform() === 'win32'; + +module.exports = function globParent(str) { + // flip windows path separators + if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/'); + + // special case for strings ending in enclosure containing path separator + if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/'; + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do {str = pathDirname.posix(str)} + while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str)); + + // remove escape chars and return result + return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1'); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/package.json new file mode 100644 index 00000000..8477de35 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent/package.json @@ -0,0 +1,70 @@ +{ + "_from": "glob-parent@^3.1.0", + "_id": "glob-parent@3.1.0", + "_inBundle": false, + "_integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "_location": "/node-red-contrib-johnny-five/glob-parent", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-parent@^3.1.0", + "name": "glob-parent", + "escapedName": "glob-parent", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/glob-stream" + ], + "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "_shasum": "9e6af6299d8d3bd2bd40430832bd113df906c5ae", + "_spec": "glob-parent@^3.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream", + "author": { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + "bugs": { + "url": "https://github.com/es128/glob-parent/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "deprecated": false, + "description": "Strips glob magic from a string to provide the parent directory path", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.5", + "mocha": "^2.1.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/es128/glob-parent", + "keywords": [ + "glob", + "parent", + "strip", + "path", + "dirname", + "directory", + "base", + "wildcard" + ], + "license": "ISC", + "main": "index.js", + "name": "glob-parent", + "repository": { + "type": "git", + "url": "git+https://github.com/es128/glob-parent.git" + }, + "scripts": { + "ci-test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls", + "test": "istanbul test node_modules/mocha/bin/_mocha" + }, + "version": "3.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/LICENSE new file mode 100755 index 00000000..67fa13bd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017 Blaine Bublitz , Eric Schoffstall and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/README.md new file mode 100644 index 00000000..12c103ee --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/README.md @@ -0,0 +1,146 @@ +

+ + + +

+ +# glob-stream + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] + +A [Readable Stream][readable-stream-url] interface over [node-glob][node-glob-url]. + +## Usage + +```javascript +var gs = require('glob-stream'); + +var readable = gs('./files/**/*.coffee', { /* options */ }); + +var writable = /* your WriteableStream */ + +readable.pipe(writable); +``` + +You can pass any combination of glob strings. One caveat is that you cannot __only__ pass a negative glob, you must give it at least one positive glob so it knows where to start. If given a non-glob path (also referred to as a singular glob), only one file will be emitted. If given a singular glob and no files match, an error is emitted (see also [`options.allowEmpty`][allow-empty-url]). + +## API + +### `globStream(globs, options)` + +Takes a glob string or an array of glob strings as the first argument and an options object as the second. Returns a stream of objects that contain `cwd`, `base` and `path` properties. + +#### Options + +##### `options.allowEmpty` + +Whether or not to error upon an empty singular glob. + +Type: `Boolean` + +Default: `false` (error upon no match) + +##### `options.dot` + +Whether or not to treat dotfiles as regular files. This is passed through to [node-glob][node-glob-url]. + +Type: `Boolean` + +Default: `false` + +##### `options.silent` + +Whether or not to suppress warnings on stderr from [node-glob][node-glob-url]. This is passed through to [node-glob][node-glob-url]. + +Type: `Boolean` + +Default: `true` + +##### `options.cwd` + +The current working directory that the glob is resolved against. + +Type: `String` + +Default: `process.cwd()` + +##### `options.root` + +The root path that the glob is resolved against. + +__Note: This is never passed to [node-glob][node-glob-url] because it is pre-resolved against your paths.__ + +Type: `String` + +Default: `undefined` (use the filesystem root) + +##### `options.base` + +The absolute segment of the glob path that isn't a glob. This value is attached to each glob object and is useful for relative pathing. + +Type: `String` + +Default: The absolute path segement before a glob starts (see [glob-parent][glob-parent-url]) + +##### `options.cwdbase` + +Whether or not the `cwd` and `base` should be the same. + +Type: `Boolean` + +Default: `false` + +##### `options.uniqueBy` + +Filters stream to remove duplicates based on the string property name or the result of function. When using a function, the function receives the streamed data (objects containing `cwd`, `base`, `path` properties) to compare against. + +Type: `String` or `Function` + +Default: `'path'` + +##### other + +Any glob-related options are documented in [node-glob][node-glob-url]. Those options are forwarded verbatim, with the exception of `root` and `ignore`. `root` is pre-resolved and `ignore` is joined with all negative globs. + +#### Globbing & Negation + +```js +var stream = gs(['./**/*.js', '!./node_modules/**/*']); +``` + +Globs are executed in order, so negations should follow positive globs. For example: + +The following would __not__ exclude any files: +```js +gs(['!b*.js', '*.js']) +``` + +However, this would exclude all files that started with `b`: +```js +gs(['*.js', '!b*.js']) +``` + +## License + +MIT + +[node-glob-url]: https://github.com/isaacs/node-glob +[glob-parent-url]: https://github.com/es128/glob-parent +[allow-empty-url]: #optionsallowempty +[readable-stream-url]: https://nodejs.org/api/stream.html#stream_readable_streams + +[downloads-image]: http://img.shields.io/npm/dm/glob-stream.svg +[npm-url]: https://www.npmjs.com/package/glob-stream +[npm-image]: http://img.shields.io/npm/v/glob-stream.svg + +[travis-url]: https://travis-ci.org/gulpjs/glob-stream +[travis-image]: http://img.shields.io/travis/gulpjs/glob-stream.svg?label=travis-ci + +[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-stream +[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-stream.svg?label=appveyor + +[coveralls-url]: https://coveralls.io/r/gulpjs/glob-stream +[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glob-stream.svg + +[gitter-url]: https://gitter.im/gulpjs/gulp +[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/index.js new file mode 100644 index 00000000..dd012f6b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/index.js @@ -0,0 +1,94 @@ +'use strict'; + +var Combine = require('ordered-read-streams'); +var unique = require('unique-stream'); +var pumpify = require('pumpify'); +var isNegatedGlob = require('is-negated-glob'); +var extend = require('extend'); + +var GlobStream = require('./readable'); + +function globStream(globs, opt) { + if (!opt) { + opt = {}; + } + + var ourOpt = extend({}, opt); + var ignore = ourOpt.ignore; + + ourOpt.cwd = typeof ourOpt.cwd === 'string' ? ourOpt.cwd : process.cwd(); + ourOpt.dot = typeof ourOpt.dot === 'boolean' ? ourOpt.dot : false; + ourOpt.silent = typeof ourOpt.silent === 'boolean' ? ourOpt.silent : true; + ourOpt.cwdbase = typeof ourOpt.cwdbase === 'boolean' ? ourOpt.cwdbase : false; + ourOpt.uniqueBy = typeof ourOpt.uniqueBy === 'string' || + typeof ourOpt.uniqueBy === 'function' ? ourOpt.uniqueBy : 'path'; + + if (ourOpt.cwdbase) { + ourOpt.base = ourOpt.cwd; + } + // Normalize string `ignore` to array + if (typeof ignore === 'string') { + ignore = [ignore]; + } + // Ensure `ignore` is an array + if (!Array.isArray(ignore)) { + ignore = []; + } + + // Only one glob no need to aggregate + if (!Array.isArray(globs)) { + globs = [globs]; + } + + var positives = []; + var negatives = []; + + globs.forEach(sortGlobs); + + function sortGlobs(globString, index) { + if (typeof globString !== 'string') { + throw new Error('Invalid glob at index ' + index); + } + + var glob = isNegatedGlob(globString); + var globArray = glob.negated ? negatives : positives; + + globArray.push({ + index: index, + glob: glob.pattern, + }); + } + + if (positives.length === 0) { + throw new Error('Missing positive glob'); + } + + // Create all individual streams + var streams = positives.map(streamFromPositive); + + // Then just pipe them to a single unique stream and return it + var aggregate = new Combine(streams); + var uniqueStream = unique(ourOpt.uniqueBy); + + return pumpify.obj(aggregate, uniqueStream); + + function streamFromPositive(positive) { + var negativeGlobs = negatives + .filter(indexGreaterThan(positive.index)) + .map(toGlob) + .concat(ignore); + return new GlobStream(positive.glob, negativeGlobs, ourOpt); + } +} + +function indexGreaterThan(index) { + return function(obj) { + return obj.index > index; + }; +} + +function toGlob(obj) { + return obj.glob; +} + +module.exports = globStream; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/package.json new file mode 100644 index 00000000..937c22e5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/package.json @@ -0,0 +1,101 @@ +{ + "_from": "glob-stream@^6.1.0", + "_id": "glob-stream@6.1.0", + "_inBundle": false, + "_integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "_location": "/node-red-contrib-johnny-five/glob-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-stream@^6.1.0", + "name": "glob-stream", + "escapedName": "glob-stream", + "rawSpec": "^6.1.0", + "saveSpec": null, + "fetchSpec": "^6.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/help-me" + ], + "_resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "_shasum": "7045c99413b3eb94888d83ab46d0b404cc7bdde4", + "_spec": "glob-stream@^6.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/help-me", + "author": { + "name": "Gulp Team", + "email": "team@gulpjs.com", + "url": "http://gulpjs.com/" + }, + "bugs": { + "url": "https://github.com/gulpjs/glob-stream/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Eric Schoffstall", + "email": "yo@contra.io" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com" + } + ], + "dependencies": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "deprecated": false, + "description": "A Readable Stream interface over node-glob.", + "devDependencies": { + "eslint": "^1.10.3", + "eslint-config-gulp": "^2.0.0", + "expect": "^1.19.0", + "istanbul": "^0.4.3", + "istanbul-coveralls": "^1.0.3", + "jscs": "^2.4.0", + "jscs-preset-gulp": "^1.0.0", + "mississippi": "^1.2.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "index.js", + "readable.js", + "LICENSE" + ], + "homepage": "https://github.com/gulpjs/glob-stream#readme", + "keywords": [ + "glob", + "stream", + "gulp", + "readable", + "fs", + "files" + ], + "license": "MIT", + "main": "index.js", + "name": "glob-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/gulpjs/glob-stream.git" + }, + "scripts": { + "cover": "istanbul cover _mocha --report lcovonly", + "coveralls": "npm run cover && istanbul-coveralls", + "lint": "eslint . && jscs index.js readable.js test/", + "pretest": "npm run lint", + "test": "mocha --async-only" + }, + "version": "6.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/readable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/readable.js new file mode 100644 index 00000000..36cf7b67 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream/readable.js @@ -0,0 +1,117 @@ +'use strict'; + +var inherits = require('util').inherits; + +var glob = require('glob'); +var extend = require('extend'); +var Readable = require('readable-stream').Readable; +var globParent = require('glob-parent'); +var toAbsoluteGlob = require('to-absolute-glob'); +var removeTrailingSeparator = require('remove-trailing-separator'); + +var globErrMessage1 = 'File not found with singular glob: '; +var globErrMessage2 = ' (if this was purposeful, use `allowEmpty` option)'; + +function getBasePath(ourGlob, opt) { + return globParent(toAbsoluteGlob(ourGlob, opt)); +} + +function globIsSingular(glob) { + var globSet = glob.minimatch.set; + if (globSet.length !== 1) { + return false; + } + + return globSet[0].every(function isString(value) { + return typeof value === 'string'; + }); +} + +function GlobStream(ourGlob, negatives, opt) { + if (!(this instanceof GlobStream)) { + return new GlobStream(ourGlob, negatives, opt); + } + + var ourOpt = extend({}, opt); + + Readable.call(this, { + objectMode: true, + highWaterMark: ourOpt.highWaterMark || 16, + }); + + // Delete `highWaterMark` after inheriting from Readable + delete ourOpt.highWaterMark; + + var self = this; + + function resolveNegatives(negative) { + return toAbsoluteGlob(negative, ourOpt); + } + + var ourNegatives = negatives.map(resolveNegatives); + ourOpt.ignore = ourNegatives; + + var cwd = ourOpt.cwd; + var allowEmpty = ourOpt.allowEmpty || false; + + // Extract base path from glob + var basePath = ourOpt.base || getBasePath(ourGlob, ourOpt); + + // Remove path relativity to make globs make sense + ourGlob = toAbsoluteGlob(ourGlob, ourOpt); + // Delete `root` after all resolving done + delete ourOpt.root; + + var globber = new glob.Glob(ourGlob, ourOpt); + this._globber = globber; + + var found = false; + + globber.on('match', function(filepath) { + found = true; + var obj = { + cwd: cwd, + base: basePath, + path: removeTrailingSeparator(filepath), + }; + if (!self.push(obj)) { + globber.pause(); + } + }); + + globber.once('end', function() { + if (allowEmpty !== true && !found && globIsSingular(globber)) { + var err = new Error(globErrMessage1 + ourGlob + globErrMessage2); + + return self.destroy(err); + } + + self.push(null); + }); + + function onError(err) { + self.destroy(err); + } + + globber.once('error', onError); +} +inherits(GlobStream, Readable); + +GlobStream.prototype._read = function() { + this._globber.resume(); +}; + +GlobStream.prototype.destroy = function(err) { + var self = this; + + this._globber.abort(); + + process.nextTick(function() { + if (err) { + self.emit('error', err); + } + self.emit('close'); + }); +}; + +module.exports = GlobStream; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/LICENSE new file mode 100644 index 00000000..42ca266d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/README.md new file mode 100644 index 00000000..e71b967e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/README.md @@ -0,0 +1,373 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/common.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/common.js new file mode 100644 index 00000000..66651bb3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/glob.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/glob.js new file mode 100644 index 00000000..58dec0f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/package.json new file mode 100644 index 00000000..9ea834ba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/package.json @@ -0,0 +1,76 @@ +{ + "_from": "glob@^7.1.1", + "_id": "glob@7.1.4", + "_inBundle": false, + "_integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "_location": "/node-red-contrib-johnny-five/glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob@^7.1.1", + "name": "glob", + "escapedName": "glob", + "rawSpec": "^7.1.1", + "saveSpec": null, + "fetchSpec": "^7.1.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/glob-stream" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "_shasum": "aa608a2f6c577ad357e1ae5a5c26d9a8d1969255", + "_spec": "glob@^7.1.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "deprecated": false, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^12.0.1", + "tick": "0.0.6" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "name": "glob", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.1.4" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/sync.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/sync.js new file mode 100644 index 00000000..c952134b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/index.js new file mode 100644 index 00000000..68820307 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/index.js @@ -0,0 +1,10 @@ +'use strict'; +module.exports = function (flag, argv) { + argv = argv || process.argv; + + var terminatorPos = argv.indexOf('--'); + var prefix = /^-{1,2}/.test(flag) ? '' : '--'; + var pos = argv.indexOf(prefix + flag); + + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/license b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/package.json new file mode 100644 index 00000000..9198f746 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/package.json @@ -0,0 +1,93 @@ +{ + "_from": "has-flag@^2.0.0", + "_id": "has-flag@2.0.0", + "_inBundle": false, + "_integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "_location": "/node-red-contrib-johnny-five/has-flag", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-flag@^2.0.0", + "name": "has-flag", + "escapedName": "has-flag", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/supports-color" + ], + "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "_shasum": "e8207af1cc7b30d446cc70b734b5e8be18f88d51", + "_spec": "has-flag@^2.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-flag/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if argv has a specific flag", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-flag#readme", + "keywords": [ + "has", + "check", + "detect", + "contains", + "find", + "flag", + "cli", + "command-line", + "argv", + "process", + "arg", + "args", + "argument", + "arguments", + "getopt", + "minimist", + "optimist" + ], + "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": "has-flag", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-flag.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/readme.md new file mode 100644 index 00000000..0caca6cb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-flag/readme.md @@ -0,0 +1,67 @@ +# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) + +> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag + +Correctly stops looking after an `--` argument terminator. + + +## Install + +``` +$ npm install --save has-flag +``` + + +## Usage + +```js +// foo.js +const hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` + +``` +$ node foo.js -f --unicorn --foo=bar -- --rainbow +``` + + +## API + +### hasFlag(flag, [argv]) + +Returns a boolean whether the flag exists. + +#### flag + +Type: `string` + +CLI flag to look for. The `--` prefix is optional. + +#### argv + +Type: `array`
+Default: `process.argv` + +CLI arguments. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/LICENSE new file mode 100644 index 00000000..d42e25e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/README.md new file mode 100644 index 00000000..5a03e599 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/README.md @@ -0,0 +1,43 @@ +has-unicode +=========== + +Try to guess if your terminal supports unicode + +```javascript +var hasUnicode = require("has-unicode") + +if (hasUnicode()) { + // the terminal probably has unicode support +} +``` +```javascript +var hasUnicode = require("has-unicode").tryHarder +hasUnicode(function(unicodeSupported) { + if (unicodeSupported) { + // the terminal probably has unicode support + } +}) +``` + +## Detecting Unicode + +What we actually detect is UTF-8 support, as that's what Node itself supports. +If you have a UTF-16 locale then you won't be detected as unicode capable. + +### Windows + +Since at least Windows 7, `cmd` and `powershell` have been unicode capable, +but unfortunately even then it's not guaranteed. In many localizations it +still uses legacy code pages and there's no facility short of running +programs or linking C++ that will let us detect this. As such, we +report any Windows installation as NOT unicode capable, and recommend +that you encourage your users to override this via config. + +### Unix Like Operating Systems + +We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient +for most POSIX systems. While locale data can be put in `/etc/locale.conf` +as well, AFAIK it's always copied into the environment. + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/index.js new file mode 100644 index 00000000..9b0fe445 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/index.js @@ -0,0 +1,16 @@ +"use strict" +var os = require("os") + +var hasUnicode = module.exports = function () { + // Recent Win32 platforms (>XP) CAN support unicode in the console but + // don't have to, and in non-english locales often use traditional local + // code pages. There's no way, short of windows system calls or execing + // the chcp command line program to figure this out. As such, we default + // this to false and encourage your users to override it via config if + // appropriate. + if (os.type() == "Windows_NT") { return false } + + var isUTF8 = /UTF-?8$/i + var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG + return isUTF8.test(ctype) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/package.json new file mode 100644 index 00000000..61f4d0a1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/has-unicode/package.json @@ -0,0 +1,58 @@ +{ + "_from": "has-unicode@^2.0.0", + "_id": "has-unicode@2.0.1", + "_inBundle": false, + "_integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "_location": "/node-red-contrib-johnny-five/has-unicode", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-unicode@^2.0.0", + "name": "has-unicode", + "escapedName": "has-unicode", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/gauge" + ], + "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "_shasum": "e0e6fe6a28cf51138855e086d1691e771de2a8b9", + "_spec": "has-unicode@^2.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/has-unicode/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Try to guess if your terminal supports unicode", + "devDependencies": { + "require-inject": "^1.3.0", + "tap": "^2.3.1" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/iarna/has-unicode", + "keywords": [ + "unicode", + "terminal" + ], + "license": "ISC", + "main": "index.js", + "name": "has-unicode", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/has-unicode.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.0.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/.npmignore new file mode 100644 index 00000000..59d842ba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/.npmignore @@ -0,0 +1,28 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/.travis.yml new file mode 100644 index 00000000..248640e0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +sudo: false +node_js: +- '0.10' +- '0.12' +- '4' +- '5' +- '6' +- '7' +script: + - npm test diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/LICENSE new file mode 100644 index 00000000..fb5dd6c6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Matteo Collina + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/README.md new file mode 100644 index 00000000..1c30958b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/README.md @@ -0,0 +1,50 @@ +help-me +======= + +Help command for node, to use with [minimist](http://npm.im/minimist) and [commist](http://npm.im/commist). + +Example +------- + +```js +'use strict' + +var helpMe = require('help-me') +var help = helpMe({ + // the default + dir: path.join(path.dirname(require.main.filename), 'doc'), + // the default + ext: '.txt' +}) + +help + .createStream(['hello']) // can support also strings + .pipe(process.stdout) + +// little helper to do the same +help.toStdout(['hello'] +``` + +Usage with commist +------------------ + +[Commist](http://npm.im/commist) provide a command system for node. + +```js +var commist = require('commist')() +var help = require('help-me')() + +commist.register('help', help.toStdout) + +commist.parse(process.argv.splice(2)) +``` + +Acknowledgements +---------------- + +This project was kindly sponsored by [nearForm](http://nearform.com). + +License +------- + +MIT diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/doc/hello.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/doc/hello.txt new file mode 100644 index 00000000..b2e26f89 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/doc/hello.txt @@ -0,0 +1 @@ +this is hello world diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/doc/help.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/doc/help.txt new file mode 100644 index 00000000..ccc3e7b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/doc/help.txt @@ -0,0 +1 @@ +aaaaa diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/example.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/example.js new file mode 100644 index 00000000..644ba4fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/example.js @@ -0,0 +1,8 @@ +'use strict' + +var commist = require('commist')() +var help = require('./')() + +commist.register('help', help.toStdout) + +commist.parse(process.argv.splice(2)) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/basic/hello.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/basic/hello.txt new file mode 100644 index 00000000..8f43ac9a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/basic/hello.txt @@ -0,0 +1 @@ +ahdsadhdash diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/basic/help.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/basic/help.txt new file mode 100644 index 00000000..3b18e512 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/basic/help.txt @@ -0,0 +1 @@ +hello world diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/dir/a/b.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/dir/a/b.txt new file mode 100644 index 00000000..e69de29b diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/no-ext/hello b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/no-ext/hello new file mode 100644 index 00000000..c91d5140 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/no-ext/hello @@ -0,0 +1 @@ +ghghghhg diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/abcde fghi lmno.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/abcde fghi lmno.txt new file mode 100644 index 00000000..509318c1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/abcde fghi lmno.txt @@ -0,0 +1 @@ +ewweqjewqjewqj diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/abcde hello.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/abcde hello.txt new file mode 100644 index 00000000..40225376 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/abcde hello.txt @@ -0,0 +1 @@ +45678 diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/hello world.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/hello world.txt new file mode 100644 index 00000000..e56e15bb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/fixture/shortnames/hello world.txt @@ -0,0 +1 @@ +12345 diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/help-me.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/help-me.js new file mode 100644 index 00000000..a3d488ac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/help-me.js @@ -0,0 +1,85 @@ +'use strict' + +var fs = require('fs') +var path = require('path') +var through = require('through2') +var globStream = require('glob-stream') +var concat = require('callback-stream') +var xtend = require('xtend') + +var defaults = { + dir: path.join(path.dirname(require.main.filename), 'doc'), + ext: '.txt', + help: 'help' +} + +function helpMe (opts) { + opts = xtend(defaults, opts) + + if (!opts.dir) { + throw new Error('missing directory') + } + + return { + createStream: createStream, + toStdout: toStdout + } + + function createStream (args) { + if (typeof args === 'string') { + args = args.split(' ') + } else if (!args || args.length === 0) { + args = [opts.help] + } + + var out = through() + var gs = globStream([opts.dir + '/**/*' + opts.ext]) + var re = new RegExp(args.map(function (arg) { + return arg + '[a-zA-Z0-9]*' + }).join('[ /]+')) + + gs.pipe(concat({ objectMode: true }, function (err, files) { + if (err) return out.emit('error', err) + + files = files.map(function (file) { + file.relative = file.path.replace(file.base, '').replace(/^\//, '') + return file + }).filter(function (file) { + return file.relative.match(re) + }) + + if (files.length === 0) { + return out.emit('error', new Error('no such help file')) + } else if (files.length > 1) { + out.write('There are ' + files.length + ' help pages ') + out.write('that matches the given request, please disambiguate:\n') + files.forEach(function (file) { + out.write(' * ') + out.write(file.relative.replace(opts.ext, '')) + out.write('\n') + }) + out.end() + return + } + + fs.createReadStream(files[0].path) + .on('error', function (err) { + out.emit('error', err) + }) + .pipe(out) + })) + + return out + } + + function toStdout (args) { + createStream(args) + .on('error', function () { + console.log('no such help file\n') + toStdout() + }) + .pipe(process.stdout) + } +} + +module.exports = helpMe diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/package.json new file mode 100644 index 00000000..1cda83b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/package.json @@ -0,0 +1,67 @@ +{ + "_from": "help-me@^1.0.1", + "_id": "help-me@1.1.0", + "_inBundle": false, + "_integrity": "sha1-jy1QjQYAtKRW2i8IZVbn5cBWo8Y=", + "_location": "/node-red-contrib-johnny-five/help-me", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "help-me@^1.0.1", + "name": "help-me", + "escapedName": "help-me", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/mqtt" + ], + "_resolved": "https://registry.npmjs.org/help-me/-/help-me-1.1.0.tgz", + "_shasum": "8f2d508d0600b4a456da2f086556e7e5c056a3c6", + "_spec": "help-me@^1.0.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/mqtt", + "author": { + "name": "Matteo Collina", + "email": "hello@matteocollina.com" + }, + "bugs": { + "url": "https://github.com/mcollina/help-me/issues" + }, + "bundleDependencies": false, + "dependencies": { + "callback-stream": "^1.0.2", + "glob-stream": "^6.1.0", + "through2": "^2.0.1", + "xtend": "^4.0.0" + }, + "deprecated": false, + "description": "Help command for node, partner of minimist and commist", + "devDependencies": { + "commist": "^1.0.0", + "concat-stream": "^1.4.7", + "faucet": "0.0.1", + "pre-commit": "^1.1.3", + "standard": "^9.0.0", + "tape": "^4.6.0" + }, + "homepage": "https://github.com/mcollina/help-me", + "keywords": [ + "help", + "command", + "minimist", + "commist" + ], + "license": "MIT", + "main": "help-me.js", + "name": "help-me", + "repository": { + "type": "git", + "url": "git+https://github.com/mcollina/help-me.git" + }, + "scripts": { + "test": "standard && node test.js | faucet" + }, + "version": "1.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/test.js new file mode 100644 index 00000000..3e945167 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/help-me/test.js @@ -0,0 +1,193 @@ +'use strict' + +var test = require('tape') +var concat = require('concat-stream') +var fs = require('fs') +var helpMe = require('./') + +test('show the doc/help.txt from the require.main folder if no options are passed', function (t) { + t.plan(2) + + helpMe() + .createStream() + .pipe(concat(function (data) { + fs.readFile('./doc/help.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) +}) + +test('show a generic help.txt from a folder to a stream', function (t) { + t.plan(2) + + helpMe({ + dir: 'fixture/basic' + }).createStream() + .pipe(concat(function (data) { + fs.readFile('fixture/basic/help.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) +}) + +test('custom help command with an array', function (t) { + t.plan(2) + + helpMe({ + dir: 'fixture/basic' + }).createStream(['hello']) + .pipe(concat(function (data) { + fs.readFile('fixture/basic/hello.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) +}) + +test('custom help command without an ext', function (t) { + t.plan(2) + + helpMe({ + dir: 'fixture/no-ext', + ext: '' + }).createStream(['hello']) + .pipe(concat(function (data) { + fs.readFile('fixture/no-ext/hello', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) +}) + +test('custom help command with a string', function (t) { + t.plan(2) + + helpMe({ + dir: 'fixture/basic' + }).createStream('hello') + .pipe(concat(function (data) { + fs.readFile('fixture/basic/hello.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) +}) + +test('missing help file', function (t) { + t.plan(1) + + helpMe({ + dir: 'fixture/basic' + }).createStream('abcde') + .on('error', function (err) { + t.equal(err.message, 'no such help file') + }) + .resume() +}) + +test('custom help command with an array', function (t) { + var helper = helpMe({ + dir: 'fixture/shortnames' + }) + + t.test('abbreviates two words in one', function (t) { + t.plan(2) + + helper + .createStream(['world']) + .pipe(concat(function (data) { + fs.readFile('fixture/shortnames/hello world.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) + }) + + t.test('abbreviates three words in two', function (t) { + t.plan(2) + + helper + .createStream(['abcde', 'fghi']) + .pipe(concat(function (data) { + fs.readFile('fixture/shortnames/abcde fghi lmno.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) + }) + + t.test('abbreviates a word', function (t) { + t.plan(2) + + helper + .createStream(['abc', 'fg']) + .pipe(concat(function (data) { + fs.readFile('fixture/shortnames/abcde fghi lmno.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) + }) + + t.test('abbreviates a word using strings', function (t) { + t.plan(2) + + helper + .createStream('abc fg') + .pipe(concat(function (data) { + fs.readFile('fixture/shortnames/abcde fghi lmno.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) + }) + + t.test('print a disambiguation', function (t) { + t.plan(1) + + var expected = '' + + 'There are 2 help pages that matches the given request, please disambiguate:\n' + + ' * abcde fghi lmno\n' + + ' * abcde hello\n' + + helper + .createStream(['abc']) + .pipe(concat({ encoding: 'string' }, function (data) { + t.equal(data, expected) + })) + }) +}) + +test('support for help files organized in folders', function (t) { + var helper = helpMe({ + dir: 'fixture/dir' + }) + + t.test('passing an array', function (t) { + t.plan(2) + + helper + .createStream(['a', 'b']) + .pipe(concat(function (data) { + fs.readFile('fixture/dir/a/b.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) + }) + + t.test('passing a string', function (t) { + t.plan(2) + + helper + .createStream('a b') + .pipe(concat(function (data) { + fs.readFile('fixture/dir/a/b.txt', function (err, expected) { + t.error(err) + t.equal(data.toString(), expected.toString()) + }) + })) + }) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/README.md new file mode 100644 index 00000000..6dc89291 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/inflight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/inflight.js new file mode 100644 index 00000000..48202b3c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/package.json new file mode 100644 index 00000000..74a34269 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inflight/package.json @@ -0,0 +1,58 @@ +{ + "_from": "inflight@^1.0.4", + "_id": "inflight@1.0.6", + "_inBundle": false, + "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "_location": "/node-red-contrib-johnny-five/inflight", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inflight@^1.0.4", + "name": "inflight", + "escapedName": "inflight", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "_spec": "inflight@^1.0.4", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "bundleDependencies": false, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "deprecated": false, + "description": "Add callbacks to requests in flight to avoid async duplication", + "devDependencies": { + "tap": "^7.1.2" + }, + "files": [ + "inflight.js" + ], + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "name": "inflight", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/inflight.git" + }, + "scripts": { + "test": "tap test.js --100" + }, + "version": "1.0.6" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/LICENSE new file mode 100644 index 00000000..dea3013d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/README.md new file mode 100644 index 00000000..b1c56658 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/inherits.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/inherits.js new file mode 100644 index 00000000..3b94763a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/inherits.js @@ -0,0 +1,7 @@ +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/inherits_browser.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/inherits_browser.js new file mode 100644 index 00000000..c1e78a75 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/package.json new file mode 100644 index 00000000..ca662b59 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/inherits/package.json @@ -0,0 +1,69 @@ +{ + "_from": "inherits@~2.0.3", + "_id": "inherits@2.0.3", + "_inBundle": false, + "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "_location": "/node-red-contrib-johnny-five/inherits", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inherits@~2.0.3", + "name": "inherits", + "escapedName": "inherits", + "rawSpec": "~2.0.3", + "saveSpec": null, + "fetchSpec": "~2.0.3" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/callback-stream", + "/node-red-contrib-johnny-five/concat-stream", + "/node-red-contrib-johnny-five/duplexify", + "/node-red-contrib-johnny-five/glob", + "/node-red-contrib-johnny-five/mqtt", + "/node-red-contrib-johnny-five/mqtt-packet", + "/node-red-contrib-johnny-five/pumpify", + "/node-red-contrib-johnny-five/readable-stream", + "/node-red-contrib-johnny-five/websocket-stream" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_spec": "inherits@~2.0.3", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/readable-stream", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^7.1.0" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.0.3" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/README.md new file mode 100644 index 00000000..33df2582 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/README.md @@ -0,0 +1,102 @@ +An ini format parser and serializer for node. + +Sections are treated as nested objects. Items before the first +heading are saved on the object directly. + +## Usage + +Consider an ini-file `config.ini` that looks like this: + + ; this comment is being ignored + scope = global + + [database] + user = dbuser + password = dbpassword + database = use_this_database + + [paths.default] + datadir = /var/lib/data + array[] = first value + array[] = second value + array[] = third value + +You can read, manipulate and write the ini-file like so: + + var fs = require('fs') + , ini = require('ini') + + var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8')) + + config.scope = 'local' + config.database.database = 'use_another_database' + config.paths.default.tmpdir = '/tmp' + delete config.paths.default.datadir + config.paths.default.array.push('fourth value') + + fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' })) + +This will result in a file called `config_modified.ini` being written +to the filesystem with the following content: + + [section] + scope=local + [section.database] + user=dbuser + password=dbpassword + database=use_another_database + [section.paths.default] + tmpdir=/tmp + array[]=first value + array[]=second value + array[]=third value + array[]=fourth value + + +## API + +### decode(inistring) + +Decode the ini-style formatted `inistring` into a nested object. + +### parse(inistring) + +Alias for `decode(inistring)` + +### encode(object, [options]) + +Encode the object `object` into an ini-style formatted string. If the +optional parameter `section` is given, then all top-level properties +of the object are put into this section and the `section`-string is +prepended to all sub-sections, see the usage example above. + +The `options` object may contain the following: + +* `section` A string which will be the first `section` in the encoded + ini data. Defaults to none. +* `whitespace` Boolean to specify whether to put whitespace around the + `=` character. By default, whitespace is omitted, to be friendly to + some persnickety old parsers that don't tolerate it well. But some + find that it's more human-readable and pretty with the whitespace. + +For backwards compatibility reasons, if a `string` options is passed +in, then it is assumed to be the `section` value. + +### stringify(object, [options]) + +Alias for `encode(object, [options])` + +### safe(val) + +Escapes the string `val` such that it is safe to be used as a key or +value in an ini-file. Basically escapes quotes. For example + + ini.safe('"unsafe string"') + +would result in + + "\"unsafe string\"" + +### unsafe(val) + +Unescapes the string `val` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/ini.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/ini.js new file mode 100644 index 00000000..590195dd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/ini.js @@ -0,0 +1,194 @@ +exports.parse = exports.decode = decode + +exports.stringify = exports.encode = encode + +exports.safe = safe +exports.unsafe = unsafe + +var eol = typeof process !== 'undefined' && + process.platform === 'win32' ? '\r\n' : '\n' + +function encode (obj, opt) { + var children = [] + var out = '' + + if (typeof opt === 'string') { + opt = { + section: opt, + whitespace: false + } + } else { + opt = opt || {} + opt.whitespace = opt.whitespace === true + } + + var separator = opt.whitespace ? ' = ' : '=' + + Object.keys(obj).forEach(function (k, _, __) { + var val = obj[k] + if (val && Array.isArray(val)) { + val.forEach(function (item) { + out += safe(k + '[]') + separator + safe(item) + '\n' + }) + } else if (val && typeof val === 'object') { + children.push(k) + } else { + out += safe(k) + separator + safe(val) + eol + } + }) + + if (opt.section && out.length) { + out = '[' + safe(opt.section) + ']' + eol + out + } + + children.forEach(function (k, _, __) { + var nk = dotSplit(k).join('\\.') + var section = (opt.section ? opt.section + '.' : '') + nk + var child = encode(obj[k], { + section: section, + whitespace: opt.whitespace + }) + if (out.length && child.length) { + out += eol + } + out += child + }) + + return out +} + +function dotSplit (str) { + return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') + .replace(/\\\./g, '\u0001') + .split(/\./).map(function (part) { + return part.replace(/\1/g, '\\.') + .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') + }) +} + +function decode (str) { + var out = {} + var p = out + var section = null + // section |key = value + var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i + var lines = str.split(/[\r\n]+/g) + + lines.forEach(function (line, _, __) { + if (!line || line.match(/^\s*[;#]/)) return + var match = line.match(re) + if (!match) return + if (match[1] !== undefined) { + section = unsafe(match[1]) + p = out[section] = out[section] || {} + return + } + var key = unsafe(match[2]) + var value = match[3] ? unsafe(match[4]) : true + switch (value) { + case 'true': + case 'false': + case 'null': value = JSON.parse(value) + } + + // Convert keys with '[]' suffix to an array + if (key.length > 2 && key.slice(-2) === '[]') { + key = key.substring(0, key.length - 2) + if (!p[key]) { + p[key] = [] + } else if (!Array.isArray(p[key])) { + p[key] = [p[key]] + } + } + + // safeguard against resetting a previously defined + // array by accidentally forgetting the brackets + if (Array.isArray(p[key])) { + p[key].push(value) + } else { + p[key] = value + } + }) + + // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} + // use a filter to return the keys that have to be deleted. + Object.keys(out).filter(function (k, _, __) { + if (!out[k] || + typeof out[k] !== 'object' || + Array.isArray(out[k])) { + return false + } + // see if the parent section is also an object. + // if so, add it to that, and mark this one for deletion + var parts = dotSplit(k) + var p = out + var l = parts.pop() + var nl = l.replace(/\\\./g, '.') + parts.forEach(function (part, _, __) { + if (!p[part] || typeof p[part] !== 'object') p[part] = {} + p = p[part] + }) + if (p === out && nl === l) { + return false + } + p[nl] = out[k] + return true + }).forEach(function (del, _, __) { + delete out[del] + }) + + return out +} + +function isQuoted (val) { + return (val.charAt(0) === '"' && val.slice(-1) === '"') || + (val.charAt(0) === "'" && val.slice(-1) === "'") +} + +function safe (val) { + return (typeof val !== 'string' || + val.match(/[=\r\n]/) || + val.match(/^\[/) || + (val.length > 1 && + isQuoted(val)) || + val !== val.trim()) + ? JSON.stringify(val) + : val.replace(/;/g, '\\;').replace(/#/g, '\\#') +} + +function unsafe (val, doUnesc) { + val = (val || '').trim() + if (isQuoted(val)) { + // remove the single quotes before calling JSON.parse + if (val.charAt(0) === "'") { + val = val.substr(1, val.length - 2) + } + try { val = JSON.parse(val) } catch (_) {} + } else { + // walk the val to find the first not-escaped ; character + var esc = false + var unesc = '' + for (var i = 0, l = val.length; i < l; i++) { + var c = val.charAt(i) + if (esc) { + if ('\\;#'.indexOf(c) !== -1) { + unesc += c + } else { + unesc += '\\' + c + } + esc = false + } else if (';#'.indexOf(c) !== -1) { + break + } else if (c === '\\') { + esc = true + } else { + unesc += c + } + } + if (esc) { + unesc += '\\' + } + return unesc.trim() + } + return val +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/package.json new file mode 100644 index 00000000..ca82d89b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ini/package.json @@ -0,0 +1,63 @@ +{ + "_from": "ini@~1.3.0", + "_id": "ini@1.3.5", + "_inBundle": false, + "_integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "_location": "/node-red-contrib-johnny-five/ini", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ini@~1.3.0", + "name": "ini", + "escapedName": "ini", + "rawSpec": "~1.3.0", + "saveSpec": null, + "fetchSpec": "~1.3.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/rc" + ], + "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "_shasum": "eee25f56db1c9ec6085e0c22778083f596abf927", + "_spec": "ini@~1.3.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/rc", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/ini/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "An ini encoder/decoder for node", + "devDependencies": { + "standard": "^10.0.3", + "tap": "^10.7.3 || 11" + }, + "engines": { + "node": "*" + }, + "files": [ + "ini.js" + ], + "homepage": "https://github.com/isaacs/ini#readme", + "license": "ISC", + "main": "ini.js", + "name": "ini", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/ini.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "pretest": "standard ini.js", + "preversion": "npm test", + "test": "tap test/*.js --100 -J" + }, + "version": "1.3.5" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/LICENSE new file mode 100644 index 00000000..44cf43b2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. +Copyright (c) 2009-2014, TJ Holowaychuk + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/README.md new file mode 100644 index 00000000..edc1ceb7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/README.md @@ -0,0 +1,114 @@ +# is-absolute [![NPM version](https://img.shields.io/npm/v/is-absolute.svg?style=flat)](https://www.npmjs.com/package/is-absolute) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-absolute.svg?style=flat)](https://npmjs.org/package/is-absolute) [![NPM total downloads](https://img.shields.io/npm/dt/is-absolute.svg?style=flat)](https://npmjs.org/package/is-absolute) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-absolute.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-absolute) + +> Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-absolute +``` + +Originally based on the `isAbsolute` utility method in [express](https://github.com/visionmedia/express). + +## Usage + +```js +var isAbsolute = require('is-absolute'); + +isAbsolute('a/b/c.js'); +//=> 'false' +isAbsolute('/a/b/c.js'); +//=> 'true' +``` + +**Explicitly test windows paths** + +```js +isAbsolute.posix('/foo/bar'); +isAbsolute.posix('/user/docs/Letter.txt'); +//=> true + +isAbsolute.posix('foo/bar'); +//=> false +``` + +**Explicitly test windows paths** + +```js +var isAbsolute = require('is-absolute'); + +isAbsolute.win32('c:\\'); +isAbsolute.win32('//C://user\\docs\\Letter.txt'); +isAbsolute.win32('\\\\unc\\share'); +isAbsolute.win32('\\\\unc\\share\\foo'); +isAbsolute.win32('\\\\unc\\share\\foo\\'); +isAbsolute.win32('\\\\unc\\share\\foo\\bar'); +isAbsolute.win32('\\\\unc\\share\\foo\\bar\\'); +isAbsolute.win32('\\\\unc\\share\\foo\\bar\\baz'); +//=> true + +isAbsolute.win32('a:foo/a/b/c/d'); +isAbsolute.win32(':\\'); +isAbsolute.win32('foo\\bar\\baz'); +isAbsolute.win32('foo\\bar\\baz\\'); +//=> false +``` + +## About + +### Related projects + +* [is-dotfile](https://www.npmjs.com/package/is-dotfile): Return true if a file path is (or has) a dotfile. Returns false if the… [more](https://github.com/jonschlinkert/is-dotfile) | [homepage](https://github.com/jonschlinkert/is-dotfile "Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [is-unc-path](https://www.npmjs.com/package/is-unc-path): Returns true if a filepath is a windows UNC file path. | [homepage](https://github.com/jonschlinkert/is-unc-path "Returns true if a filepath is a windows UNC file path.") +* [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob "Return true if a value is a valid glob pattern or patterns.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 35 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [es128](https://github.com/es128) | +| 1 | [shinnn](https://github.com/shinnn) | +| 1 | [Sobak](https://github.com/Sobak) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 13, 2017._ \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/index.js new file mode 100644 index 00000000..06d67311 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/index.js @@ -0,0 +1,47 @@ +'use strict'; + +var isRelative = require('is-relative'); +var isWindows = require('is-windows'); + +/** + * Expose `isAbsolute` + */ + +module.exports = isAbsolute; + +/** + * Returns true if a file path is absolute. + * + * @param {String} `fp` + * @return {Boolean} + */ + +function isAbsolute(fp) { + if (typeof fp !== 'string') { + throw new TypeError('isAbsolute expects a string.'); + } + return isWindows() ? isAbsolute.win32(fp) : isAbsolute.posix(fp); +} + +/** + * Test posix paths. + */ + +isAbsolute.posix = function posixPath(fp) { + return fp.charAt(0) === '/'; +}; + +/** + * Test windows paths. + */ + +isAbsolute.win32 = function win32(fp) { + if (/[a-z]/i.test(fp.charAt(0)) && fp.charAt(1) === ':' && fp.charAt(2) === '\\') { + return true; + } + // Microsoft Azure absolute filepath + if (fp.slice(0, 2) === '\\\\') { + return true; + } + return !isRelative(fp); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/package.json new file mode 100644 index 00000000..95d6f61f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute/package.json @@ -0,0 +1,133 @@ +{ + "_from": "is-absolute@^1.0.0", + "_id": "is-absolute@1.0.0", + "_inBundle": false, + "_integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "_location": "/node-red-contrib-johnny-five/is-absolute", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-absolute@^1.0.0", + "name": "is-absolute", + "escapedName": "is-absolute", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/to-absolute-glob" + ], + "_resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "_shasum": "395e1ae84b11f26ad1795e73c17378e48a301576", + "_spec": "is-absolute@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/to-absolute-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-absolute/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Shinnosuke Watanabe", + "url": "https://shinnn.github.io" + }, + { + "url": "http://sobak.pl" + } + ], + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "deprecated": false, + "description": "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-absolute", + "keywords": [ + "absolute", + "built", + "built-in", + "check", + "core", + "detect", + "dir", + "file", + "filepath", + "is", + "is-absolute", + "isabsolute", + "normalize", + "path", + "path-absolute", + "path-is-absolute", + "paths", + "polyfill", + "relative", + "resolve", + "shim", + "slash", + "slashes", + "uri", + "url", + "util", + "utils" + ], + "license": "MIT", + "main": "index.js", + "name": "is-absolute", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-absolute.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-dotfile", + "is-glob", + "is-relative", + "is-unc-path", + "is-valid-glob" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/LICENSE new file mode 100644 index 00000000..842218cf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/README.md new file mode 100644 index 00000000..0416af5c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/index.js new file mode 100644 index 00000000..c1d986fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/package.json new file mode 100644 index 00000000..e2a04fe3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-extglob/package.json @@ -0,0 +1,100 @@ +{ + "_from": "is-extglob@^2.1.0", + "_id": "is-extglob@2.1.1", + "_inBundle": false, + "_integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "_location": "/node-red-contrib-johnny-five/is-extglob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-extglob@^2.1.0", + "name": "is-extglob", + "escapedName": "is-extglob", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/is-glob" + ], + "_resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "_shasum": "a88c02535791f02ed37c76a1b9ea9773c833f8c2", + "_spec": "is-extglob@^2.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/is-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns true if a string has an extglob.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-extglob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-extglob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extglob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000..a7d3e385 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + 0x3250 <= x && x <= 0x4dbf || + // CJK Unified Ideographs .. Yi Radicals + 0x4e00 <= x && x <= 0xa4c6 || + // Hangul Jamo Extended-A + 0xa960 <= x && x <= 0xa97c || + // Hangul Syllables + 0xac00 <= x && x <= 0xd7a3 || + // CJK Compatibility Ideographs + 0xf900 <= x && x <= 0xfaff || + // Vertical Forms + 0xfe10 <= x && x <= 0xfe19 || + // CJK Compatibility Forms .. Small Form Variants + 0xfe30 <= x && x <= 0xfe6b || + // Halfwidth and Fullwidth Forms + 0xff01 <= x && x <= 0xff60 || + 0xffe0 <= x && x <= 0xffe6 || + // Kana Supplement + 0x1b000 <= x && x <= 0x1b001 || + // Enclosed Ideographic Supplement + 0x1f200 <= x && x <= 0x1f251 || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + 0x20000 <= x && x <= 0x3fffd)) { + return true; + } + + return false; +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/license b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000..45917e81 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,77 @@ +{ + "_from": "is-fullwidth-code-point@^1.0.0", + "_id": "is-fullwidth-code-point@1.0.0", + "_inBundle": false, + "_integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "_location": "/node-red-contrib-johnny-five/is-fullwidth-code-point", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-fullwidth-code-point@^1.0.0", + "name": "is-fullwidth-code-point", + "escapedName": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "_spec": "is-fullwidth-code-point@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000..4936464b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/LICENSE new file mode 100644 index 00000000..39245ac1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/README.md new file mode 100644 index 00000000..6f4404fe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/README.md @@ -0,0 +1,142 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-glob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-glob) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +isGlob('abc/?.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +isGlob('abc/\\?.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +## About + +### Related projects + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
| +| --- | --- | +| 40 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [tuvistavie](https://github.com/tuvistavie) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-glob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/index.js new file mode 100644 index 00000000..2ecbe2a7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/index.js @@ -0,0 +1,25 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob = require('is-extglob'); + +module.exports = function isGlob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) return true; + + var regex = /(\\).|([*?]|\[.*\]|\{.*\}|\(.*\|.*\)|^!)/; + var match; + + while ((match = regex.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + return false; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/package.json new file mode 100644 index 00000000..a7ff4acd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-glob/package.json @@ -0,0 +1,119 @@ +{ + "_from": "is-glob@^3.1.0", + "_id": "is-glob@3.1.0", + "_inBundle": false, + "_integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "_location": "/node-red-contrib-johnny-five/is-glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-glob@^3.1.0", + "name": "is-glob", + "escapedName": "is-glob", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/glob-parent" + ], + "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "_shasum": "7ba5ae24217804ac70707b96922567486cc3e84a", + "_spec": "is-glob@^3.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/glob-parent", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-glob/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Daniel Perez", + "email": "daniel@claudetech.com", + "url": "http://tuvistavie.com" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "is-extglob": "^2.1.0" + }, + "deprecated": false, + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-glob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-glob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + }, + "version": "3.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/LICENSE new file mode 100644 index 00000000..66ae69c7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Jon Schlinkert + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/README.md new file mode 100644 index 00000000..c909408a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/README.md @@ -0,0 +1,73 @@ +# is-negated-glob [![NPM version](https://img.shields.io/npm/v/is-negated-glob.svg?style=flat)](https://www.npmjs.com/package/is-negated-glob) [![NPM downloads](https://img.shields.io/npm/dm/is-negated-glob.svg?style=flat)](https://npmjs.org/package/is-negated-glob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-negated-glob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-negated-glob) + +> Returns an object with a `negated` boolean and the `!` stripped from negation patterns. Also respects extglobs. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-negated-glob +``` + +## Usage + +```js +var isNegatedGlob = require('is-negated-glob'); + +console.log(isNegatedGlob('foo')); +// { pattern: 'foo', negated: false } + +console.log(isNegatedGlob('!foo')); +// { pattern: 'foo', negated: true } + +console.log(isNegatedGlob('!(foo)')); +// extglob patterns are ignored +// { pattern: '!(foo)', negated: false } +``` + +## About + +### Related projects + +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob "Returns true if a string has an extglob.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [to-absolute-glob](https://www.npmjs.com/package/to-absolute-glob): Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are… [more](https://github.com/jonschlinkert/to-absolute-glob) | [homepage](https://github.com/jonschlinkert/to-absolute-glob "Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-negated-glob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 08, 2016._ \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/index.js new file mode 100644 index 00000000..d1c060db --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/index.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function(pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + + var glob = { negated: false, pattern: pattern, original: pattern }; + if (pattern.charAt(0) === '!' && pattern.charAt(1) !== '(') { + glob.negated = true; + glob.pattern = pattern.slice(1); + } + + return glob; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/package.json new file mode 100644 index 00000000..31e15888 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-negated-glob/package.json @@ -0,0 +1,100 @@ +{ + "_from": "is-negated-glob@^1.0.0", + "_id": "is-negated-glob@1.0.0", + "_inBundle": false, + "_integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "_location": "/node-red-contrib-johnny-five/is-negated-glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-negated-glob@^1.0.0", + "name": "is-negated-glob", + "escapedName": "is-negated-glob", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/glob-stream", + "/node-red-contrib-johnny-five/to-absolute-glob" + ], + "_resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "_shasum": "6910bca5da8c95e784b5751b976cf5a10fee36d2", + "_spec": "is-negated-glob@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/glob-stream", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-negated-glob/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns an object with a `negated` boolean and the `!` stripped from negation patterns. Also respects extglobs.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "LICENSE", + "README.md" + ], + "homepage": "https://github.com/jonschlinkert/is-negated-glob", + "keywords": [ + "extglob", + "glob", + "inverse", + "inverted", + "is", + "is-glob", + "match", + "micromatch", + "negate", + "negated", + "negation", + "negative", + "pattern", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-negated-glob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-negated-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-extglob", + "is-glob", + "to-absolute-glob" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/LICENSE new file mode 100644 index 00000000..3f2eca18 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/README.md new file mode 100644 index 00000000..eff8c74d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/README.md @@ -0,0 +1,77 @@ +# is-relative [![NPM version](https://img.shields.io/npm/v/is-relative.svg?style=flat)](https://www.npmjs.com/package/is-relative) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-relative.svg?style=flat)](https://npmjs.org/package/is-relative) [![NPM total downloads](https://img.shields.io/npm/dt/is-relative.svg?style=flat)](https://npmjs.org/package/is-relative) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-relative.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-relative) + +> Returns `true` if the path appears to be relative. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-relative +``` + +## Usage + +```js +var isRelative = require('is-relative'); +console.log(isRelative('README.md')); +//=> true + +console.log(isRelative('/User/dev/foo/README.md')); +//=> false +``` + +## About + +### Related projects + +* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.") +* [is-dotfile](https://www.npmjs.com/package/is-dotfile): Return true if a file path is (or has) a dotfile. Returns false if the… [more](https://github.com/jonschlinkert/is-dotfile) | [homepage](https://github.com/jonschlinkert/is-dotfile "Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [is-unc-path](https://www.npmjs.com/package/is-unc-path): Returns true if a filepath is a windows UNC file path. | [homepage](https://github.com/jonschlinkert/is-unc-path "Returns true if a filepath is a windows UNC file path.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 13 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [shinnn](https://github.com/shinnn) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 13, 2017._ \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/index.js new file mode 100644 index 00000000..37563577 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/index.js @@ -0,0 +1,12 @@ +'use strict'; + +var isUncPath = require('is-unc-path'); + +module.exports = function isRelative(filepath) { + if (typeof filepath !== 'string') { + throw new TypeError('expected filepath to be a string'); + } + + // Windows UNC paths are always considered to be absolute. + return !isUncPath(filepath) && !/^([a-z]:)?[\\\/]/i.test(filepath); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/package.json new file mode 100644 index 00000000..d85deff6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-relative/package.json @@ -0,0 +1,108 @@ +{ + "_from": "is-relative@^1.0.0", + "_id": "is-relative@1.0.0", + "_inBundle": false, + "_integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "_location": "/node-red-contrib-johnny-five/is-relative", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-relative@^1.0.0", + "name": "is-relative", + "escapedName": "is-relative", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/is-absolute" + ], + "_resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "_shasum": "a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d", + "_spec": "is-relative@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-relative/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Shinnosuke Watanabe", + "url": "https://shinnn.github.io" + } + ], + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "deprecated": false, + "description": "Returns `true` if the path appears to be relative.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-relative", + "keywords": [ + "absolute", + "check", + "file", + "filepath", + "is", + "normalize", + "path", + "path.relative", + "relative", + "resolve", + "slash", + "slashes", + "uri", + "url" + ], + "license": "MIT", + "main": "index.js", + "name": "is-relative", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-relative.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-absolute", + "is-dotfile", + "is-glob", + "is-relative", + "is-unc-path" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/LICENSE new file mode 100644 index 00000000..c0d7f136 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/README.md new file mode 100644 index 00000000..ba959101 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/README.md @@ -0,0 +1,115 @@ +# is-unc-path [![NPM version](https://img.shields.io/npm/v/is-unc-path.svg?style=flat)](https://www.npmjs.com/package/is-unc-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-unc-path.svg?style=flat)](https://npmjs.org/package/is-unc-path) [![NPM total downloads](https://img.shields.io/npm/dt/is-unc-path.svg?style=flat)](https://npmjs.org/package/is-unc-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-unc-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-unc-path) + +> Returns true if a filepath is a windows UNC file path. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-unc-path +``` + +## Usage + +```js +var isUncPath = require('is-unc-path'); +``` + +**true** + +Returns true for windows UNC paths: + +```js +isUncPath('\\/foo/bar'); +isUncPath('\\\\foo/bar'); +isUncPath('\\\\foo\\admin$'); +isUncPath('\\\\foo\\admin$\\system32'); +isUncPath('\\\\foo\\temp'); +isUncPath('\\\\/foo/bar'); +isUncPath('\\\\\\/foo/bar'); +``` + +**false** + +Returns false for non-UNC paths: + +```js +isUncPath('/foo/bar'); +isUncPath('/'); +isUncPath('/foo'); +isUncPath('/foo/'); +isUncPath('c:'); +isUncPath('c:.'); +isUncPath('c:./'); +isUncPath('c:./file'); +isUncPath('c:/'); +isUncPath('c:/file'); +``` + +**Customization** + +Use `.source` to use the regex as a component of another regex: + +```js +var myRegex = new RegExp(isUncPath.source + 'foo'); +``` + +**[Rules for UNC paths](http://resources.esri.com/help/9.3/ArcGISDesktop/com/Gp_ToolRef/sharing_tools_and_toolboxes/pathnames_explained_colon_absolute_relative_unc_and_url.htm)** + +* The computer name is always preceded by a double backward-slash (`\\`). +* UNC paths cannot contain a drive letter (such as `D:`) + +## Release history + +### v1.0.0 - 2017-07-12 + +**Changes** + +* now throws a `TypeError` if value is not a string + +## About + +### Related projects + +* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 13, 2017._ \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/index.js new file mode 100644 index 00000000..a9b839ed --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var regex = require('unc-path-regex')(); + +module.exports = function(filepath) { + if (typeof filepath !== 'string') { + throw new TypeError('expected a string'); + } + return regex.test(filepath); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/package.json new file mode 100644 index 00000000..04ea35f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-unc-path/package.json @@ -0,0 +1,96 @@ +{ + "_from": "is-unc-path@^1.0.0", + "_id": "is-unc-path@1.0.0", + "_inBundle": false, + "_integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "_location": "/node-red-contrib-johnny-five/is-unc-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-unc-path@^1.0.0", + "name": "is-unc-path", + "escapedName": "is-unc-path", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/is-relative" + ], + "_resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "_shasum": "d731e8898ed090a12c352ad2eaed5095ad322c9d", + "_spec": "is-unc-path@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/is-relative", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-unc-path/issues" + }, + "bundleDependencies": false, + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "deprecated": false, + "description": "Returns true if a filepath is a windows UNC file path.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-unc-path", + "keywords": [ + "absolute", + "expression", + "file", + "filepath", + "is", + "match", + "matching", + "path", + "regex", + "regexp", + "regular", + "unc", + "win", + "windows" + ], + "license": "MIT", + "main": "index.js", + "name": "is-unc-path", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-unc-path.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "is-relative", + "is-absolute", + "is-glob" + ] + } + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/LICENSE new file mode 100644 index 00000000..f8de0630 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2018, Jon Schlinkert. + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/README.md new file mode 100644 index 00000000..485bfdec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/README.md @@ -0,0 +1,95 @@ +# is-windows [![NPM version](https://img.shields.io/npm/v/is-windows.svg?style=flat)](https://www.npmjs.com/package/is-windows) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-windows.svg?style=flat)](https://npmjs.org/package/is-windows) [![NPM total downloads](https://img.shields.io/npm/dt/is-windows.svg?style=flat)](https://npmjs.org/package/is-windows) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-windows.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-windows) + +> Returns true if the platform is windows. UMD module, works with node.js, commonjs, browser, AMD, electron, etc. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-windows +``` + +## Heads up! + +As of `v0.2.0` this module always returns a function. + +## Node.js usage + +```js +var isWindows = require('is-windows'); + +console.log(isWindows()); +//=> returns true if the platform is windows +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [window-size](https://www.npmjs.com/package/window-size): Reliable way to get the height and width of terminal/console, since it's not calculated or… [more](https://github.com/jonschlinkert/window-size) | [homepage](https://github.com/jonschlinkert/window-size "Reliable way to get the height and width of terminal/console, since it's not calculated or updated the same way on all platforms, environments and node.js versions.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 11 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [SimenB](https://github.com/SimenB) | +| 1 | [gucong3000](https://github.com/gucong3000) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 14, 2018._ \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/index.js new file mode 100644 index 00000000..55d43e09 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/index.js @@ -0,0 +1,27 @@ +/*! + * is-windows + * + * Copyright © 2015-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +(function(factory) { + if (exports && typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = factory(); + } else if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof window !== 'undefined') { + window.isWindows = factory(); + } else if (typeof global !== 'undefined') { + global.isWindows = factory(); + } else if (typeof self !== 'undefined') { + self.isWindows = factory(); + } else { + this.isWindows = factory(); + } +})(function() { + 'use strict'; + return function isWindows() { + return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); + }; +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/package.json new file mode 100644 index 00000000..8910f36b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/is-windows/package.json @@ -0,0 +1,111 @@ +{ + "_from": "is-windows@^1.0.1", + "_id": "is-windows@1.0.2", + "_inBundle": false, + "_integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "_location": "/node-red-contrib-johnny-five/is-windows", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-windows@^1.0.1", + "name": "is-windows", + "escapedName": "is-windows", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/is-absolute" + ], + "_resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "_shasum": "d1850eb9791ecd18e6182ce12a30f396634bb19d", + "_spec": "is-windows@^1.0.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/is-absolute", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-windows/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Simen Bekkhus", + "url": "https://github.com/SimenB" + }, + { + "name": "刘祺", + "url": "gucong.co.cc" + } + ], + "deprecated": false, + "description": "Returns true if the platform is windows. UMD module, works with node.js, commonjs, browser, AMD, electron, etc.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-windows", + "keywords": [ + "check", + "cywin", + "is", + "is-windows", + "nix", + "operating system", + "os", + "platform", + "process", + "unix", + "win", + "win32", + "windows" + ], + "license": "MIT", + "main": "index.js", + "name": "is-windows", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-windows.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-absolute", + "is-glob", + "is-relative", + "isobject", + "window-size" + ] + }, + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "1.0.2" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/Makefile b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/Makefile new file mode 100644 index 00000000..787d56e1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/README.md new file mode 100644 index 00000000..16d2c59c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/component.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/component.json new file mode 100644 index 00000000..9e31b683 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/index.js new file mode 100644 index 00000000..a57f6349 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/package.json new file mode 100644 index 00000000..3939448d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/package.json @@ -0,0 +1,73 @@ +{ + "_from": "isarray@~1.0.0", + "_id": "isarray@1.0.0", + "_inBundle": false, + "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "_location": "/node-red-contrib-johnny-five/isarray", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isarray@~1.0.0", + "name": "isarray", + "escapedName": "isarray", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_spec": "isarray@~1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/readable-stream", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Array#isArray for older browsers", + "devDependencies": { + "tape": "~2.13.4" + }, + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "browser", + "isarray", + "array" + ], + "license": "MIT", + "main": "index.js", + "name": "isarray", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/test.js new file mode 100644 index 00000000..e0c3444d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/isarray/test.js @@ -0,0 +1,20 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/.github/stale.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/.github/stale.yml new file mode 100644 index 00000000..c3f9781c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/.github/stale.yml @@ -0,0 +1,13 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 360 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/.tesselignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/.tesselignore new file mode 100644 index 00000000..f303410b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/.tesselignore @@ -0,0 +1,15 @@ +.git/ +assets/ +docs/ +eg/ +node_modules/browser-serialport +node_modules/es6-shim +node_modules/firmata +node_modules/optimist +node_modules/serialport +node_modules/sinon +node_modules/grunt* +test/ +tpl/ +util/ +release diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/README.md new file mode 100644 index 00000000..883f7eff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/README.md @@ -0,0 +1,612 @@ +![](https://github.com/rwaldron/johnny-five/raw/master/assets/sgier-johnny-five.png) + +# Johnny-Five +### The JavaScript Robotics Programming Framework + + + + +_Artwork by [Mike Sgier](http://msgierillustration.com)_ + +[![Travis Build Status](https://travis-ci.org/rwaldron/johnny-five.svg?branch=master)](https://travis-ci.org/rwaldron/johnny-five) +[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/hmke71k7uemtnami/branch/master?svg=true)](https://ci.appveyor.com/project/rwaldron/johnny-five) +[![Coverage Status](https://coveralls.io/repos/github/rwaldron/johnny-five/badge.svg?branch=master)](https://coveralls.io/github/rwaldron/johnny-five?branch=master) +[![Install Size](https://packagephobia.now.sh/badge?p=johnny-five)](https://packagephobia.now.sh/result?p=johnny-five) +[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/rwaldron/johnny-five) + + + +**Johnny-Five is an Open Source, Firmata Protocol based, IoT and Robotics programming framework, developed at [Bocoup](http://bocoup.com). Johnny-Five programs can be written for Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!** + +Johnny-Five has grown from a passion project into a tool for inspiring learning and creativity for people of all ages, backgrounds, and from all across the world. + +Just interested in learning and building awesome things? You might want to start with the official [Johnny-Five website](http://johnny-five.io). The website combines content from this repo, the wiki, tutorials from the Bocoup blog and several third-party websites into a single, easily-discoverable source: + +* If you want to find the API documentation, [that’s right here](http://johnny-five.io/api/). +* Need to figure out what platform to use for a project? We put that stuff [here](http://johnny-five.io/platform-support/). +* Need inspiration for your next NodeBot? Check out the [examples](http://johnny-five.io/examples/). +* Want to stay up-to-date with projects in the community? [Check this out](http://johnny-five.io/articles/). +* Need NodeBots community or Johnny-Five project updates and announcements? [This](http://johnny-five.io/news/) is what you’re looking for. + + +Johnny-Five does not attempt to provide "all the things", but instead focuses on delivering robust, reality tested, highly composable APIs that behave consistently across all supported hardware platforms. Johnny-Five wants to be a baseline control kit for hardware projects, allowing you the freedom to build, grow and experiment with diverse JavaScript libraries of your own choice. Johnny-Five couples comfortably with: + +- Popular application libraries such as [Express.js](http://expressjs.com/) and [Socket.io](http://socket.io/). +- Fellow hardware projects like [ar-drone](https://github.com/felixge/node-ar-drone), [Aerogel](https://github.com/ceejbot/aerogel) and [Spheron](https://github.com/alchemycs/spheron) +- Bluetooth game controllers like [XBox Controller](https://github.com/andrew/node-xbox-controller) and [DualShock](https://github.com/rdepena/node-dualshock-controller) +- IoT frameworks, such as [Octoblu](http://www.octoblu.com/) + +...And that's only a few of the many explorable possibilities. Check out these exciting projects: [node-pulsesensor](https://www.npmjs.org/package/node-pulsesensor), [footballbot-workshop-ui](https://www.npmjs.org/package/footballbot-workshop-ui), [nodebotui](https://www.npmjs.org/package/nodebotui), [dublin-disco](https://www.npmjs.org/package/dublin-disco), [node-slot-car-bot](https://www.npmjs.org/package/node-slot-car-bot), [servo-calibrator](https://www.npmjs.org/package/servo-calibrator), [node-ardx](https://www.npmjs.org/package/node-ardx), [nodebot-workshop](https://www.npmjs.org/package/nodebot-workshop), [phone-home](https://www.npmjs.org/package/phone-home), [purple-unicorn](https://www.npmjs.org/package/purple-unicorn), [webduino](https://www.npmjs.org/package/webduino), [leapduino](https://www.npmjs.org/package/leapduino), [lasercat-workshop](https://www.npmjs.org/package/lasercat-workshop), [simplesense](https://www.npmjs.org/package/simplesense), [five-redbot](https://www.npmjs.org/package/five-redbot), [robotnik](https://www.npmjs.org/package/robotnik), [the-blender](https://www.npmjs.org/package/the-blender) + + +**Why JavaScript?** +[NodeBots: The Rise of JavaScript Robotics](http://www.voodootikigod.com/nodebots-the-rise-of-js-robotics) + +## Hello Johnny + +The ubiquitous "Hello World" program of the microcontroller and SoC world is "blink an LED". The following code demonstrates how this is done using the Johnny-Five framework. + +```javascript +var five = require("johnny-five"); +var board = new five.Board(); + +board.on("ready", function() { + // Create an Led on pin 13 + var led = new five.Led(13); + // Blink every half second + led.blink(500); +}); +``` + + + +> Note: Node will crash if you try to run johnny-five in the node REPL, but board instances will create their own contextual REPL. Put your script in a file. + + +## Supported Hardware + +Johnny-Five has been tested on a variety of Arduino-compatible [Boards](https://github.com/rwaldron/johnny-five/wiki/Board). + +For non-Arduino based projects, a number of platform-specific [IO Plugins](https://github.com/rwaldron/johnny-five/wiki/IO-Plugins) are available. IO Plugins allow Johnny-Five code to communicate with any non-Arduino based hardware in whatever language that platforms speaks! + +## Documentation + +Documentation for the Johnny-Five API can be found [here](http://johnny-five.io/api/) and [example programs here](http://johnny-five.io/examples/). + +## Guidance + +Need help? Ask a question on the [NodeBots Community Forum](http://forums.nodebots.io). If you just have a quick question or are interested in ongoing design discussions, join us in the [Johnny-Five Gitter Chat](https://gitter.im/rwaldron/johnny-five). + +For step-by-step examples, including an electronics primer, check out [Arduino Experimenter's Guide for NodeJS](http://node-ardx.org/) by [@AnnaGerber](https://twitter.com/AnnaGerber) + +Here is a list of [prerequisites](https://github.com/rwaldron/johnny-five/wiki/Getting-Started#prerequisites) for Linux, OSX or Windows. + +Check out the [bluetooth guide](https://github.com/rwaldron/johnny-five/wiki/JY-MCU-Bluetooth-Serial-Port-Module-Notes) if you want to remotely control your robot. + +## Setup and Assemble Arduino + +- Recommended Starting Kit: [Sparkfun Inventor's Kit](https://www.sparkfun.com/products/12001) +- Download [Arduino IDE](http://arduino.cc/en/main/software) +- Plug in your Arduino or Arduino compatible microcontroller via USB +- Open the Arduino IDE, select: File > Examples > Firmata > StandardFirmataPlus + + StandardFirmataPlus is available in Firmata v2.5.0 or greater +- Click the "Upload" button. + +If the upload was successful, the board is now prepared and you can close the Arduino IDE. + +For non-Arduino projects, each IO Plugin's repo will provide its own platform specific setup instructions. + + +## Hey you, here's Johnny! + +#### Source Code: + +``` bash +git clone git://github.com/rwaldron/johnny-five.git && cd johnny-five + +npm install +``` + +#### npm package: + +Install the module with: + +```bash +npm install johnny-five +``` + + +## Example Programs + +To get you up and running quickly, we provide a variety of examples for using each Johnny-Five component. One thing we’re especially excited about is the extensive collection of [Fritzing](http://fritzing.org/home/) diagrams you’ll find throughout the site. A huge part of doing any Johnny-Five project is handling the actual hardware, and we’ve included these as part of the documentation because we realised that instructions on how to write code to control a servo are insufficient without instructions on how to connect a servo! + +To interactively navigate the examples, visit the [Johnny-Five examples](http://johnny-five.io/examples/) page on the official website. If you want to link directly to the examples in this repo, you can use one of the following links. + +**There are presently 363 example programs with code and diagrams!** + + + +### Board +- [Board - Basic Initialization](https://github.com/rwaldron/johnny-five/blob/master/docs/board.md) +- [Board - Cleanup in 'exit' event](https://github.com/rwaldron/johnny-five/blob/master/docs/board-cleanup.md) +- [Board - Multiple in one program](https://github.com/rwaldron/johnny-five/blob/master/docs/board-multi.md) +- [Board - Specify Sampling Interval](https://github.com/rwaldron/johnny-five/blob/master/docs/board-sampling-interval.md) +- [Board - Specify port](https://github.com/rwaldron/johnny-five/blob/master/docs/board-with-port.md) +- [Custom Data Properties](https://github.com/rwaldron/johnny-five/blob/master/docs/custom-properties.md) +- [Pin](https://github.com/rwaldron/johnny-five/blob/master/docs/pin.md) +- [REPL](https://github.com/rwaldron/johnny-five/blob/master/docs/repl.md) + +### LED +- [LED](https://github.com/rwaldron/johnny-five/blob/master/docs/led.md) +- [LED - Blink](https://github.com/rwaldron/johnny-five/blob/master/docs/led-blink.md) +- [LED - Demo sequence](https://github.com/rwaldron/johnny-five/blob/master/docs/led-demo-sequence.md) +- [LED - Fade](https://github.com/rwaldron/johnny-five/blob/master/docs/led-fade.md) +- [LED - Fade callback](https://github.com/rwaldron/johnny-five/blob/master/docs/led-fade-callback.md) +- [LED - Fade with animation](https://github.com/rwaldron/johnny-five/blob/master/docs/led-fade-animation.md) +- [LED - PCA9685](https://github.com/rwaldron/johnny-five/blob/master/docs/led-PCA9685.md) +- [LED - Pulse](https://github.com/rwaldron/johnny-five/blob/master/docs/led-pulse.md) +- [LED - Pulse with animation](https://github.com/rwaldron/johnny-five/blob/master/docs/led-pulse-animation.md) +- [LED - Slider](https://github.com/rwaldron/johnny-five/blob/master/docs/led-slider.md) +- [LED - Tessel Servo Module](https://github.com/rwaldron/johnny-five/blob/master/docs/led-tessel-servo-module.md) +- [LEDs - An array of LEDs](https://github.com/rwaldron/johnny-five/blob/master/docs/led-array.md) +- [LEDs - Controlling an array of LEDs](https://github.com/rwaldron/johnny-five/blob/master/docs/led-array-controller.md) + +### LED: RGB +- [LED - RGB](https://github.com/rwaldron/johnny-five/blob/master/docs/led-rgb.md) +- [LED - RGB (Common Anode)](https://github.com/rwaldron/johnny-five/blob/master/docs/led-rgb-anode.md) +- [LED - RGB (Common Anode) PCA9685](https://github.com/rwaldron/johnny-five/blob/master/docs/led-rgb-anode-PCA9685.md) +- [LED - RGB Intensity](https://github.com/rwaldron/johnny-five/blob/master/docs/led-rgb-intensity.md) +- [LED - Rainbow](https://github.com/rwaldron/johnny-five/blob/master/docs/led-rainbow.md) +- [LED - Rainbow BlinkM](https://github.com/rwaldron/johnny-five/blob/master/docs/led-rgb-BLINKM.md) + +### LED: Digits & Matrix +- [LED - Digital Clock](https://github.com/rwaldron/johnny-five/blob/master/docs/led-digits-clock.md) +- [LED - Digital Clock, Dual Displays](https://github.com/rwaldron/johnny-five/blob/master/docs/led-digits-clock-dual.md) +- [LED - Digital Clock, HT16K33](https://github.com/rwaldron/johnny-five/blob/master/docs/led-digits-clock-HT16K33.md) +- [LED - Draw Matrix Characters Demo](https://github.com/rwaldron/johnny-five/blob/master/docs/led-chars-demo.md) +- [LED - Enumerate Matrix Characters & Symbols](https://github.com/rwaldron/johnny-five/blob/master/docs/led-enumeratechars.md) +- [LED - Matrix](https://github.com/rwaldron/johnny-five/blob/master/docs/led-matrix.md) +- [LED - Matrix Demo](https://github.com/rwaldron/johnny-five/blob/master/docs/led-matrix-tutorial.md) +- [LED - Matrix HT16K33](https://github.com/rwaldron/johnny-five/blob/master/docs/led-matrix-HT16K33.md) +- [LED - Matrix HT16K33 16x8](https://github.com/rwaldron/johnny-five/blob/master/docs/led-matrix-HT16K33-16x8.md) + +### Servo +- [Servo](https://github.com/rwaldron/johnny-five/blob/master/docs/servo.md) +- [Servo - Continuous](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-continuous.md) +- [Servo - Drive](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-drive.md) +- [Servo - Multi-Turn](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-multi-turn.md) +- [Servo - PCA9685](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-PCA9685.md) +- [Servo - Prompt](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-prompt.md) +- [Servo - Slider control](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-slider.md) +- [Servo - Sweep](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-sweep.md) +- [Servo - Tessel Servo Module](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-tessel-servo-module.md) +- [Servos - An array of servos](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-array.md) + +### GPS +- [GPS - Adafruit Ultimate GPS Breakout](https://github.com/rwaldron/johnny-five/blob/master/docs/gps-adafruit.md) +- [GPS - Default GPS](https://github.com/rwaldron/johnny-five/blob/master/docs/gps.md) +- [GPS - Sparkfun GP-20U7](https://github.com/rwaldron/johnny-five/blob/master/docs/gps-GP-20U7.md) + +### Servo Animation +- [Servo - Animation](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-animation.md) +- [Servo - Leg Animation](https://github.com/rwaldron/johnny-five/blob/master/docs/servo-animation-leg.md) + +### Color +- [Color - EVShield EV3 (Code)](https://github.com/rwaldron/johnny-five/blob/master/docs/color-EVS_EV3.md) +- [Color - EVShield EV3 (Raw)](https://github.com/rwaldron/johnny-five/blob/master/docs/color-raw-EVS_EV3.md) +- [Color - EVShield NXT (Code)](https://github.com/rwaldron/johnny-five/blob/master/docs/color-EVS_NXT.md) +- [Color - ISL29125](https://github.com/rwaldron/johnny-five/blob/master/docs/color-ISL29125.md) + +### Motor +- [Motor](https://github.com/rwaldron/johnny-five/blob/master/docs/motor.md) +- [Motor - 3 pin](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-3-pin.md) +- [Motor - Adafruit DRV8871 DC Motor Driver Breakout](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-drv8871.md) +- [Motor - Brake](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-brake.md) +- [Motor - Current](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-current.md) +- [Motor - Directional](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-directional.md) +- [Motor - EVShield EV3](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-EVS_EV3.md) +- [Motor - EVShield NXT](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-EVS_NXT.md) +- [Motor - Enable Pin](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-enable.md) +- [Motor - GROVE_I2C_MOTOR_DRIVER](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-GROVE_I2C.md) +- [Motor - H-Bridge](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-hbridge.md) +- [Motor - LUDUS](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-LUDUS.md) +- [Motor - PCA9685](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-PCA9685.md) +- [Motor - Sparkfun Dual H-bridge Edison Block](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-sparkfun-edison-hbridge.md) +- [Motor - Sparkfun TB6612FNG](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-TB6612FNG.md) +- [Motor - l298 Breakout](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-l298-breakout.md) +- [Motors - Dual H-Bridge](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-hbridge-dual.md) + +### Stepper Motor +- [Stepper - Driver](https://github.com/rwaldron/johnny-five/blob/master/docs/stepper-driver.md) +- [Stepper - Sweep](https://github.com/rwaldron/johnny-five/blob/master/docs/stepper-sweep.md) + +### ESC & Brushless Motor +- [ESC - Bidirectional](https://github.com/rwaldron/johnny-five/blob/master/docs/esc-bidirectional.md) +- [ESC - Bidirectional Forward-Reverse](https://github.com/rwaldron/johnny-five/blob/master/docs/esc-bidirectional-forward-reverse.md) +- [ESC - Dualshock controlled ESCs](https://github.com/rwaldron/johnny-five/blob/master/docs/esc-dualshock.md) +- [ESC - Keypress controlled ESCs](https://github.com/rwaldron/johnny-five/blob/master/docs/esc-keypress.md) +- [ESC - PCA9685](https://github.com/rwaldron/johnny-five/blob/master/docs/esc-PCA9685.md) +- [ESCs - An array of ESCs](https://github.com/rwaldron/johnny-five/blob/master/docs/esc-array.md) + +### Button / Switch +- [Button](https://github.com/rwaldron/johnny-five/blob/master/docs/button.md) +- [Button - Bumper](https://github.com/rwaldron/johnny-five/blob/master/docs/button-bumper.md) +- [Button - EVShield EV3](https://github.com/rwaldron/johnny-five/blob/master/docs/button-EVS_EV3.md) +- [Button - EVShield NXT](https://github.com/rwaldron/johnny-five/blob/master/docs/button-EVS_NXT.md) +- [Button - Options](https://github.com/rwaldron/johnny-five/blob/master/docs/button-options.md) +- [Button - Pullup](https://github.com/rwaldron/johnny-five/blob/master/docs/button-pullup.md) +- [Buttons - Collection w/ AT42QT1070](https://github.com/rwaldron/johnny-five/blob/master/docs/button-collection-AT42QT1070.md) +- [Switch - Magnetic Door](https://github.com/rwaldron/johnny-five/blob/master/docs/switch-magnetic-door.md) +- [Switch - Tilt SW-200D](https://github.com/rwaldron/johnny-five/blob/master/docs/switch-tilt-SW_200D.md) +- [Toggle Switch](https://github.com/rwaldron/johnny-five/blob/master/docs/toggle-switch.md) + +### Keypad +- [Keypad - 3x4 I2C Nano Backpack](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-3X4_I2C_NANO_BACKPACK.md) +- [Keypad - 4x4 I2C Nano Backpack](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-4X4_I2C_NANO_BACKPACK.md) +- [Keypad - VKEY](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-analog-vkey.md) +- [Keypad - Waveshare AD](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-analog-ad.md) +- [Touchpad - Grove QTouch](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-QTOUCH.md) +- [Touchpad - MPR121](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-MPR121.md) +- [Touchpad - MPR121, Sensitivity](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-MPR121-sensitivity.md) +- [Touchpad - MPR121QR2_SHIELD](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-MPR121QR2_SHIELD.md) +- [Touchpad - MPR121_KEYPAD](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-MPR121_KEYPAD.md) +- [Touchpad - MPR121_SHIELD](https://github.com/rwaldron/johnny-five/blob/master/docs/keypad-MPR121_SHIELD.md) + +### Relay +- [Relay](https://github.com/rwaldron/johnny-five/blob/master/docs/relay.md) +- [Relay - Collection](https://github.com/rwaldron/johnny-five/blob/master/docs/relay-collection.md) +- [Relay On Analog Pin](https://github.com/rwaldron/johnny-five/blob/master/docs/relay-on-analog-pin.md) + +### Shift Register +- [Shift Register](https://github.com/rwaldron/johnny-five/blob/master/docs/shift-register.md) +- [Shift Register - Common Anode Seven Segment controller](https://github.com/rwaldron/johnny-five/blob/master/docs/shift-register-seven-segment-anode.md) +- [Shift Register - Common Anode Seven segments, Chained](https://github.com/rwaldron/johnny-five/blob/master/docs/shift-register-daisy-chain-anode.md) +- [Shift Register - Seven Segment controller](https://github.com/rwaldron/johnny-five/blob/master/docs/shift-register-seven-segment.md) +- [Shift Register - Seven segments, Chained](https://github.com/rwaldron/johnny-five/blob/master/docs/shift-register-daisy-chain.md) + +### Infrared Reflectance +- [IR Motion](https://github.com/rwaldron/johnny-five/blob/master/docs/ir-motion.md) +- [IR Proximity](https://github.com/rwaldron/johnny-five/blob/master/docs/ir-proximity.md) +- [IR Reflectance](https://github.com/rwaldron/johnny-five/blob/master/docs/ir-reflect.md) +- [IR Reflectance Array](https://github.com/rwaldron/johnny-five/blob/master/docs/ir-reflect-array.md) + +### Proximity +- [Proximity](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity.md) +- [Proximity - EVShield EV3 (IR)](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-EVS_EV3_IR-alert.md) +- [Proximity - EVShield EV3 (IR)](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-EVS_EV3_IR.md) +- [Proximity - EVShield EV3 (Ultrasonic)](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-EVS_EV3_US.md) +- [Proximity - EVShield EV3 (Ultrasonic)](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-EVS_EV3_US-alert.md) +- [Proximity - GP2Y0A710K0F](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-GP2Y0A710K0F.md) +- [Proximity - HC-SR04](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-hcsr04.md) +- [Proximity - HC-SR04 (Analog)](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-hcsr04-analog.md) +- [Proximity - HC-SR04 I2C Backpack](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-hcsr04-i2c.md) +- [Proximity - LIDAR-Lite](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-lidarlite.md) +- [Proximity - MB1000](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-mb1000.md) +- [Proximity - MB1003](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-mb1003.md) +- [Proximity - MB1010](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-mb1010.md) +- [Proximity - MB1230](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-mb1230.md) +- [Proximity - SRF10](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-srf10.md) + +### Motion +- [Motion](https://github.com/rwaldron/johnny-five/blob/master/docs/motion.md) +- [Motion - GP2Y0A60SZLF](https://github.com/rwaldron/johnny-five/blob/master/docs/motion-GP2Y0A60SZLF.md) +- [Motion - GP2Y0D805Z0F](https://github.com/rwaldron/johnny-five/blob/master/docs/motion-gp2y0d805z0f.md) +- [Motion - GP2Y0D810Z0F](https://github.com/rwaldron/johnny-five/blob/master/docs/motion-gp2y0d810z0f.md) +- [Motion - GP2Y0D810Z0F](https://github.com/rwaldron/johnny-five/blob/master/docs/motion-gp2y0d815z0f.md) + +### Joystick +- [Joystick](https://github.com/rwaldron/johnny-five/blob/master/docs/joystick.md) +- [Joystick - Esplora](https://github.com/rwaldron/johnny-five/blob/master/docs/joystick-esplora.md) +- [Joystick - Pan + Tilt control](https://github.com/rwaldron/johnny-five/blob/master/docs/joystick-pantilt.md) +- [Joystick - Sparkfun Shield](https://github.com/rwaldron/johnny-five/blob/master/docs/joystick-shield.md) + +### LCD +- [Grove - RGB LCD Color Previewer](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-rgb-bgcolor-previewer.md) +- [LCD](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd.md) +- [LCD - Enumerate characters](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-enumeratechars.md) +- [LCD - I2C](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-i2c.md) +- [LCD - I2C PCF8574](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-i2c-PCF8574.md) +- [LCD - I2C Runner](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-i2c-runner.md) +- [LCD - Runner 16x2](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-runner.md) +- [LCD - Runner 20x4](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-runner-20x4.md) +- [LCD - Tessel 2 16x2](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-16x2-tessel.md) +- [Tessel 2 + Grove - RGB LCD Color Previewer](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-rgb-bgcolor-previewer-tessel.md) +- [Tessel 2 + Grove - RGB LCD Display](https://github.com/rwaldron/johnny-five/blob/master/docs/lcd-rgb-tessel-grove-JHD1313M1.md) + +### Compass/Magnetometer +- [Compass - Find north](https://github.com/rwaldron/johnny-five/blob/master/docs/magnetometer-north.md) +- [Compass - HMC5883L](https://github.com/rwaldron/johnny-five/blob/master/docs/compass-hmc5883l.md) +- [Compass - HMC6352](https://github.com/rwaldron/johnny-five/blob/master/docs/compass-hmc6352.md) +- [Compass - Logger](https://github.com/rwaldron/johnny-five/blob/master/docs/magnetometer-log.md) +- [Compass - MAG3110](https://github.com/rwaldron/johnny-five/blob/master/docs/compass-MAG3110.md) +- [Compass - MAG3110 on Tessel 2](https://github.com/rwaldron/johnny-five/blob/master/docs/compass-MAG3110-tessel.md) +- [Compass / Magnetometer](https://github.com/rwaldron/johnny-five/blob/master/docs/magnetometer.md) + +### Piezo +- [Piezo](https://github.com/rwaldron/johnny-five/blob/master/docs/piezo.md) + +### IMU/Multi +- [IMU - BNO055](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-bno055.md) +- [IMU - BNO055 (Orientation)](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-bno055-orientation.md) +- [IMU - LSM303C](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-lsm303c.md) +- [IMU - MPU6050](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-mpu6050.md) +- [Multi - BME280](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-BME280.md) +- [Multi - BMP085](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-bmp085.md) +- [Multi - BMP180](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-bmp180.md) +- [Multi - DHT11_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-DHT11_I2C_NANO_BACKPACK.md) +- [Multi - DHT21_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-DHT21_I2C_NANO_BACKPACK.md) +- [Multi - DHT22_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-DHT22_I2C_NANO_BACKPACK.md) +- [Multi - HIH6130](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-HIH6130.md) +- [Multi - HTU21D](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-htu21d.md) +- [Multi - MPL115A2](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-mpl115a2.md) +- [Multi - MPL3115A2](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-mpl3115a2.md) +- [Multi - MS5611](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-MS5611.md) +- [Multi - SHT31D](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-sht31d.md) +- [Multi - SI7020](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-SI7020.md) +- [Multi - SI7021](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-SI7021.md) +- [Multi - TH02](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-TH02.md) + +### Sensors +- [Accelerometer](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer.md) +- [Accelerometer - ADXL335](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-adxl335.md) +- [Accelerometer - ADXL345](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-adxl345.md) +- [Accelerometer - LIS3DH](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-LIS3DH.md) +- [Accelerometer - MMA7361](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-mma7361.md) +- [Accelerometer - MMA8452](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-MMA8452.md) +- [Accelerometer - MPU6050](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-mpu6050.md) +- [Accelerometer - Pan + Tilt](https://github.com/rwaldron/johnny-five/blob/master/docs/accelerometer-pan-tilt.md) +- [Altimeter - BMP085](https://github.com/rwaldron/johnny-five/blob/master/docs/altimeter-BMP085.md) +- [Altimeter - BMP180](https://github.com/rwaldron/johnny-five/blob/master/docs/altimeter-BMP180.md) +- [Altimeter - MPL3115A2](https://github.com/rwaldron/johnny-five/blob/master/docs/altimeter-mpl3115a2.md) +- [Altimeter - MS5611](https://github.com/rwaldron/johnny-five/blob/master/docs/altimeter-MS5611.md) +- [Barometer - BMP085](https://github.com/rwaldron/johnny-five/blob/master/docs/barometer-BMP085.md) +- [Barometer - BMP180](https://github.com/rwaldron/johnny-five/blob/master/docs/barometer-BMP180.md) +- [Barometer - MPL115A2](https://github.com/rwaldron/johnny-five/blob/master/docs/barometer-mpl115a2.md) +- [Barometer - MPL3115A2](https://github.com/rwaldron/johnny-five/blob/master/docs/barometer-mpl3115a2.md) +- [Barometer - MS5611](https://github.com/rwaldron/johnny-five/blob/master/docs/barometer-MS5611.md) +- [Gyro](https://github.com/rwaldron/johnny-five/blob/master/docs/gyro.md) +- [Gyro - Analog LPR5150AL](https://github.com/rwaldron/johnny-five/blob/master/docs/gyro-lpr5150l.md) +- [Gyro - I2C MPU6050](https://github.com/rwaldron/johnny-five/blob/master/docs/gyro-mpu6050.md) +- [Hygrometer - DHT11_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-DHT11_I2C_NANO_BACKPACK.md) +- [Hygrometer - DHT21_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-DHT21_I2C_NANO_BACKPACK.md) +- [Hygrometer - DHT22_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-DHT22_I2C_NANO_BACKPACK.md) +- [Hygrometer - HIH6130](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-HIH6130.md) +- [Hygrometer - HTU21D](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-htu21d.md) +- [Hygrometer - SHT31D](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-sht31d.md) +- [Hygrometer - SI7021](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-SI7021.md) +- [Hygrometer - TH02](https://github.com/rwaldron/johnny-five/blob/master/docs/hygrometer-TH02.md) +- [Sensor](https://github.com/rwaldron/johnny-five/blob/master/docs/sensor.md) +- [Sensor - Digital Microwave](https://github.com/rwaldron/johnny-five/blob/master/docs/sensor-digital-microwave.md) +- [Sensor - Flex sensor](https://github.com/rwaldron/johnny-five/blob/master/docs/flex.md) +- [Sensor - Force sensitive resistor](https://github.com/rwaldron/johnny-five/blob/master/docs/sensor-fsr.md) +- [Sensor - Microphone](https://github.com/rwaldron/johnny-five/blob/master/docs/microphone.md) +- [Sensor - Photoresistor](https://github.com/rwaldron/johnny-five/blob/master/docs/photoresistor.md) +- [Sensor - Potentiometer](https://github.com/rwaldron/johnny-five/blob/master/docs/potentiometer.md) +- [Sensor - Slide potentiometer](https://github.com/rwaldron/johnny-five/blob/master/docs/sensor-slider.md) +- [Thermometer - BMP085](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-bmp085.md) +- [Thermometer - BMP180](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-BMP180.md) +- [Thermometer - DHT11_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-DHT11_I2C_NANO_BACKPACK.md) +- [Thermometer - DHT21_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-DHT21_I2C_NANO_BACKPACK.md) +- [Thermometer - DHT22_I2C_NANO_BACKPACK](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-DHT22_I2C_NANO_BACKPACK.md) +- [Thermometer - DS18B20](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-ds18b20.md) +- [Thermometer - HIH6130](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-HIH6130.md) +- [Thermometer - HTU21D](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-htu21d.md) +- [Thermometer - LM335](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-lm335.md) +- [Thermometer - LM35](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-lm35.md) +- [Thermometer - MAX31850](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-max31850k.md) +- [Thermometer - MCP9808](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-MCP9808.md) +- [Thermometer - MPL115A2](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-mpl115a2.md) +- [Thermometer - MPL3115A2](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-mpl3115a2.md) +- [Thermometer - MPU6050](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-mpu6050.md) +- [Thermometer - MS5611](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-MS5611.md) +- [Thermometer - SHT31D](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-sht31d.md) +- [Thermometer - SI7020](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-SI7020.md) +- [Thermometer - SI7021](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-SI7021.md) +- [Thermometer - TH02](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-TH02.md) +- [Thermometer - TMP102](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-tmp102.md) +- [Thermometer - TMP36](https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-tmp36.md) + +### Expander +- [Expander - 74HC595](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-74HC595.md) +- [Expander - CD74HC4067, 16 Channel Analog Input Breakout](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-CD74HC4067_NANO_BACKPACK.md) +- [Expander - LIS3DH](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-LIS3DH.md) +- [Expander - MCP23008](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-MCP23008.md) +- [Expander - MCP23017](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-MCP23017.md) +- [Expander - MUXSHIELD2, Analog Sensors](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-MUXSHIELD2-analog-read.md) +- [Expander - MUXSHIELD2, Digital Input and Output](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-MUXSHIELD2-mixed.md) +- [Expander - PCA9685](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-PCA9685.md) +- [Expander - PCF8574](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-PCF8574.md) +- [Expander - PCF8575](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-PCF8575.md) +- [Expander - PCF8591](https://github.com/rwaldron/johnny-five/blob/master/docs/expander-PCF8591.md) + +### Photon Weather Shield +- [Photon Weather Shield: Moisture](https://github.com/rwaldron/johnny-five/blob/master/docs/sensor-photon-weather-shield-moisture.md) + +### Lego EVShield +- [Button - EVShield EV3](https://github.com/rwaldron/johnny-five/blob/master/docs/button-EVS_EV3.md) +- [Button - EVShield NXT](https://github.com/rwaldron/johnny-five/blob/master/docs/button-EVS_NXT.md) +- [Color - EVShield EV3 (Code)](https://github.com/rwaldron/johnny-five/blob/master/docs/color-EVS_EV3.md) +- [Color - EVShield EV3 (Raw)](https://github.com/rwaldron/johnny-five/blob/master/docs/color-raw-EVS_EV3.md) +- [Color - EVShield NXT (Code)](https://github.com/rwaldron/johnny-five/blob/master/docs/color-EVS_NXT.md) +- [Light - BH1750](https://github.com/rwaldron/johnny-five/blob/master/docs/light-ambient-BH1750.md) +- [Light - EVShield EV3 (Ambient)](https://github.com/rwaldron/johnny-five/blob/master/docs/light-ambient-EVS_EV3.md) +- [Light - EVShield EV3 (Reflected)](https://github.com/rwaldron/johnny-five/blob/master/docs/light-reflected-EVS_EV3.md) +- [Light - EVShield NXT (Ambient)](https://github.com/rwaldron/johnny-five/blob/master/docs/light-ambient-EVS_NXT.md) +- [Light - EVShield NXT (Reflected)](https://github.com/rwaldron/johnny-five/blob/master/docs/light-reflected-EVS_NXT.md) +- [Light - TSL2561](https://github.com/rwaldron/johnny-five/blob/master/docs/light-ambient-TSL2561.md) +- [Motor - EVShield EV3](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-EVS_EV3.md) +- [Motor - EVShield NXT](https://github.com/rwaldron/johnny-five/blob/master/docs/motor-EVS_NXT.md) +- [Proximity - EVShield EV3 (IR)](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-EVS_EV3_IR-alert.md) +- [Proximity - EVShield EV3 (Ultrasonic)](https://github.com/rwaldron/johnny-five/blob/master/docs/proximity-EVS_EV3_US-alert.md) + +### Intel Edison + Grove IoT Kit +- [Intel Edison + Grove - Accelerometer (ADXL345)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-accelerometer-adxl345-edison.md) +- [Intel Edison + Grove - Accelerometer (MMA7660)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-accelerometer-mma7660-edison.md) +- [Intel Edison + Grove - Air quality sensor](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-gas-tp401-edison.md) +- [Intel Edison + Grove - Barometer (BMP180)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-barometer-edison.md) +- [Intel Edison + Grove - Button](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-button-edison.md) +- [Intel Edison + Grove - Compass (HMC588L)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-compass-edison.md) +- [Intel Edison + Grove - Flame Sensor](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-flame-sensor-edison.md) +- [Intel Edison + Grove - Gas (MQ2)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-gas-mq2-edison.md) +- [Intel Edison + Grove - Humidity & Temperature (TH02)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-humidity-temperature-edison.md) +- [Intel Edison + Grove - I2C Motor Driver](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-i2c-motor-driver-edison.md) +- [Intel Edison + Grove - Joystick](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-joystick-edison.md) +- [Intel Edison + Grove - LED](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-led-edison.md) +- [Intel Edison + Grove - Light Sensor (TSL2561)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-light-sensor-edison.md) +- [Intel Edison + Grove - Moisture Sensor](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-moisture-edison.md) +- [Intel Edison + Grove - Q Touch](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-q-touch.md) +- [Intel Edison + Grove - RGB LCD](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-lcd-rgb-edison.md) +- [Intel Edison + Grove - RGB LCD Color Previewer](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-lcd-rgb-bgcolor-previewer-edison.md) +- [Intel Edison + Grove - RGB LCD temperature display](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-lcd-rgb-temperature-display-edison.md) +- [Intel Edison + Grove - Relay](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-relay-edison.md) +- [Intel Edison + Grove - Rotary Potentiometer](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-rotary-potentiometer-edison.md) +- [Intel Edison + Grove - Servo](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-servo-edison.md) +- [Intel Edison + Grove - Touch](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-touch-edison.md) + +### Grove IoT Kit (Seeed Studio) +- [Grove - Button](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-button.md) +- [Grove - Joystick](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-joystick.md) +- [Grove - LED](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-led.md) +- [Grove - Motor (I2C Driver)](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-i2c-motor-driver.md) +- [Grove - RGB LCD](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-lcd-rgb.md) +- [Grove - RGB LCD temperature display](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-lcd-rgb-temperature-display.md) +- [Grove - Rotary Potentiometer](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-rotary-potentiometer.md) +- [Grove - Servo](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-servo.md) +- [Grove - Touch](https://github.com/rwaldron/johnny-five/blob/master/docs/grove-touch.md) + +### Micro Magician V2 +- [Micro Magician V2 - Accelerometer](https://github.com/rwaldron/johnny-five/blob/master/docs/micromagician-accelerometer.md) +- [Micro Magician V2 - Motor](https://github.com/rwaldron/johnny-five/blob/master/docs/micromagician-motor.md) +- [Micro Magician V2 - Servo](https://github.com/rwaldron/johnny-five/blob/master/docs/micromagician-servo.md) + +### TinkerKit +- [TinkerKit - Accelerometer](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-accelerometer.md) +- [TinkerKit - Blink](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-blink.md) +- [TinkerKit - Button](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-button.md) +- [TinkerKit - Combo](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-combo.md) +- [TinkerKit - Continuous servo](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-continuous-servo.md) +- [TinkerKit - Gyro](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-gyroscope.md) +- [TinkerKit - Joystick](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-joystick.md) +- [TinkerKit - Linear potentiometer](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-linear-pot.md) +- [TinkerKit - Rotary potentiometer](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-rotary.md) +- [TinkerKit - Temperature](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-thermistor.md) +- [TinkerKit - Tilt](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-tilt.md) +- [TinkerKit - Touch](https://github.com/rwaldron/johnny-five/blob/master/docs/tinkerkit-touch.md) + +### Wii +- [Wii Classic Controller](https://github.com/rwaldron/johnny-five/blob/master/docs/classic-controller.md) +- [Wii Nunchuck](https://github.com/rwaldron/johnny-five/blob/master/docs/nunchuk.md) + +### Complete Bots / Projects +- [BOE Bot](https://github.com/rwaldron/johnny-five/blob/master/docs/boe-test-servos.md) +- [Bug](https://github.com/rwaldron/johnny-five/blob/master/docs/bug.md) +- [Kinect Robotic Arm Controller](https://github.com/rwaldron/johnny-five/blob/master/docs/kinect-arm-controller.md) +- [Laser Trip Wire](https://github.com/rwaldron/johnny-five/blob/master/docs/laser-trip-wire.md) +- [Line Follower](https://github.com/rwaldron/johnny-five/blob/master/docs/line-follower.md) +- [Lynxmotion Biped BRAT](https://github.com/rwaldron/johnny-five/blob/master/docs/brat.md) +- [Motobot](https://github.com/rwaldron/johnny-five/blob/master/docs/motobot.md) +- [Navigator](https://github.com/rwaldron/johnny-five/blob/master/docs/navigator.md) +- [Nodebot](https://github.com/rwaldron/johnny-five/blob/master/docs/nodebot.md) +- [Phoenix Hexapod](https://github.com/rwaldron/johnny-five/blob/master/docs/phoenix.md) +- [Radar](https://github.com/rwaldron/johnny-five/blob/master/docs/radar.md) +- [Robotic Claw](https://github.com/rwaldron/johnny-five/blob/master/docs/claw.md) +- [Whisker](https://github.com/rwaldron/johnny-five/blob/master/docs/whisker.md) + +### Component Plugin Template +- [Example plugin](https://github.com/rwaldron/johnny-five/blob/master/docs/plugin.md) + +### IO Plugins +- [Led Blink on Electric Imp](https://github.com/rwaldron/johnny-five/blob/master/docs/imp-io.md) +- [Led Blink on Intel Edison Arduino Board](https://github.com/rwaldron/johnny-five/blob/master/docs/edison-io-arduino.md) +- [Led Blink on Intel Edison Mini Board](https://github.com/rwaldron/johnny-five/blob/master/docs/edison-io-miniboard.md) +- [Led Blink on Intel Galileo Gen 2](https://github.com/rwaldron/johnny-five/blob/master/docs/galileo-io.md) +- [Led Blink on Raspberry Pi](https://github.com/rwaldron/johnny-five/blob/master/docs/raspi-io.md) +- [Led Blink on Spark Core](https://github.com/rwaldron/johnny-five/blob/master/docs/spark-io.md) +- [Led Blink on pcDuino3](https://github.com/rwaldron/johnny-five/blob/master/docs/pcduino-io.md) + + + +## Many fragments. Some large, some small. + +#### [Wireless Nodebot](http://jsfiddle.net/rwaldron/88M6b/show/light) +#### [Kinect Controlled Robot Arm](http://jsfiddle.net/rwaldron/XMsGQ/show/light/) +#### [Biped Nodebot](http://jsfiddle.net/rwaldron/WZkn5/show/light/) +#### [LCD Running Man](http://jsfiddle.net/rwaldron/xKwaU/show/light/) +#### [Slider Controlled Panning Servo](http://jsfiddle.net/rwaldron/kZakv/show/light/) +#### [Joystick Controlled Laser (pan/tilt) 1](http://jsfiddle.net/rwaldron/HPqms/show/light/) +#### [Joystick Controlled Laser (pan/tilt) 2](http://jsfiddle.net/rwaldron/YHb7A/show/light/) +#### [Joystick Controlled Claw](http://jsfiddle.net/rwaldron/6ZXFe/show/light/) +#### [Robot Claw](http://jsfiddle.net/rwaldron/CFSZJ/show/light/) +#### [Joystick, Motor & Led](http://jsfiddle.net/rwaldron/gADSz/show/light/) +#### [Build you own drone](http://github.com/darioodiaz/node-open-pilot/) + + + +## Make: JavaScript Robotics + +[![](http://ecx.images-amazon.com/images/I/91ae8ZZDQ2L.jpg)](http://shop.oreilly.com/product/0636920031390.do) + + + + +## Contributing +All contributions must adhere to the [Idiomatic.js Style Guide](https://github.com/rwaldron/idiomatic.js), +by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/gruntjs/grunt). + + +## License +Copyright (c) 2012, 2013, 2014 Rick Waldron +Licensed under the MIT license. +Copyright (c) 2014, 2015 The Johnny-Five Contributors +Licensed under the MIT license. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/accelerometer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/accelerometer.js new file mode 100644 index 00000000..cabbdbae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/accelerometer.js @@ -0,0 +1,1194 @@ +var Board = require("./board"); +var Expander = require("./expander"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Fn = require("./fn"); + +var constrain = Fn.constrain; +var fma = Fn.fma; +var int16 = Fn.int16; +var sum = Fn.sum; +var toFixed = Fn.toFixed; + +var priv = new Map(); +var calibrationSize = 10; + +var aX = "x"; +var aY = "y"; +var aZ = "z"; +var axes = [aX, aY, aZ]; + +function analogInitialize(opts, dataHandler) { + var state = priv.get(this); + var dataPoints = {}; + + state.zeroV = opts.zeroV || this.DEFAULTS.zeroV; + state.sensitivity = opts.sensitivity || this.DEFAULTS.sensitivity; + + this.pins.forEach(function(pin, index) { + this.io.pinMode(pin, this.io.MODES.ANALOG); + this.io.analogRead(pin, function(data) { + var axis = axes[index]; + dataPoints[axis] = data; + dataHandler(dataPoints); + }.bind(this)); + }, this); +} + +function analogToGravity(raw, axis) { + var state = priv.get(this); + var zeroV = state.zeroV; + + if (Array.isArray(zeroV) && zeroV.length > 0) { + var axisIndex = axes.indexOf(axis); + zeroV = zeroV[axisIndex || 0]; + } + + return (raw - zeroV) / state.sensitivity; +} + +var Controllers = { + ANALOG: { + DEFAULTS: { + value: { + zeroV: 478, + sensitivity: 96 + } + }, + initialize: { + value: analogInitialize + }, + toGravity: { + value: analogToGravity + } + }, + MPU6050: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var driver = IMU.Drivers.get(this.board, "MPU6050", opts); + var state = priv.get(this); + + state.sensitivity = opts.sensitivity || 16384; + + driver.on("data", function(data) { + dataHandler(data.accelerometer); + }); + } + }, + toGravity: { + value: function(raw) { + // Table 6.2 (Accelerometer specifications) + // Sensitivity for AFS_SEL=0 + // Full scale range +- 2g + // ADC word length 16 bit 2's complement + // 16384 LSB/g = 0.000061035 g/LSB = 0.061035156 mg/LSB + var state = priv.get(this); + // Returing a decimal part fixed at 3 digits, not sure if this assumption is correct + // (approximating to 0.061 mg/LSB) + return toFixed(raw / state.sensitivity, 3); + } + } + }, + BNO055: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var driver = IMU.Drivers.get(this.board, "BNO055", opts); + var state = priv.get(this); + + // Page 31, Table 3-17 + state.sensitivity = 100; + + driver.on("data", function(data) { + dataHandler(data.accelerometer); + }); + } + }, + toGravity: { + value: function(raw) { + // Page 31, Table 3-17 + // Assuming that the the `m/s^2` representation is used given that `state.sensitvity = 100` + // 1m/s^2 = 100LSB -> 1LSB = 0.01m/s^2 + var state = priv.get(this); + return toFixed(raw / state.sensitivity, 2); + } + } + }, + + ADXL335: { + DEFAULTS: { + value: { + zeroV: 330, + sensitivity: 66.5 + } + }, + initialize: { + value: analogInitialize + }, + toGravity: { + // Page 3, Table 1 + // Typical range +- 3.6g + // Sensitivity: 300mV/g + // MaxSensitvity: 330mv/g + value: function(value, axis) { + var read = analogToGravity.call(this, value, axis); + return toFixed(read, 3); + } + } + }, + + ADXL345: { + ADDRESSES: { + value: [0x53] + }, + REGISTER: { + value: { + // Page 23 + // REGISTER MAP + // + POWER: 0x2D, + // 0x31 49 DATA_FORMAT R/W 00000000 Data format control + DATA_FORMAT: 0x31, + // 0x32 50 DATAX0 R 00000000 X-Axis Data 0 + DATAX0: 0x32 + } + }, + initialize: { + value: function(opts, dataHandler) { + var READLENGTH = 6; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + this.io.i2cConfig(opts); + + // Standby mode + this.io.i2cWrite(address, this.REGISTER.POWER, 0); + + // Enable measurements + this.io.i2cWrite(address, this.REGISTER.POWER, 8); + + /* + + Page 26 + + Register 0x31—DATA_FORMAT (Read/Write) + + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + | - | - | - | - | - | - | - | - | + | T | S | I | - | F | J | R | + + T: SELF_TEST + S: SPI + I: INT_INVERT + -:- + F: FULL_RES + J: JUSTIFY + R: RANGE + + Range notes: https://github.com/rwaldron/johnny-five/issues/1135#issuecomment-219541346 + + +/- 16g 0b11 + +/- 8g 0b10 + +/- 4g 0b01 + +/- 2g 0b00 + + + Start with FULL_RES bit on + + 0b00001000 = 0x08 = 8 + */ + var format = 0x08; + + /* + Determine range + + 0b00000000 = 0 = ±2g + 0b00000001 = 1 = ±4g + 0b00000010 = 2 = ±8g + 0b00000011 = 3 = ±16g + */ + var range = ({ + 2: 0, + 4: 1, + 8: 2, + 16: 3 + })[opts.range || 2]; + + // Merge the format and range bits to set the DATA_FORMAT + this.io.i2cWrite(address, this.REGISTER.DATA_FORMAT, format | range); + + this.io.i2cRead(address, this.REGISTER.DATAX0, READLENGTH, function(data) { + dataHandler({ + x: int16(data[1], data[0]), + y: int16(data[3], data[2]), + z: int16(data[5], data[4]) + }); + }); + }, + }, + toGravity: { + value: function(raw) { + // Page 4, Table 1 + // + // Sensitivity + // All g-ranges, full resolution, 256LSB/g, 0.00390625g/LSB + return toFixed(raw * 0.00390625, 8); + } + } + }, + MMA7361: { + DEFAULTS: { + value: { + zeroV: [372, 372, 287], + sensitivity: 170 + } + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + /* istanbul ignore else */ + if (opts.sleepPin !== undefined) { + state.sleepPin = opts.sleepPin; + this.io.pinMode(state.sleepPin, 1); + this.io.digitalWrite(state.sleepPin, 1); + } + + analogInitialize.call(this, opts, dataHandler); + } + }, + toGravity: { + // Page 3, Table 2 + // + // Sensitivity + // 1.5g, 800mV/g + // 6g, 221.5mV/g + value: function(value, axis) { + var read = analogToGravity.call(this, value, axis); + return toFixed(read, 3); + } + }, + enabledChanged: { + value: function(value) { + var state = priv.get(this); + + /* istanbul ignore else */ + if (state.sleepPin !== undefined) { + this.io.digitalWrite(state.sleepPin, value ? 1 : 0); + } + } + } + }, + MMA8452: { + ADDRESSES: { + value: [0x1D] + }, + REGISTER: { + value: { + // Page 18 + // 6. Register Descriptions + STATUS: 0x00, + OUT_X_MSB: 0x01, + XYZ_DATA_CFG: 0x0E, + PULSE_CFG: 0x21, + PULSE_SRC: 0x22, + PULSE_THSX: 0x23, + PULSE_THSY: 0x24, + PULSE_THSZ: 0x25, + PULSE_TMLT: 0x26, + PULSE_LTCY: 0x27, + PULSE_WIND: 0x28, + CTRL_REG1: 0x2A, + CTRL_REG4: 0x2E, + CTRL_REG5: 0x2F, + } + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + // TODO: make user definable. + // 0b000 800Hz + // 0b001 400Hz + // 0b010 200Hz + // 0b011 100Hz + // 0b100 50Hz + // 0b101 12Hz + // 0b110 6Hz + + var rates = [800, 400, 200, 100, 50, 12, 6, ]; + var odr = rates.indexOf(opts.odr || 800); + var scale = opts.range || 2; + var fsr = ({ + 2: 0, + 4: 1, + 8: 2 + })[scale]; + + opts.taps = opts.taps || { + x: false, + y: false, + z: true, + }; + + var taps = { + x: opts.taps.x ? 0x08 : 0x80, + y: opts.taps.y ? 0x08 : 0x80, + z: opts.taps.z ? 0x08 : 0x80, + }; + + state.scale = scale; + + var computed = { + x: null, + y: null, + z: null, + }; + + this.io.i2cConfig( + Object.assign(opts, { + settings: { + stopTX: false + } + }) + ); + + if (odr === -1) { + throw new RangeError("Invalid odr. Expected one of: 800, 400, 200, 100, 50, 12, 6"); + } + + /* + Initial CTRL_REG1 State + + 11000010 = 194 = 0xC2 -> ? + 00000010 = 8 = 0x08 + ^--------- ASLP_RATE1 + ^-------- ASLP_RATE0 + ^------- DR2 + ^------ DR1 + ^----- DR0 + ^---- Noise + ^--- Fast Read + ^-- Standby Mode + */ + + var config = 0x08; + + /* + Page 5 (AN4076) + 4.0 Setting the Data Rate + + Set ODR + + Shift the odr bits into place. + + Default: 800Hz + + 11000010 = 194 = 0xC2 -> ? + 00000010 = 8 = 0x08 + ^^^----- DR2, DR1, DR0: 000 + */ + config |= odr << 3; + + /* + Enter Standby Mode + + 11000010 = 194 = 0xC2 -> ? + ^--- Fast Read + ^-- Standby Mode + + 00000010 = 8 = 0x08 + ^--- Fast Read + ^-- Standby Mode + + */ + + this.io.i2cWriteReg(address, this.REGISTER.CTRL_REG1, config); + + /* + Set FSR + + Default: ±2g + + 00000000 = 0 = 0x00 () + ^^----- FS1, FS2 + */ + this.io.i2cWriteReg(address, this.REGISTER.XYZ_DATA_CFG, fsr); + + var temp = 0; + + /* + Page 10 (AN4072) + 4.2 Registers 0x23 - 0x25 PULSE_THSX, Y, Z + Pulse Threshold for X, Y and Z Registers + + 0x80 = B7 is HIGH + 10000000 + If B7 is HIGH, do not enable + */ + if (!(taps.x & 0x80)) { + // 00000011 + temp |= 0x03; + this.io.i2cWriteReg(address, this.REGISTER.PULSE_THSX, taps.x); + } + + if (!(taps.y & 0x80)) { + // 00001100 + temp |= 0x0C; + this.io.i2cWriteReg(address, this.REGISTER.PULSE_THSY, taps.y); + } + + if (!(taps.z & 0x80)) { + // 00110000 + temp |= 0x30; + this.io.i2cWriteReg(address, this.REGISTER.PULSE_THSZ, taps.z); + } + + /* + Page 11, 12, 13 (AN4072) + + Configure Tap Axis' + + Table 1. Register 0x21 PULSE_CFG Register (Read/Write) and Description + + | Tap Enable | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | + | | DPA | ELE | ZD | ZS | YD | YS | XD | XS | + | Single | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | + | Double | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | + | Both | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + + + In the default case, `temp | 0x40` will be: + + 01110000 = 112 = 0x70 + + Latch On + ZD On + ZS On + + */ + + this.io.i2cWriteReg(address, this.REGISTER.PULSE_CFG, temp | 0x40); + + /* + Set TIME LIMIT for tap detection + + 60ms / 800Hz = 60ms / 1.25ms = 48 (counts) = 0x30 + 80ms / 800Hz = 80ms / 1.25ms = 64 (counts) = 0x40 + */ + this.io.i2cWriteReg(address, this.REGISTER.PULSE_TMLT, 60 / (1000 / rates[odr])); + /* + Set the PULSE LATENCY. + + This is the time that must pass after the first + tap, but within the PULSE WINDOW for a double tap to register. + + 200ms / 800Hz = 200ms / 1.25ms = 160 (counts) = 0xA0 + */ + this.io.i2cWriteReg(address, this.REGISTER.PULSE_LTCY, 200 / (1000 / rates[odr])); + + /* + Set the PULSE WINDOW. + + This is the maximum interval of time to elapse after the latency + interval, for which the second pulse must occur for double taps. + + The maximum allowed time: + + 800Hz * 255 = 1.25ms * 255 = 318ms + */ + this.io.i2cWriteReg(address, this.REGISTER.PULSE_WIND, 0xFF); + + /* + Leave Standby Mode + + 11000011 = 195 = 0xC3 + 00000011 = 3 = 0x03 + ^--- Fast Read + ^-- Standby Mode + */ + + config |= 0x01; + + this.io.i2cWriteReg(address, this.REGISTER.CTRL_REG1, config); + + + this.io.i2cRead(address, this.REGISTER.STATUS, 7, function(data) { + var status = (data.shift() & 0x08) >>> 3; + + /* istanbul ignore else */ + if (status) { + // Page 9 (AN4076) + // + // 7.0 14-bit, 12-bit or 10-bit Data Streaming and Data Conversions + computed.x = int16(data[0], data[1]) >> 4; + computed.y = int16(data[2], data[3]) >> 4; + computed.z = int16(data[4], data[5]) >> 4; + + dataHandler(computed); + } + }.bind(this)); + + this.io.i2cRead(address, this.REGISTER.PULSE_SRC, 1, function(data) { + var status = data[0]; + var tap = status & 0x7F; + + /* istanbul ignore else */ + if (status & 0x80) { + this.emit("tap"); + + // Single Tap + /* istanbul ignore else */ + if ((tap >> 2) & 0x01) { + this.emit("tap:single"); + + // Double Tap (must be both S and D bits) + /* istanbul ignore else */ + if ((tap >> 3) & 0x01) { + this.emit("tap:double"); + } + } + } + }.bind(this)); + }, + }, + toGravity: { + value: function(raw) { + // + // Paragraph 3.1, page 9 + // Sensitivity + // 2g, 1024 counts/g, 0.000976562g/count + // 4g, 512 counts/g, 0.001953125g/count + // 8g, 256 counts/g, 0.00390625g/count + var state = priv.get(this); + // return raw / ((1 << 11) * state.scale); + return toFixed(raw / ((1 << 11) * state.scale), 4); + } + } + }, + MMA7660: { + ADDRESSES: { + value: [0x4C] + }, + REGISTER: { + value: { + XOUT: 0x00, + MODE: 0x07, + SR: 0x08, + } + }, + initialize: { + value: function(opts, dataHandler) { + var READLENGTH = 3; + var address = opts.address || this.ADDRESSES[0]; + var state = priv.get(this); + + state.sensitivity = 21.33; + + opts.address = address; + + this.io.i2cConfig(opts); + + // + // Standby mode + this.io.i2cWrite(address, this.REGISTER.MODE, 0x00); + + // Sample Rate () + this.io.i2cWrite(address, this.REGISTER.SR, 0x07); + + // Active Mode + this.io.i2cWrite(address, this.REGISTER.MODE, 0x01); + + this.io.i2cRead(address, this.REGISTER.XOUT, READLENGTH, function(data) { + dataHandler({ + // Page. 13 + // D7 D6 D5 D4 D3 D2 D1 D0 + // -- -A XOUT[5] XOUT[4] XOUT[3] XOUT[2] XOUT[1] XOUT[0] + x: data[0] & 0b00111111, + y: data[1] & 0b00111111, + z: data[2] & 0b00111111, + }); + }); + }, + }, + toGravity: { + value: function(raw) { + var state = priv.get(this); + // Page 28 + return toFixed(raw / state.sensitivity, 3); + } + } + }, + + ESPLORA: { + DEFAULTS: { + value: { + zeroV: [320, 330, 310], + sensitivity: 170 + } + }, + initialize: { + value: function(opts, dataHandler) { + this.pins = [5, 11, 6]; + analogInitialize.call(this, opts, dataHandler); + } + }, + toGravity: { + value: function(value, axis) { + var read = analogToGravity.call(this, value, axis); + return toFixed(read, 2); + } + } + }, + + LIS3DH: { + ADDRESSES: { + value: [0x18] + }, + REGISTER: { + value: { + OUT_X_L: 0x28, + CTRL_REG1: 0x20, + CTRL_REG2: 0x21, + CTRL_REG3: 0x22, + CTRL_REG4: 0x23, + CTRL_REG5: 0x24, + + TEMP_CFG_REG: 0x1F, + + CLICK_CFG: 0x38, + CLICK_SRC: 0x39, + CLICK_THS: 0x3A, + TIME_LIMIT: 0x3B, + TIME_LATENCY: 0x3C, + TIME_WINDOW: 0x3D, + } + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || 0x18; + + // 2G = 0b00 + // 4G = 0b01 + // 8G = 0b10 + // 16G = 0b11 + var range = ({ + 2: 0, + 4: 1, + 8: 2, + 16: 3 + })[opts.range || 4]; + + /* istanbul ignore if */ + if (range === undefined) { + range = 1; + } + + var divider = [ + 16380, + 8190, + 4096, + 1365, + ][range]; + + /* istanbul ignore if */ + if (divider === undefined) { + divider = 1; + } + + var threshold = [ + 80, + 40, + 20, + 10, + ][range]; + + /* istanbul ignore if */ + if (threshold === undefined) { + threshold = 10; + } + + + state.divider = divider; + state.expander = Expander.get({ + address: address, + controller: this.controller, + bus: this.bus, + }); + + // TODO: this should come from the expander + var ctrl4 = 0x88 | (range << 4); + + state.expander.i2cWrite(address, this.REGISTER.CTRL_REG4, ctrl4); + + // Acceleration + state.expander.i2cReadOnce(address, this.REGISTER.CTRL_REG1, 1, function(data) { + var ctrl1 = data[0]; + + // Set to 200Hz + ctrl1 &= ~0xF0; + ctrl1 |= 6 << 4; + + state.expander.i2cWrite(address, this.REGISTER.CTRL_REG1, ctrl1); + + // Page 21 + // 6.1.1 I2C operation + // Autoincrement bit set on register (0x80) + state.expander.i2cRead(address, this.REGISTER.OUT_X_L | 0x80, 6, function(data) { + dataHandler({ + x: Fn.int16(data[1], data[0]), + y: Fn.int16(data[3], data[2]), + z: Fn.int16(data[5], data[4]), + }); + }); + + + // Tap + // TODO: make this optional (use "newListener"?) + // + // See MMA8452 driver for strategy + // + // state.expander.i2cReadOnce(address, this.REGISTER.CTRL_REG3, 1, function(data) { + // var ctrl3 = data[0]; + + // // Shut off Int 1 Click + // ctrl3 &= ~0x80; + // ctrl3 |= 6 << 4; + + // state.expander.i2cWrite(address, this.REGISTER.CTRL_REG1, ctrl3); + + // // Page 21 + // // 6.1.1 I2C operation + // // Autoincrement bit set on register (0x80) + // state.expander.i2cRead(address, this.REGISTER.OUT_X_L | 0x80, 6, function(data) { + // dataHandler({ + // x: Fn.int16(data[1], data[0]), + // y: Fn.int16(data[3], data[2]), + // z: Fn.int16(data[5], data[4]), + // }); + // }); + // }.bind(this)); + + + + // Page 35 + // 8.3.7 CTRL_REG3 [Interrupt CTRL register] (22h) + state.expander.i2cWrite(address, this.REGISTER.CTRL_REG3, 0x80); + + // Page 40 + // 9.2.1 Control register 5 (0x24) + state.expander.i2cWrite(address, this.REGISTER.CTRL_REG5, 0x08); + + // Page 32 + // 8.3.1 TAP_CFG + // + // This register is called both CLICK_CFG and TAP_CFG + // + // 0b00101010 = 0x2A = 42 + state.expander.i2cWrite(address, this.REGISTER.CLICK_CFG, 0x2A); + + // Page 36 + // 8.4.1 Playing with TAP_TimeLimit + // + // ...Offers some guidance. Ultimately I opted to take inspiration + // from Adafruit's driver and example: + var timelimit = 10; + var timelatency = 20; + var timewindow = 255; + + state.expander.i2cWrite(address, this.REGISTER.CLICK_THS, threshold); + state.expander.i2cWrite(address, this.REGISTER.TIME_LIMIT, timelimit); + state.expander.i2cWrite(address, this.REGISTER.TIME_LATENCY, timelatency); + state.expander.i2cWrite(address, this.REGISTER.TIME_WINDOW, timewindow); + + // Page 33 + // 8.3.2 TAP_SRC (39h) + var lastEmitTime = null; + + state.expander.i2cRead(address, this.REGISTER.CLICK_SRC, 1, function(data) { + var status = data[0]; + var thisEmitTime = Date.now(); + // var tap = status & 0x7F; + + if (lastEmitTime === null) { + lastEmitTime = thisEmitTime - 101; + } + + /* istanbul ignore if */ + if (thisEmitTime < (lastEmitTime + 100)) { + return; + } + + if (status === 0x00) { + return; + } + + /* istanbul ignore if */ + if (!(status & 0x30)) { + return; + } + + lastEmitTime = thisEmitTime; + + this.emit("tap"); + + if (status & 0x10) { + this.emit("tap:single"); + } + + if (status & 0x20) { + // TODO: Figure out if we can determine a + // combined single + double tap + this.emit("tap:single"); + this.emit("tap:double"); + } + }.bind(this)); + }.bind(this)); + }, + }, + toGravity: { + value: function(raw) { + // Table 4, page 10 + var state = priv.get(this); + return toFixed(raw / state.divider, 3); + }, + }, + }, + LSM303C: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var driver = IMU.Drivers.get(this.board, "LSM303C", opts); + driver.on("data", function(data) { + dataHandler(data.accelerometer); + }); + } + }, + toGravity: { + value: function(raw) { + return toFixed(raw, 2); + } + } + }, +}; + +// Otherwise known as... +Controllers.TINKERKIT = Controllers.ANALOG; +Controllers.MMA8452Q = Controllers.MMA8452; + +function magnitude(x, y, z) { + var a; + + a = x * x; + a = fma(y, y, a); + a = fma(z, z, a); + + return Math.sqrt(a); +} + +/** + * Accelerometer + * @constructor + * + * five.Accelerometer([ x, y[, z] ]); + * + * five.Accelerometer({ + * pins: [ x, y[, z] ] + * zeroV: ... + * sensitivity: ... + * }); + * + * + * @param {Object} opts [description] + * + */ + +function Accelerometer(opts) { + if (!(this instanceof Accelerometer)) { + return new Accelerometer(opts); + } + + var controller = null; + + var state = { + enabled: true, + x: { + value: 0, + previous: 0, + stash: [], + orientation: null, + inclination: null, + acceleration: null, + calibration: [] + }, + y: { + value: 0, + previous: 0, + stash: [], + orientation: null, + inclination: null, + acceleration: null, + calibration: [] + }, + z: { + value: 0, + previous: 0, + stash: [], + orientation: null, + inclination: null, + acceleration: null, + calibration: [] + } + }; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.ANALOG; + } + + Board.Controller.call(this, controller, opts); + + if (!this.toGravity) { + this.toGravity = opts.toGravity || function(raw) { + return raw; + }; + } + + if (!this.enabledChanged) { + this.enabledChanged = function() {}; + } + + priv.set(this, state); + + /* istanbul ignore else */ + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + var isChange = false; + + if (!state.enabled) { + return; + } + + Object.keys(data).forEach(function(axis) { + var value = data[axis]; + var sensor = state[axis]; + + if (opts.autoCalibrate && sensor.calibration.length < calibrationSize) { + var axisIndex = axes.indexOf(axis); + sensor.calibration.push(value); + + if (!Array.isArray(state.zeroV)) { + state.zeroV = []; + } + + state.zeroV[axisIndex] = sum(sensor.calibration) / sensor.calibration.length; + if (axis === aZ) { + state.zeroV[axisIndex] -= state.sensitivity; + } + } + + // The first run needs to prime the "stash" + // of data values. + if (sensor.stash.length === 0) { + for (var i = 0; i < 5; i++) { + sensor.stash[i] = value; + } + } + + sensor.previous = sensor.value; + sensor.stash.shift(); + sensor.stash.push(value); + + sensor.value = (sum(sensor.stash) / 5) | 0; + + if (this.acceleration !== sensor.acceleration) { + sensor.acceleration = this.acceleration; + isChange = true; + this.emit("acceleration", sensor.acceleration); + } + + if (this.orientation !== sensor.orientation) { + sensor.orientation = this.orientation; + isChange = true; + this.emit("orientation", sensor.orientation); + } + + if (this.inclination !== sensor.inclination) { + sensor.inclination = this.inclination; + isChange = true; + this.emit("inclination", sensor.inclination); + } + }, this); + + this.emit("data", { + x: state.x.value, + y: state.y.value, + z: state.z.value + }); + + if (isChange) { + this.emit("change", { + x: this.x, + y: this.y, + z: this.z + }); + } + }.bind(this)); + } + + Object.defineProperties(this, { + hasAxis: { + writable: true, + value: function(axis) { + /* istanbul ignore next */ + return state[axis] ? state[axis].stash.length > 0 : false; + } + }, + enable: { + value: function() { + state.enabled = true; + this.enabledChanged(true); + return this; + } + }, + disable: { + value: function() { + state.enabled = false; + this.enabledChanged(false); + return this; + } + }, + zeroV: { + get: function() { + return state.zeroV; + } + }, + /** + * [read-only] Calculated pitch value + * @property pitch + * @type Number + */ + pitch: { + get: function() { + var x = this.x; + var y = this.y; + var z = this.z; + var rads = this.hasAxis(aZ) ? + Math.atan2(x, Math.hypot(y, z)) : + Math.asin(constrain(x, -1, 1)); + + return toFixed(rads * Fn.RAD_TO_DEG, 2); + } + }, + /** + * [read-only] Calculated roll value + * @property roll + * @type Number + */ + roll: { + get: function() { + var x = this.x; + var y = this.y; + var z = this.z; + var rads = this.hasAxis(aZ) ? + Math.atan2(y, Math.hypot(x, z)) : + Math.asin(constrain(y, -1, 1)); + + return toFixed(rads * Fn.RAD_TO_DEG, 2); + } + }, + x: { + get: function() { + return this.toGravity(state.x.value, aX); + } + }, + y: { + get: function() { + return this.toGravity(state.y.value, aY); + } + }, + z: { + get: function() { + return this.hasAxis(aZ) ? + this.toGravity(state.z.value, aZ) : 0; + } + }, + acceleration: { + get: function() { + return magnitude( + this.x, + this.y, + this.z + ); + } + }, + inclination: { + get: function() { + return Math.atan2(this.y, this.x) * Fn.RAD_TO_DEG; + } + }, + orientation: { + get: function() { + var abs = Math.abs; + var x = this.x; + var y = this.y; + var z = this.hasAxis(aZ) ? this.z : 1; + var absX = abs(x); + var absY = abs(y); + var absZ = abs(z); + + if (absX < absY && absX < absZ) { + if (x > 0) { + return 1; + } + return -1; + } + if (absY < absX && absY < absZ) { + if (y > 0) { + return 2; + } + return -2; + } + if (absZ < absX && absZ < absY) { + // TODO: figure out how to test this + /* istanbul ignore else */ + if (z > 0) { + return 3; + } + /* istanbul ignore next */ + return -3; + } + return 0; + } + } + }); +} + +util.inherits(Accelerometer, Emitter); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Accelerometer.Controllers = Controllers; + Accelerometer.purge = function() { + priv.clear(); + }; +} + + +module.exports = Accelerometer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/altimeter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/altimeter.js new file mode 100644 index 00000000..a2b68a45 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/altimeter.js @@ -0,0 +1,224 @@ +var Board = require("./board"); +var Fn = require("./fn"); +var Emitter = require("events").EventEmitter; +var util = require("util"); + +var Controllers = { + MPL3115A2: { + requirements: { + value: { + options: { + elevation: { + throws: false, + message: "Missing `elevation` option. Without a specified base `elevation`, the altitude measurement will be inaccurate. Use the meters value shown on whatismyelevation.com", + typeof: "number", + } + } + } + }, + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MPL3115A2", opts); + driver.on("data", function(data) { + dataHandler(data.altitude); + }); + } + }, + toMeters: { + value: function(raw) { + + // Table 2, Note 3 + // "Smallest bit change in register represents minimum value change in + // Pascals or meters. Typical resolution to signify change in altitudeis 0.3 m" + return Fn.toFixed(raw, 1); + } + } + }, + MS5611: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MS5611", opts); + driver.on("data", function(data) { + dataHandler(data.altitude); + }); + } + }, + toMeters: { + value: function(raw) { + // Datasheet available at http://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=MS5611-01BA03&DocType=Data+Sheet&DocLang=English + // + // From page 1 + // "This barometric pressure sensor is optimized for + // altimeters and variometers with an altitude resolution of 10 cm." + return Fn.toFixed(raw, 2); + } + } + }, + + BMP180: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BMP180", opts); + driver.on("data", function(data) { + dataHandler(data.altitude); + }); + } + }, + toMeters: { + value: function(raw) { + // Page 6, Table 1 + // Resolution of output data 0.01hPa + // + // From paragraph 3.6, page 16 1hPa=8.43m + // resolution ~= 0.08m + return Fn.toFixed(raw, 2); + } + } + }, + + BMP280: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BMP280", opts); + driver.on("data", function(data) { + dataHandler(data.altitude); + }); + } + }, + toMeters: { + value: function(raw) { + // Page 8, Table 2 + // Resolution of output data in ultra high resolution mode 0.0016hPa + // 1hPa=8.43m + // resolution ~= 0.013m + return Fn.toFixed(raw, 3); + } + } + }, + BME280: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BME280", opts); + driver.on("data", function(data) { + dataHandler(data.altitude); + }); + } + }, + toMeters: { + value: function(raw) { + // Page 10, Table 3 + // Resolution of pressure output data 0.18Pa + // 1hPa=8.43m + // 100Pa=8.43m + // resolution ~= 0.015m + return Fn.toFixed(raw, 3); + } + } + }, + +}; + +Controllers["BMP085"] = Controllers["BMP-085"] = Controllers.BMP180; + +var priv = new Map(); + +function Altimeter(opts) { + if (!(this instanceof Altimeter)) { + return new Altimeter(opts); + } + + var controller = null; + var freq; + var last = null; + var raw = null; + var state = {}; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + freq = opts.freq || 25; + + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + throw new Error("Altimeter expects a valid controller"); + } + + priv.set(this, state); + + Board.Controller.call(this, controller, opts); + + if (!this.toMeters) { + this.toMeters = opts.toMeters || function(x) { + return x; + }; + } + + var descriptors = { + meters: { + get: function() { + return this.toMeters(raw); + } + }, + feet: { + get: function() { + return Fn.toFixed(this.meters * 3.28084, 2); + } + } + }; + // Convenience aliases + descriptors.m = descriptors.meters; + descriptors.ft = descriptors.feet; + + Object.defineProperties(this, descriptors); + + + /* istanbul ignore else */ + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + setInterval(function() { + if (raw == null) { + return; + } + + var data = {}; + data.m = data.meters = this.meters; + data.ft = data.feet = this.feet; + + this.emit("data", data); + + /* istanbul ignore else */ + if (this.meters !== last) { + last = this.meters; + this.emit("change", data); + } + }.bind(this), freq); +} + +util.inherits(Altimeter, Emitter); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Altimeter.Controllers = Controllers; + Altimeter.purge = function() { + priv.clear(); + }; +} + + +module.exports = Altimeter; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/animation.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/animation.js new file mode 100644 index 00000000..90ef1c00 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/animation.js @@ -0,0 +1,569 @@ +// TODO list +// Use functions as keyFrames +// Test metronomic on real animation + +// Create jquery FX like queue + +var Emitter = require("events").EventEmitter; +var util = require("util"); +var ease = require("ease-component"); +var Fn = require("./fn"); +var temporal; + + +/** + * The max time we want to allow a temporal animation segment to run. + * When running, temporal can push CPU utilization to 100%. When this + * time (in ms) is reached we will fall back to setInterval which is less + * accurate (by nanoseconds) but perfectly serviceable. + **/ +var temporalTTL = 5000; + +/** + * Placeholders for Symbol + */ +Animation.keys = "@@keys"; +Animation.normalize = "@@normalize"; +Animation.render = "@@render"; + +/** + * Temporal will run up the CPU. temporalFallback is used + * for long running animations. + */ +Animation.TemporalFallback = function(animation) { + this.interval = setInterval(function() { + animation.loopFunction({ + calledAt: Date.now() + }); + }, animation.rate); +}; + +Animation.TemporalFallback.prototype.stop = function() { + if (this.interval) { + clearInterval(this.interval); + } +}; + +/** + * Animation + * @constructor + * + * @param {target} A Servo or Servo.Collection to be animated + * + * Animating a single servo + * + * var servo = new five.Servo(10); + * var animation = new five.Animation(servo); + * animation.enqueue({ + * cuePoints: [0, 0.25, 0.75, 1], + * keyFrames: [{degrees: 90}, 60, -120, {degrees: 90}], + * duration: 2000 + * }); + * + * + * Animating a servo array + * + * var a = new five.Servo(9), + * b = new five.Servo(10); + * var servos = new five.Servo.Collection([a, b]); + * var animation = new five.Animation(servos); + * animation.enqueue({ + * cuePoints: [0, 0.25, 0.75, 1], + * keyFrames: [ + * [{degrees: 90}, 60, -120, {degrees: 90}], + * [{degrees: 180}, -120, 90, {degrees: 180}], + * ], + * duration: 2000 + * }); + * + */ + +function Animation(target) { + + // Necessary to avoid loading temporal unless necessary + if (!temporal) { + temporal = require("temporal"); + } + + if (!(this instanceof Animation)) { + return new Animation(target); + } + + Animation.Segment.call(this); + + this.defaultTarget = target || {}; +} + +util.inherits(Animation, Emitter); + +/** + * Animation.Segment() + * + * Create a defaulted segment. + * + * Every property ever used on an animation segment + * MUST be listed here, otherwise properties will + * persist across segments. This default object is + * primarily for resetting state. + * + */ +Animation.Segment = function(options) { + this.cuePoints = [0, 1]; + this.duration = 1000; + this.easing = "linear"; + this.loop = false; + this.loopback = 0; + this.metronomic = false; + this.currentSpeed = 1; + this.progress = 0; + this.fps = 60; + this.rate = 1000 / 60; + this.paused = false; + this.isRunning = false; + this.segments = []; + this.onstart = null; + this.onpause = null; + this.onstop = null; + this.oncomplete = null; + this.onloop = null; + + if (options) { + Object.assign(this, options); + + if (options.segments) { + this.segments = options.segments.slice(); + } + } +}; + + +/** + * Add an animation segment to the animation queue + * @param {Object} opts Options: cuePoints, keyFrames, duration, + * easing, loop, metronomic, progress, fps, onstart, onpause, + * onstop, oncomplete, onloop + */ +Animation.prototype.enqueue = function(opts) { + + opts = opts || {}; + + /* istanbul ignore else */ + if (typeof opts.target === "undefined") { + opts.target = this.defaultTarget; + } + + this.segments.push(opts); + + /* istanbul ignore if */ + if (!this.paused && !this.isRunning) { + this.next(); + } + + return this; + +}; + +/** + * Plays next segment in queue + * Users need not call this. It's automatic + */ +Animation.prototype.next = function() { + + if (this.isRunning) { + return this; + } else { + this.isRunning = true; + } + + if (this.segments.length > 0) { + var segment = new Animation.Segment(this.segments.shift()); + + Object.assign(this, segment); + this.paused = this.currentSpeed === 0 ? true : false; + + if (this.onstart) { + this.onstart(); + } + + this.normalizeKeyframes(); + + if (this.reverse) { + this.currentSpeed *= -1; + } + + if (this.currentSpeed !== 0) { + this.play(); + } else { + this.paused = true; + } + } else { + this.playLoop.stop(); + } + + return this; +}; + +/** + * pause + * + * Pause animation while maintaining progress, speed and segment queue + * + */ + +Animation.prototype.pause = function() { + + this.emit("animation:pause"); + + if (this.playLoop) { + this.playLoop.stop(); + } + this.paused = true; + + if (this.onpause) { + this.onpause(); + } + +}; + +/** + * stop + * + * Stop all animations + * + */ + +Animation.prototype.stop = function() { + + this.emit("animation:stop"); + + this.segments = []; + this.isRunning = false; + if (this.playLoop) { + this.playLoop.stop(); + } + + if (this.onstop) { + this.onstop(); + } + +}; + +/** + * speed + * + * Get or set the current playback speed + * + * @param {Number} speed + * + */ + +Animation.prototype.speed = function(speed) { + + if (typeof speed === "undefined") { + return this.currentSpeed; + } else { + this.currentSpeed = speed; + + // Find our timeline endpoints and refresh rate + this.scaledDuration = this.duration / Math.abs(this.currentSpeed); + this.startTime = Date.now() - this.scaledDuration * this.progress; + this.endTime = this.startTime + this.scaledDuration; + + if (!this.paused) { + this.play(); + } + return this; + } +}; + +/** + * This function is called in each frame of our animation + * Users need not call this. It's automatic + */ + +Animation.prototype.loopFunction = function(loop) { + + // Find the current timeline progress + var progress = this.calculateProgress(loop.calledAt); + + // Find the left and right cuePoints/keyFrames; + var indices = this.findIndices(progress); + + // call render function with tweened value + this.target[Animation.render](this.tweenedValue(indices, progress)); + + /** + * If this animation has been running in temporal for too long + * fall back to using setInterval so we don't melt the user's CPU + **/ + if (loop.calledAt > this.fallBackTime) { + this.fallBackTime = Infinity; + if (this.playLoop) { + this.playLoop.stop(); + } + this.playLoop = new Animation.TemporalFallback(this); + } + + // See if we have reached the end of the animation + /* istanbul ignore else */ + if ((this.progress === 1 && !this.reverse) || (progress === this.loopback && this.reverse)) { + + if (this.loop || (this.metronomic && !this.reverse)) { + + if (this.onloop) { + this.onloop(); + } + + if (this.metronomic) { + this.reverse = this.reverse ? false : true; + } + + this.normalizeKeyframes(); + this.progress = this.loopback; + this.startTime = Date.now() - this.scaledDuration * this.progress; + this.endTime = this.startTime + this.scaledDuration; + } else { + + this.isRunning = false; + + if (this.oncomplete) { + process.nextTick(this.oncomplete.bind(this)); + } + + if (this.segments.length > 0) { + process.nextTick(() => { this.next(); }); + } else { + this.stop(); + } + } + } +}; + +/** + * play + * + * Start a segment + */ + +Animation.prototype.play = function() { + var now = Date.now(); + + if (this.playLoop) { + this.playLoop.stop(); + } + + this.paused = false; + this.isRunning = true; + + // Find our timeline endpoints and refresh rate + this.scaledDuration = this.duration / Math.abs(this.currentSpeed); + this.startTime = now - this.scaledDuration * this.progress; + this.endTime = this.startTime + this.scaledDuration; + + // If our animation runs for more than 5 seconds switch to setTimeout + this.fallBackTime = now + temporalTTL; + this.frameCount = 0; + + /* istanbul ignore else */ + if (this.fps) { + this.rate = 1000 / this.fps; + } + + this.rate = this.rate | 0; + + this.playLoop = temporal.loop(this.rate, this.loopFunction.bind(this)); +}; + +Animation.prototype.findIndices = function(progress) { + var indices = { + left: null, + right: null + }; + + // Find our current before and after cuePoints + indices.right = this.cuePoints.findIndex(function(point) { + return point >= progress; + }); + + indices.left = indices.right === 0 ? /* istanbul ignore next */ 0 : indices.right - 1; + + return indices; +}; + +Animation.prototype.calculateProgress = function(calledAt) { + + var progress = (calledAt - this.startTime) / this.scaledDuration; + + if (progress > 1) { + progress = 1; + } + + this.progress = progress; + + if (this.reverse) { + progress = 1 - progress; + } + + // Ease the timeline + // to do: When reverse replace inFoo with outFoo and vice versa. skip inOutFoo + progress = ease[this.easing](progress); + progress = Fn.constrain(progress, 0, 1); + + return progress; +}; + +Animation.prototype.tweenedValue = function(indices, progress) { + + var tween = { + duration: null, + progress: null + }; + + var result = this.normalizedKeyFrames.map(function(keyFrame) { + // Note: "this" is bound to the animation object + + var memberIndices = { + left: null, + right: null + }; + + // If the keyframe at indices.left is null, move left + for (memberIndices.left = indices.left; memberIndices.left > -1; memberIndices.left--) { + /* istanbul ignore else */ + if (keyFrame[memberIndices.left] !== null) { + break; + } + } + + // If the keyframe at indices.right is null, move right + memberIndices.right = keyFrame.findIndex(function(frame, index) { + return index >= indices.right && frame !== null; + }); + + // Find our progress for the current tween + tween.duration = this.cuePoints[memberIndices.right] - this.cuePoints[memberIndices.left]; + tween.progress = (progress - this.cuePoints[memberIndices.left]) / tween.duration; + + // Catch divide by zero + if (!Number.isFinite(tween.progress)) { + /* istanbul ignore next */ + tween.progress = this.reverse ? 0 : 1; + } + + var left = keyFrame[memberIndices.left], + right = keyFrame[memberIndices.right]; + + // Apply tween easing to tween.progress + // to do: When reverse replace inFoo with outFoo and vice versa. skip inOutFoo + tween.progress = ease[right.easing](tween.progress); + + // Calculate this tween value + var calcValue; + + if (right.position) { + // This is a tuple + calcValue = right.position.map(function(value, index) { + return (value - left.position[index]) * + tween.progress + left.position[index]; + }); + } else { + if (typeof right.value === "number" && typeof left.value === "number") { + calcValue = (right.value - left.value) * tween.progress + left.value; + } else { + calcValue = this.target[Animation.keys].reduce(function(accum, key) { + accum[key] = (right.value[key] - left.value[key]) * tween.progress + left.value[key]; + return accum; + }, {}); + } + } + + return calcValue; + }, this); + + return result; +}; + +// Make sure our keyframes conform to a standard +Animation.prototype.normalizeKeyframes = function() { + + var previousVal, + keyFrameSet = Fn.cloneDeep(this.keyFrames), + cuePoints = this.cuePoints; + + // Run through the target's normalization + keyFrameSet = this.target[Animation.normalize](keyFrameSet); + + // keyFrames can be passed as a single dimensional array if + // there is just one servo/device. If the first element is not an + // array, nest keyFrameSet so we only have to deal with one format + if (!Array.isArray(keyFrameSet[0])) { + keyFrameSet = [keyFrameSet]; + } + + keyFrameSet.forEach(function(keyFrames) { + + // Pad the right side of keyFrames arrays with null + for (var i = keyFrames.length; i < cuePoints.length; i++) { + keyFrames.push(null); + } + + keyFrames.forEach(function(keyFrame, i, source) { + + if (keyFrame !== null) { + + // keyFrames need to be converted to objects + if (typeof keyFrame !== "object") { + keyFrame = { + step: keyFrame, + easing: "linear" + }; + } + + // Replace step values + if (typeof keyFrame.step !== "undefined") { + keyFrame.value = keyFrame.step === false ? + previousVal : previousVal + keyFrame.step; + } + + // Set a default easing function + if (!keyFrame.easing) { + keyFrame.easing = "linear"; + } + + // Copy value from another frame + /* istanbul ignore if */ + if (typeof keyFrame.copyValue !== "undefined") { + keyFrame.value = source[keyFrame.copyValue].value; + } + + // Copy everything from another keyframe in this array + /* istanbul ignore if */ + if (keyFrame.copyFrame) { + keyFrame = source[keyFrame.copyFrame]; + } + + previousVal = keyFrame.value; + + } else { + + if (i === source.length - 1) { + keyFrame = { + value: previousVal, + easing: "linear" + }; + } else { + keyFrame = null; + } + + } + source[i] = keyFrame; + + }, this); + }); + + this.normalizedKeyFrames = keyFrameSet; + + return this; +}; + +module.exports = Animation; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/array-includes-shim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/array-includes-shim.js new file mode 100644 index 00000000..196dc94d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/array-includes-shim.js @@ -0,0 +1,8 @@ +Object.defineProperty(Array.prototype, "includes", { + value: function(entry) { + return this.indexOf(entry) !== -1; + }, + enumerable: false, + configurable: false, + writable: false +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/barometer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/barometer.js new file mode 100644 index 00000000..a98d0de7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/barometer.js @@ -0,0 +1,232 @@ +var Emitter = require("events").EventEmitter; +var util = require("util"); + +var Board = require("./board"); +var Fn = require("./fn"); + +var toFixed = Fn.toFixed; + + +var Controllers = { + MPL115A2: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MPL115A2", opts); + driver.on("data", function(data) { + dataHandler.call(this, data.pressure); + }.bind(this)); + } + }, + // kPa (Kilopascals) + toPressure: { + value: function(raw) { + // Pressure output in kPa explained at P. 6, Eqn. 2 + var output = ((65 / 1023) * raw) + 50; + // Typical resolution 0.15kPa from paragraph 2.2 page 3 + return toFixed(output, 2); + } + } + }, + MPL3115A2: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MPL3115A2", opts); + driver.on("data", function(data) { + dataHandler.call(this, data.pressure); + }.bind(this)); + } + }, + // kPa (Kilopascals) + toPressure: { + value: function(raw) { + // formulas extracted from code example: + // https://github.com/adafruit/Adafruit_MPL3115A2_Library + var inches = (raw / 4) / 3377; + var output = inches * 3.39; + + // Page 8, Table 5 + // Typical resolution 1.5Pa = 0.0015kPa + return toFixed(output, 4); + } + } + }, + BMP180: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BMP180", opts); + driver.on("data", function(data) { + dataHandler.call(this, data.pressure); + }.bind(this)); + } + }, + // kPa (Kilopascals) + toPressure: { + value: function(raw) { + // Page 6, Table 1 + // Typical resolution 0.01hPa = 0.001kPa + return toFixed(raw / 1000, 3); + } + } + }, + BMP280: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BMP280", opts); + driver.on("data", function(data) { + dataHandler.call(this, data.pressure); + }.bind(this)); + } + }, + // kPa (Kilopascals) + toPressure: { + value: function(raw) { + // Page 8, Table 2 + // Resolution in ultra high resolution mode 0.0016hPa = 0.00016kPa + return toFixed(raw / 1000, 5); + } + } + }, + BME280: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BME280", opts); + driver.on("data", function(data) { + dataHandler.call(this, data.pressure); + }.bind(this)); + } + }, + // kPa (Kilopascals) + toPressure: { + value: function(raw) { + // Page 10, Table 3 + // Typical resolution 0.18Pa = 0.00018kPa + return toFixed(raw / 1000, 5); + } + } + }, + MS5611: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MS5611", opts); + driver.on("data", function(data) { + dataHandler.call(this, data.pressure); + }.bind(this)); + } + }, + toPressure: { + value: function(raw) { + // Page 2, Table ? + // Resolution Over sampling ratio + // 0.065mbar 256 + // 0.042mbar 512 + // 0.027mbar 1024 + // 0.018mbar 2048 + // 0.012mbar 4096 + // + // 0.012mbar = 1,2Pa = 0.0012kPa + return toFixed(raw / 1000, 4); + } + } + }, +}; + +Controllers.BMP085 = Controllers.BMP180; + +/** + * Barometer + * @constructor + * + * five.Barometer(opts); + * + * five.Barometer({ + * controller: "CONTROLLER" + * address: 0x00 + * }); + * + * + * @param {Object} opts [description] + * + */ + +function Barometer(opts) { + /* istanbul ignore if */ + if (!(this instanceof Barometer)) { + return new Barometer(opts); + } + + var controller = null; + var last = null; + var raw = null; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var freq = opts.freq || 25; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + // controller = Controllers["ANALOG"]; + throw new Error("Missing Barometer controller"); + } + + Board.Controller.call(this, controller, opts); + + if (!this.toPressure) { + this.toPressure = opts.toPressure || function(raw) { + return raw; + }; + } + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + Object.defineProperties(this, { + pressure: { + get: function() { + return this.toPressure(raw); + } + } + }); + + setInterval(function() { + if (raw === null) { + return; + } + + var data = { + pressure: this.pressure + }; + + this.emit("data", data); + + if (this.pressure !== last) { + last = this.pressure; + this.emit("change", data); + } + }.bind(this), freq); +} + +util.inherits(Barometer, Emitter); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Barometer.Controllers = Controllers; + Barometer.purge = function() {}; +} + +module.exports = Barometer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.js new file mode 100644 index 00000000..dd2a1282 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.js @@ -0,0 +1,1298 @@ +/* istanbul ignore if */ +if (!Array.prototype.includes) { + /* istanbul ignore next */ + require("./array-includes-shim"); +} + + +var IS_TEST_MODE = !!process.env.IS_TEST_MODE; +var Emitter = require("events").EventEmitter; +var util = require("util"); +var chalk = require("chalk"); +var Collection = require("./mixins/collection"); +var Fn = require("./fn"); +var Repl = require("./repl"); +var Options = require("./board.options"); +var Pins = require("./board.pins"); +var Expander; +//var temporal = require("temporal"); + +// Environment Setup +var boards = []; +var rport = /usb|acm|^com/i; + +// const things to const when 0.10.x is dropped +// This string appears over 20 times in this file. +var UNDEFINED = "undefined"; + +var Serial = { + used: [], + attempts: [], + detect: function(callback) { + // Max number of times listing serial conntections can fail + var maxAttempts = 10; + // Delay (ms) before trying again to list serial connections + var retryDelay = 400; + var serialport; + + /* istanbul ignore next */ + if (parseFloat(process.versions.nw) >= 0.13) { + serialport = require("browser-serialport"); + } else { + serialport = require("serialport"); + } + + // console.log(require); + // Request a list of available ports, from + // the result set, filter for valid paths + // via known path pattern match. + serialport.list(function(err, result) { + + // serialport.list() will never result in an error. + // On failure, an empty array is returned. (#768) + var ports = result.filter(function(val) { + var available = true; + + // Match only ports that Arduino cares about + // ttyUSB#, cu.usbmodem#, COM# + if (!rport.test(val.comName)) { + available = false; + } + + // Don't allow already used/encountered usb device paths + if (Serial.used.includes(val.comName)) { + available = false; + } + + return available; + }).map(function(val) { + return val.comName; + }); + + // If no ports are detected... + if (!ports.length) { + + /* istanbul ignore if */ + if (IS_TEST_MODE && this.abort) { + /* istanbul ignore next */ + return; + } + + // Create an attempt counter + /* istanbul ignore else */ + if (!Serial.attempts[Serial.used.length]) { + Serial.attempts[Serial.used.length] = 0; + + // Log notification... + this.info("Board", "Looking for connected device"); + } + + // Set the attempt number + Serial.attempts[Serial.used.length]++; + + // Retry Serial connection + if (Serial.attempts[Serial.used.length] > maxAttempts) { + this.fail("Board", "No connected device found"); + return; + } + setTimeout(() => { + Serial.detect.call(this, callback); + }, retryDelay); + + return; + } + + this.info("Available", chalk.grey(ports)); + + // Get the first available device path + // from the list of detected ports + + callback.call(this, ports[0]); + }.bind(this)); + }, + + connect: function(portOrPath, callback) { + var IO = require("firmata").Board; + + var caught = null; + var io, isConnected, path, type; + + if (typeof portOrPath === "object" && portOrPath.path) { + // + // Board({ port: SerialPort Object }) + // + path = portOrPath.path; + + this.info( + (portOrPath.transport || "SerialPort"), + chalk.grey(path) + ); + } else { + // + // Board({ port: path String }) + // + // Board() + // ie. auto-detected + // + path = portOrPath; + } + + // Add the usb device path to the list of device paths that + // are currently in use - this is used by the filter function + // above to remove any device paths that we've already encountered + // or used to avoid blindly attempting to reconnect on them. + Serial.used.push(path); + + try { + io = new IO(portOrPath, function(error) { + if (error) { + caught = error; + } + + callback.call(this, caught, caught ? "error" : "ready", io); + }.bind(this)); + + // Extend io instance with special expandos used + // by Johny-Five for the IO Plugin system. + io.name = "Firmata"; + io.defaultLed = 13; + io.port = path; + + // Made this far, safely connected + isConnected = true; + } catch (error) { + caught = error; + } + + if (caught) { + caught = caught.message || caught; + } + + // Determine the type of event that will be passed on to + // the board emitter in the callback passed to Serial.detect(...) + type = isConnected ? "connect" : "error"; + + // Execute "connect" callback + callback.call(this, caught, type, io); + } +}; + +/** + * Board + * @constructor + * + * @param {Object} opts + */ + +function Board(opts) { + + if (!(this instanceof Board)) { + return new Board(opts); + } + + // Ensure opts is an object + opts = opts || {}; + + // Used to define the board instance's own + // properties in the REPL's scope. + var replContext = {}; + + // It's feasible that an IO-Plugin may emit + // "connect" and "ready" events out of order. + // This is used to enforce the order, by + // postponing the "ready" event if the IO-Plugin + // hasn't emitted a "connect" event. Once + // the "connect" event is emitted, the + // postponement is lifted and the board may + // proceed with emitting the events in the + // correct order. + var isPostponed = false; + + // Initialize this Board instance with + // param specified properties. + Object.assign(this, opts); + + this.timer = null; + + this.isConnected = false; + + // Easily track state of hardware + this.isReady = false; + + // Initialize instance property to reference io board + this.io = this.io || null; + + // Registry of components + this.register = []; + + // Pins, Addr (alt Pin name), Addresses + this.occupied = []; + + // Registry of drivers by address (i.e. I2C Controllers) + this.Drivers = {}; + + // Identify for connect hardware cache + if (!this.id) { + this.id = Fn.uid(); + } + + // If no debug flag, default to true + if (typeof this.debug === UNDEFINED) { + this.debug = true; + } + + // If no repl flag, default to true + if (typeof this.repl === UNDEFINED) { + this.repl = true; + } + + // If no sigint flag, default to true + if (typeof this.sigint === UNDEFINED) { + this.sigint = true; + } + + // Specially processed pin capabilities object + // assigned when physical board has reported + // "ready" via Firmata or IO-Plugin. + this.pins = null; + + // Create a Repl instance and store as + // instance property of this io/board. + // This will reduce the amount of boilerplate + // code required to _always_ have a Repl + // session available. + // + // If a sesssion exists, use it + // (instead of creating a new session) + // + /* istanbul ignore if */ + if (this.repl) { + /* istanbul ignore if */ + if (Repl.ref) { + /* istanbul ignore next */ + replContext[this.id] = this; + /* istanbul ignore next */ + Repl.ref.on("ready", function() { + /* istanbul ignore next */ + Repl.ref.inject(replContext); + }); + /* istanbul ignore next */ + this.repl = Repl.ref; + } else { + replContext[this.id] = replContext.board = this; + this.repl = new Repl(replContext); + } + } + + if (opts.io) { + // If you already have a connected io instance + this.io = opts.io; + this.isReady = opts.io.isReady; + this.transport = this.io.transport || null; + this.port = this.io.name; + this.pins = Board.Pins(this); + this.RESOLUTION = this.io.RESOLUTION || { ADC: 1023, DAC: null, PWM: 255 }; + } else { + + if (this.port && opts.port) { + Serial.connect.call(this, this.port, finalizeAndBroadcast); + } else { + Serial.detect.call(this, function(path) { + Serial.connect.call(this, path, finalizeAndBroadcast); + }); + } + } + + // Either an IO instance was provided or isOnBoard is true + if (!opts.port && this.io !== null) { + /* istanbul ignore next */ + this.info("Available", chalk.grey(this.io.name || "unknown")); + + ["connect", "ready"].forEach(function(type) { + this.io.once(type, function() { + // Since connection and readiness happen asynchronously, + // it's actually possible for Johnny-Five to receive the + // events out of order and that should be ok. + if (type === "ready" && !this.isConnected) { + isPostponed = true; + } else { + // Will emit the "connect" and "ready" events + // if received in order. If out of order, this + // will only emit the "connect" event. The + // "ready" event will be handled in the next + // condition's consequent. + finalizeAndBroadcast.call(this, null, type, this.io); + } + + if (type === "connect" && isPostponed) { + finalizeAndBroadcast.call(this, null, "ready", this.io); + } + }.bind(this)); + + if (this.io.isReady) { + // If the IO instance is reached "ready" + // state, queue tick tasks to emit the + // "connect" and "ready" events + process.nextTick(function() { + this.io.emit(type); + }.bind(this)); + } + }, this); + } + + this.once("ready", function() { + var hrstart = process.hrtime(); + + this.millis = function() { + var now = process.hrtime(hrstart); + return (now[1] / 1000000); + }; + + ["close", "disconnect", "error", "string"].forEach(function(type) { + this.io.on(type, function(data) { + this.emit(type, data); + }.bind(this)); + }, this); + }.bind(this)); + + // Cache instance to allow access from module constructors + boards.push(this); +} + +function finalizeAndBroadcast(data, type, io) { + var emitted = false; + + // Assign found io to instance + if (!this.io) { + this.io = io; + } + + // Always Surface errors + if (type === "error") { + /* istanbul ignore else */ + if (data && data.message) { + emitted = true; + this.error("Error", data.message); + } + } + + if (type === "connect") { + this.isConnected = true; + this.port = io.port || io.name; + + this.info( + "Connected", + chalk.grey(this.port) + ); + + // Unless a "timeout" value has been provided apply 10 Second timeout... + // + // If "ready" hasn't fired and cleared the timer within + // 10 seconds of the connect event, then it's likely + // there is an issue with the device or firmware. + if (!IS_TEST_MODE) { + /* istanbul ignore next */ + this.timer = setTimeout(function() { + this.error( + "Device or Firmware Error", + + "A timeout occurred while connecting to the Board. \n\n" + + "Please check that you've properly flashed the board with the correct firmware.\n" + + "See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting\n\n" + + "If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the " + + "board, wait approximately 11 seconds for complete reset, then run your program again." + ); + + this.emit("error", new Error("A timeout occurred while connecting to the Board.")); + }.bind(this), this.timeout || 1e4); + } + } + + if (type === "ready") { + if (this.timer) { + clearTimeout(this.timer); + } + + // Update instance `ready` flag + this.isReady = true; + this.pins = Board.Pins(this); + this.MODES = this.io.MODES; + + if (typeof io.debug !== UNDEFINED && + io.debug === false) { + this.debug = false; + } + + if (typeof io.repl !== UNDEFINED && + io.repl === false) { + this.repl = false; + } + // In multi-board mode, block the REPL from + // activation. This will be started directly + // by the Board.Collection constructor. + // + // In single-board mode, the REPL will not + // be blocked at all. + // + // If the user program has not disabled the + // REPL, initialize it. + if (this.repl) { + this.repl.initialize(this.emit.bind(this, "ready")); + } + + if (io.name !== "Mock" && this.sigint) { + process.on("SIGINT", function() { + // Time to wait before forcing exit + var failExitTimeout = 1000; + + this.emit("exit"); + this.warn("Board", "Closing."); + /* istanbul ignore next */ + var timeout = setTimeout(function() { + process.reallyExit(); + }, failExitTimeout); + var interval = setInterval(function() { + if (!this.io.pending) { + clearInterval(interval); + clearTimeout(timeout); + process.nextTick(process.reallyExit); + } + }.bind(this), 1); + }.bind(this)); + } + + // Older versions of Firmata and some IO plugins + // may not have set RESOLUTION. + this.RESOLUTION = io.RESOLUTION || { ADC: 1023, DAC: null, PWM: 255 }; + + } + + // If there is a REPL... + if (this.repl) { + // "ready" will be emitted once repl.initialize + // is complete, so the only event that needs to + // be propagated here is the "connect" event. + if (type === "connect") { + this.emit(type, data); + } + } else { + // The REPL is disabled, propagate all events + if (!emitted) { + this.emit(type, data); + } + } +} + +// Inherit event api +util.inherits(Board, Emitter); + + + +/** + * Pass through methods + */ +[ + "digitalWrite", "analogWrite", + "analogRead", "digitalRead", + "pinMode", "queryPinState", + "stepperConfig", "stepperStep", + "sendI2CConfig", "sendI2CWriteRequest", "sendI2CReadRequest", + "i2cConfig", "i2cWrite", "i2cWriteReg", "i2cRead", "i2cReadOnce", + "pwmWrite", + "servoConfig", "servoWrite", + "sysexCommand", "sysexResponse", + "serialConfig", "serialWrite", "serialRead", "serialStop", "serialClose", "serialFlush", "serialListen", +].forEach(function(method) { + /* istanbul ignore next */ + Board.prototype[method] = function() { + this.io[method].apply(this.io, arguments); + return this; + }; +}); + + +Board.prototype.snapshot = function(reducer) { + var blacklist = this.snapshot.blacklist; + var special = this.snapshot.special; + var hasReducer = typeof reducer === "function"; + + return this.register.reduce(function(accum, component) { + // Don't include collections or multi/imu wrappers + if (typeof component.components === UNDEFINED) { + accum.push( + Object.getOwnPropertyNames(component).reduce(function(data, prop) { + var value = component[prop]; + + if (!blacklist.includes(prop) && typeof value !== "function") { + + if (hasReducer) { + var result = reducer(prop, value, component); + + if (result !== undefined) { + data[prop] = result; + } + } else { + data[prop] = special[prop] ? + special[prop](value) : value; + } + } + return data; + }, Object.create(null)) + ); + } + + return accum; + }.bind(this), []); +}; + +Board.prototype.serialize = function(reducer) { + return JSON.stringify(this.snapshot(reducer)); +}; + +Board.prototype.snapshot.blacklist = [ + "board", "io", "_events", "_eventsCount", "state", +]; + +Board.prototype.samplingInterval = function(ms) { + + if (this.io.setSamplingInterval) { + this.io.setSamplingInterval(ms); + } else { + throw new Error("This IO plugin does not implement an interval adjustment method"); + } + return this; +}; + + +Board.prototype.snapshot.special = { + mode: function(value) { + return ["INPUT", "OUTPUT", "ANALOG", "PWM", "SERVO"][value] || "unknown"; + } +}; + +/** + * shiftOut + * + */ +Board.prototype.shiftOut = function(dataPin, clockPin, isBigEndian, value) { + if (arguments.length === 3) { + value = isBigEndian; + isBigEndian = true; + } + + for (var i = 0; i < 8; i++) { + this.io.digitalWrite(clockPin, 0); + if (isBigEndian) { + this.io.digitalWrite(dataPin, !!(value & (1 << (7 - i))) | 0); + } else { + this.io.digitalWrite(dataPin, !!(value & (1 << i)) | 0); + } + this.io.digitalWrite(clockPin, 1); + } +}; + +var logging = { + specials: [ + "error", + "fail", + "warn", + "info", + ], + colors: { + log: "white", + error: "red", + fail: "inverse", + warn: "yellow", + info: "cyan" + } +}; + +Board.prototype.log = function( /* type, klass, message [, long description] */ ) { + var args = Array.from(arguments); + + // If this was a direct call to `log(...)`, make sure + // there is a correct "type" to emit below. + if (!logging.specials.includes(args[0])) { + args.unshift("log"); + } + + var type = args.shift(); + var klass = args.shift(); + var message = args.shift(); + var color = logging.colors[type]; + var now = Date.now(); + var event = { + type: type, + timestamp: now, + class: klass, + message: "", + data: null, + }; + + if (typeof args[args.length - 1] === "object") { + event.data = args.pop(); + } + + message += " " + args.join(", "); + event.message = message.trim(); + + /* istanbul ignore if */ + if (this.debug) { + /* istanbul ignore next */ + console.log([ + // Timestamp + chalk.grey(now), + // Module, color matches type of log + chalk.magenta(klass), + // Details + chalk[color](message), + // Miscellaneous args + args.join(", ") + ].join(" ")); + } + + this.emit(type, event); + this.emit("message", event); +}; + + +// Make shortcuts to all logging methods +logging.specials.forEach(function(type) { + Board.prototype[type] = function() { + var args = [].slice.call(arguments); + args.unshift(type); + + this.log.apply(this, args); + }; +}); + + +/** + * delay, loop, queue + * + * Pass through methods to temporal + */ +/* +[ + "delay", "loop", "queue" +].forEach(function( method ) { + Board.prototype[ method ] = function( time, callback ) { + temporal[ method ]( time, callback ); + return this; + }; +}); + +// Alias wait to delay to match existing Johnny-five API +Board.prototype.wait = Board.prototype.delay; +*/ + +// -----THIS IS A TEMPORARY FIX UNTIL THE ISSUES WITH TEMPORAL ARE RESOLVED----- +// Aliasing. +// (temporary, while ironing out API details) +// The idea is to match existing hardware programming apis +// or simply find the words that are most intuitive. + +// Eventually, there should be a queuing process +// for all new callbacks added +// +// TODO: Repalce with temporal or compulsive API + +Board.prototype.wait = function(time, callback) { + setTimeout(callback, time); + return this; +}; + +Board.prototype.loop = function(time, callback) { + var handler = function() { + callback(function() { + clearInterval(interval); + }); + }; + var interval = setInterval(handler, time); + return this; +}; + +// ---------- +// Static API +// ---------- + +// Board.map( val, fromLow, fromHigh, toLow, toHigh ) +// +// Re-maps a number from one range to another. +// Based on arduino map() +Board.map = Fn.map; +Board.fmap = Fn.fmap; + +// Board.constrain( val, lower, upper ) +// +// Constrains a number to be within a range. +// Based on arduino constrain() +Board.constrain = Fn.constrain; + +// Board.range( upper ) +// Board.range( lower, upper ) +// Board.range( lower, upper, tick ) +// +// Returns a new array range +// +Board.range = Fn.range; + +// Board.range.prefixed( prefix, upper ) +// Board.range.prefixed( prefix, lower, upper ) +// Board.range.prefixed( prefix, lower, upper, tick ) +// +// Returns a new array range, each value prefixed +// +Board.range.prefixed = Fn.range.prefixed; + +// Board.uid() +// +// Returns a reasonably unique id string +// +Board.uid = Fn.uid; + +// Board.mount() +// Board.mount( index ) +// Board.mount( object ) +// +// Return hardware instance, based on type of param: +// @param {arg} +// object, user specified +// number/index, specified in cache +// none, defaults to first in cache +// +// Notes: +// Used to reduce the amount of boilerplate +// code required in any given module or program, by +// giving the developer the option of omitting an +// explicit Board reference in a module +// constructor's options +Board.mount = function(arg) { + var index = typeof arg === "number" && arg, + hardware; + + // board was explicitly provided + if (arg && arg.board) { + return arg.board; + } + + // index specified, attempt to return + // hardware instance. Return null if not + // found or not available + if (typeof index === "number") { + hardware = boards[index]; + return hardware ? hardware : null; + } + + // If no arg specified and hardware instances + // exist in the cache + if (boards.length) { + return boards[0]; + } + + // No mountable hardware + return null; +}; + + + +/** + * Board.Component + * + * Initialize a new device instance + * + * Board.Component is a |this| sensitive constructor, + * and must be called as: + * + * Board.Component.call( this, opts ); + * + * + * + * TODO: Migrate all constructors to use this + * to avoid boilerplate + */ + +Board.Component = function(opts, componentOpts) { + if (typeof opts === UNDEFINED) { + opts = {}; + } + + if (typeof componentOpts === UNDEFINED) { + componentOpts = {}; + } + + // Board specific properties + this.board = Board.mount(opts); + this.io = this.board.io; + + // Component/Module instance properties + this.id = opts.id || Board.uid(); + this.custom = opts.custom || {}; + + var originalPins; + + if (typeof opts.pin === "number" || typeof opts.pin === "string") { + originalPins = [opts.pin]; + } else { + if (Array.isArray(opts.pins)) { + originalPins = opts.pins.slice(); + } else { + if (typeof opts.pins === "object" && opts.pins !== null) { + + var pinset = opts.pins || opts.pin; + + originalPins = []; + for (var p in pinset) { + originalPins.push(pinset[p]); + } + } + } + } + + + if (opts.controller) { + + if (typeof opts.controller === "string") { + opts.controller = opts.controller.replace(/-/g, ""); + } + + if (!Expander) { + Expander = require("./expander"); + } + + if (Expander.hasController(opts.controller)) { + componentOpts = { + normalizePin: false, + requestPin: false, + }; + } + } + + componentOpts = Board.Component.initialization(componentOpts); + + if (componentOpts.normalizePin) { + opts = Board.Pins.normalize(opts, this.board); + } + + // var requesting = []; + + if (typeof opts.pins !== UNDEFINED) { + this.pins = opts.pins || []; + + // if (Array.isArray(this.pins)) { + // requesting = requesting.concat( + // this.pins.map(function(pin) { + // return { + // value: pin, + // type: "pin" + // }; + // }) + // ); + // } else { + // requesting = requesting.concat( + // Object.keys(this.pins).map(function(key) { + // return { + // value: this.pins[key], + // type: "pin" + // }; + // }, this) + // ); + // } + } + + if (typeof opts.pin !== UNDEFINED) { + this.pin = opts.pin; + // requesting.push({ + // value: this.pin, + // type: "pin" + // }); + } + + // TODO: Figure out what is using this + /* istanbul ignore if */ + if (typeof opts.emitter !== UNDEFINED) { + /* istanbul ignore next */ + this.emitter = opts.emitter; + // requesting.push({ + // value: this.emitter, + // type: "emitter" + // }); + } + + if (typeof opts.address !== UNDEFINED) { + this.address = opts.address; + // requesting.forEach(function(request) { + // request.address = this.address; + // }, this); + } + + if (typeof opts.controller !== UNDEFINED) { + this.controller = opts.controller; + // requesting.forEach(function(request) { + // request.controller = this.controller; + // }, this); + } + + // TODO: Figure out what is using this + /* istanbul ignore if */ + if (typeof opts.bus !== UNDEFINED) { + /* istanbul ignore next */ + this.bus = opts.bus; + // requesting.forEach(function(request) { + // request.bus = this.bus; + // }, this); + } + + // if (componentOpts.requestPin) { + // // With the pins being requested for use by this component, + // // compare with the list of pins that are already known to be + // // in use by other components. If any are known to be in use, + // // produce a warning for the user. + // requesting.forEach(function(request, index) { + // var hasController = typeof request.controller !== UNDEFINED; + // var hasAddress = typeof request.address !== UNDEFINED; + // var isOccupied = false; + // var message = ""; + + // request.value = originalPins[index]; + + // if (this.board.occupied.length) { + // isOccupied = this.board.occupied.some(function(occupied) { + // var isPinOccupied = request.value === occupied.value && request.type === occupied.type; + + // if (typeof occupied.controller !== UNDEFINED) { + // if (hasController) { + // return isPinOccupied && (request.controller === occupied.controller); + // } + // return false; + // } + + // if (typeof occupied.address !== UNDEFINED) { + // if (hasAddress) { + // return isPinOccupied && (request.address === occupied.address); + // } + // return false; + // } + + // return isPinOccupied; + // }); + // } + + // if (isOccupied) { + // message = request.type + ": " + request.value; + + // if (hasController) { + // message += ", controller: " + request.controller; + // } + + // if (hasAddress) { + // message += ", address: " + request.address; + // } + + // this.board.warn("Component", message + " is already in use"); + // } else { + // this.board.occupied.push(request); + // } + // }, this); + // } + + this.board.register.push(this); +}; + +Board.Component.initialization = function(opts) { + var defaults = { + requestPin: true, + normalizePin: true + }; + + return Object.assign({}, defaults, opts); +}; + +/** + * Board.Controller + * + * Decorate a Component with a Controller. Must be called + * _AFTER_ a Controller is identified. + * + * Board.Controller is a |this| sensitive constructor, + * and must be called as: + * + * Board.Controller.call( this, controller, opts ); + * + */ + +Board.Controller = function(controller, options) { + var requirements = controller.requirements && controller.requirements.value; + + if (requirements) { + /* istanbul ignore else */ + if (requirements.options) { + Object.keys(requirements.options).forEach(function(key) { + /* + requirements: { + value: { + options: { + parameterName: { + throws: false, + message: "...blah blah blah", + typeof: "number", + } + } + } + }, + */ + if (typeof options[key] === UNDEFINED || + typeof options[key] !== requirements.options[key].typeof) { + if (requirements.options[key].throws) { + throw new Error(requirements.options[key].message); + } else { + this.board.warn(this.constructor.name, requirements.options[key].message); + } + } + }, this); + } + } + + Object.defineProperties(this, controller); +}; + + + + +/** + * Pin Capability Signature Mapping + */ + +Board.Pins = Pins; + +Board.Options = Options; + +// Define a user-safe, unwritable hardware cache access +Object.defineProperty(Board, "cache", { + get: function() { + return boards; + } +}); + +/** + * Board event constructor. + * opts: + * type - event type. eg: "read", "change", "up" etc. + * target - the instance for which the event fired. + * 0..* other properties + */ +Board.Event = function(event) { + + if (typeof event === UNDEFINED) { + throw new Error("Board.Event missing Event object"); + } + + // default event is read + this.type = event.type || "data"; + + // actual target instance + this.target = event.target || null; + + // Initialize this Board instance with + // param specified properties. + Object.assign(this, event); +}; + + +/** + * Boards or Board.Collection; Used when the program must connect to + * more then one board. + * + * @memberof Board + * + * @param {Array} ports List of port objects { id: ..., port: ... } + * List of id strings (initialized in order) + * + * @return {Boards} board object references + */ +function Boards(opts) { + if (!(this instanceof Boards)) { + return new Boards(opts); + } + + var ports; + + // new Boards([ ...Array of board opts ]) + if (Array.isArray(opts)) { + ports = opts.slice(); + opts = { + ports: ports, + }; + } + + // new Boards({ ports: [ ...Array of board opts ], .... }) + /* istanbul ignore else */ + if (!Array.isArray(opts) && typeof opts === "object" && opts.ports !== undefined) { + ports = opts.ports; + } + + // new Boards(non-Array?) + // new Boards({ ports: non-Array? }) + /* istanbul ignore if */ + if (!Array.isArray(ports)) { + throw new Error("Expected ports to be an array"); + } + + if (typeof opts.debug === UNDEFINED) { + opts.debug = true; + } + + if (typeof opts.repl === UNDEFINED) { + opts.repl = true; + } + + var initialized = {}; + var noRepl = ports.some(function(port) { return port.repl === false; }); + var noDebug = ports.some(function(port) { return port.debug === false; }); + + this.length = ports.length; + this.debug = opts.debug; + this.repl = opts.repl; + + // If any of the port definitions have + // explicitly shut off debug output, bubble up + // to the Boards instance + /* istanbul ignore else */ + if (noDebug) { + this.debug = false; + } + + // If any of the port definitions have + // explicitly shut off the repl, bubble up + // to the Boards instance + /* istanbul ignore else */ + if (noRepl) { + this.repl = false; + } + + var expecteds = ports.map(function(port, index) { + var portOpts; + + if (typeof port === "string") { + portOpts = {}; + + // If the string matches a known valid port + // name pattern, then assume this is what + // the user code intended. + if (rport.test(port)) { + portOpts.port = port; + } else { + // Otherwise they expect Johnny-Five to figure + // out what ports to use and intended this + // value to be used an id + portOpts.id = port; + } + } else { + portOpts = port; + } + + // Shut off per-board repl instance creation + portOpts.repl = false; + + this[index] = initialized[portOpts.id] = new Board(portOpts); + + // "error" event is not async, register immediately + this[index].on("error", function(error) { + this.emit("error", error); + }.bind(this)); + + // echo the fail event from the boards + this[index].on("fail", function (event) { + this.emit("fail", event); + }.bind(this)); + + return new Promise(function(resolve) { + this[index].on("ready", function() { + resolve(initialized[portOpts.id]); + }); + }.bind(this)); + }, this); + + Promise.all(expecteds).then(function(boards) { + Object.assign(this, boards); + + this.each(function(board) { + board.info("Board ID: ", chalk.green(board.id)); + }); + + // If the Boards instance requires a REPL, + // make sure it's created before calling "ready" + if (this.repl) { + this.repl = new Repl( + Object.assign({}, initialized, { + board: this + }) + ); + this.repl.initialize(function() { + this.emit("ready", initialized); + }.bind(this)); + } else { + // Otherwise, call ready immediately + this.emit("ready", initialized); + } + }.bind(this)); +} + +util.inherits(Boards, Emitter); + +Object.assign(Boards.prototype, Collection.prototype); + +Boards.prototype.byId = function(id) { + for (var i = 0; i < this.length; i++) { + if (this[i].id === id) { + return this[i]; + } + } + + return null; +}; + +Boards.prototype.log = Board.prototype.log; + +logging.specials.forEach(function(type) { + /* istanbul ignore next */ + Boards.prototype[type] = function() { + var args = [].slice.call(arguments); + args.unshift(type); + + this.log.apply(this, args); + }; +}); + +/* istanbul ignore else */ +if (IS_TEST_MODE) { + Serial.purge = function() { + Serial.used.length = 0; + }; + Board.Serial = Serial; + + Board.purge = function() { + Board.Pins.normalize.clear(); + Repl.isActive = false; + Repl.isBlocked = true; + Repl.ref = null; + boards.length = 0; + }; + + Board.testMode = function(state) { + if (!arguments.length) { + return IS_TEST_MODE; + } else { + IS_TEST_MODE = state; + } + }; +} + +// TODO: Eliminate .Array for 1.0.0 +Board.Array = Boards; +Board.Collection = Boards; + +module.exports = Board; + +// References: +// http://arduino.cc/en/Main/arduinoBoardUno diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.options.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.options.js new file mode 100644 index 00000000..fa315477 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.options.js @@ -0,0 +1,94 @@ +/** + * Many pins have common aliases, especially SPI! + */ + +var MISO = "miso"; +var MOSI = "mosi"; +var SCLK = "sclk"; +var SS = "ss"; + +// jshint unused:false +var aliases = { + + // SCLK + clk: SCLK, + clock: SCLK, + sclk: SCLK, + + // MISO + somi: MISO, + sdo: MISO, + do: MISO, + dout: MISO, + so: MISO, + mrsr: MISO, + miso: MISO, + + // MOSI + simo: MOSI, + sdi: MOSI, + data: MOSI, + di: MOSI, + din: MOSI, + si: MOSI, + mtst: MOSI, + mosi: MOSI, + + // SS + ncs: SS, + cs: SS, + csb: SS, + csn: SS, + en: SS, + ld: SS, + load: SS, + nss: SS, + ste: SS, + sync: SS, + ss: SS, +}; + + +/** + * Options + * + * @param {String} arg Pin address. + * @param {Number} arg Pin address. + * @param {Array} arg List of Pin addresses. + * + * @return {Options} normalized board options instance. + */ + +function Options(arg) { + if (!(this instanceof Options)) { + return new Options(arg); + } + + var opts = {}; + + if (typeof arg === "number" || + typeof arg === "string") { + opts.pin = arg; + } else if (Array.isArray(arg)) { + opts.pins = arg; + } else { + opts = arg; + + + // @Nick, this is where you want to focus. + // Anytime this path is taken, the constructor + // received an object. If the object contains + // a "pins" property that is ALSO an object, we need + // to normalize the keys of that object, using the + // "aliases" map defined above. + // + // This change will require renaming pin properties in + // a few classes, but I'm ok with that, because if we do this + // right, no existing code will break. + // + } + + Object.assign(this, opts); +} + +module.exports = Options; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.pins.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.pins.js new file mode 100644 index 00000000..1694653b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/board.pins.js @@ -0,0 +1,274 @@ +var Options = require("./board.options"); + +var MODES = { + INPUT: 0x00, + OUTPUT: 0x01, + ANALOG: 0x02, + PWM: 0x03, + SERVO: 0x04 +}; + + +/** + * Pin Capability Signature Mapping + */ + +var pinsToType = { + 20: "UNO", + 25: "LEONARDO", + 70: "MEGA" +}; + +function Pins(board) { + if (!(this instanceof Pins)) { + return new Pins(board); + } + + var io = board.io; + var pins = io.pins.slice(); + var length = pins.length; + var type = pinsToType[length] || "OTHER"; + + board.type = type; + + // Copy pin data to index + for (var i = 0; i < length; i++) { + this[i] = pins[i]; + } + + Object.defineProperties(this, { + type: { + value: type + }, + length: { + value: length + } + }); + + // If an IO Plugin or Expander defines + // these, override the default + [ + "isInput", + "isOutput", + "isAnalog", + "isPwm", + "isServo", + ].forEach(function(isType) { + if (io[isType]) { + this[isType] = io[isType]; + } + }, this); +} + +Object.keys(MODES).forEach(function(mode) { + Object.defineProperty(Pins, mode, { + value: MODES[mode] + }); +}); + +function isFirmata(board) { + return board.io.name === "Firmata" || board.io.name === "Mock"; +} + +function hasPins(opts) { + return typeof opts.pin !== "undefined" || + (typeof opts.pins !== "undefined" && opts.pins.length); +} + +Pins.isFirmata = isFirmata; + +Pins.Error = function(opts) { + throw new Error( + "Pin Error: " + opts.pin + + " is not a valid " + opts.type + + " pin (" + opts.via + ")" + ); +}; + +var normalizers = new Map(); + +Pins.normalize = function(opts, board) { + var type = board.pins.type; + var isArduino = isFirmata(board); + var normalizer = normalizers.get(board); + var isNormalizing; + + if (typeof opts === "string" || + typeof opts === "number" || + Array.isArray(opts)) { + + opts = new Options(opts); + } + + if (!normalizer) { + isNormalizing = board.io && typeof board.io.normalize === "function"; + + normalizer = function(pin) { + return isArduino ? + Pins.fromAnalog(Pins.translate(pin, type)) : + (isNormalizing ? board.io.normalize(pin) : pin); + }; + + normalizers.set(board, normalizer); + } + + // Auto-normalize pin values, this reduces boilerplate code + // inside module constructors + if (hasPins(opts)) { + + // When an array of pins is present, attempt to + // normalize them if necessary + if (opts.pins) { + opts.pins = opts.pins.map(normalizer); + } else { + opts.pin = normalizer(opts.pin); + } + } + + return opts; +}; + +Pins.normalize.clear = function() { + normalizers.clear(); +}; + +// Special kit-centric pin translations +Pins.translations = { + UNO: { + dtoa: { + 14: "A0", + 15: "A1", + 16: "A2", + 17: "A3", + 18: "A4", + 19: "A5" + }, + + // TinkerKit + tinker: { + I0: "A0", + I1: "A1", + I2: "A2", + I3: "A3", + I4: "A4", + I5: "A5", + + O0: 11, + O1: 10, + O2: 9, + O3: 6, + O4: 5, + O5: 3, + + D13: 13, + D12: 12, + D8: 8, + D7: 7, + D4: 4, + D2: 2 + } + }, + MEGA: { + dtoa: { + 54: "A0", + 55: "A1", + 56: "A2", + 57: "A3", + 58: "A4", + 59: "A5", + 60: "A6", + 61: "A7", + 62: "A8", + 63: "A9" + }, + + // TinkerKit + tinker: { + I0: "A0", + I1: "A1", + I2: "A2", + I3: "A3", + I4: "A4", + I5: "A5", + I6: "A6", + I7: "A7", + I8: "A8", + I9: "A9", + + O0: 11, + O1: 10, + O2: 9, + O3: 6, + O4: 5, + O5: 3, + + D13: 13, + D12: 12, + D8: 8, + D7: 7, + D4: 4, + D2: 2 + } + } +}; + +Pins.translations.LEONARDO = Pins.translations.UNO; + +Pins.translate = function(pin, type) { + var translations = Pins.translations[type.toUpperCase()]; + + if (!translations) { + return pin; + } + + return Object.keys(translations).reduce(function(pin, map) { + return translations[map][pin] || pin; + }, pin); +}; + +Pins.fromAnalog = function(pin) { + if (typeof pin === "string" && pin[0] === "A") { + return parseInt(pin.slice(1), 10); + } + return pin; +}; + +Pins.identity = function(pins, needle) { + return [].findIndex.call(pins, function(pin) { + return pin.name === needle || pin.id === needle || pin.port === needle; + }); +}; + +/** + * (generated methods) + * + * Pins.prototype.isInput + * Pins.prototype.isOutput + * Pins.prototype.isAnalog + * Pins.prototype.isPwm + * Pins.prototype.isServo + * + */ +Object.keys(MODES).forEach(function(key) { + var name = key[0] + key.slice(1).toLowerCase(); + + Pins.prototype["is" + name] = function(pin) { + var attrs = this[pin] || this[Pins.identity(this, pin)]; + + if (attrs && attrs.supportedModes.includes(MODES[key])) { + return true; + } + return false; + }; +}); + +Pins.prototype.isDigital = function(pin) { + var attrs = this[pin] || this[Pins.identity(this, pin)]; + + if (attrs && attrs.supportedModes.length) { + return true; + } + return false; +}; + +module.exports = Pins; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/button.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/button.js new file mode 100644 index 00000000..19b260e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/button.js @@ -0,0 +1,388 @@ +var Board = require("./board"); +var Collection = require("./mixins/collection"); +var EVS = require("./evshield"); +var Pins = Board.Pins; +var Fn = require("./fn"); +var Emitter = require("events").EventEmitter; +var util = require("util"); + +// Button instance private data +var priv = new Map(); +var aliases = { + down: ["down", "press"], + up: ["up", "release"] +}; + + + +var Controllers = { + DEFAULT: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + if (Pins.isFirmata(this) && typeof opts.pinValue === "string" && opts.pinValue[0] === "A") { + opts.pinValue = this.io.analogPins[+opts.pinValue.slice(1)]; + } + + this.pin = Number.isNaN(+opts.pinValue) ? opts.pinValue : +opts.pinValue; + + this.io.pinMode(this.pin, this.io.MODES.INPUT); + + // Enable the pullup resistor after setting pin mode + if (this.pullup) { + this.io.digitalWrite(this.pin, this.io.HIGH); + } + + // Enable the pulldown resistor after setting pin mode + if (this.pulldown) { + this.io.digitalWrite(this.pin, this.io.LOW); + } + + this.io.digitalRead(this.pin, function(data) { + if (data !== state.last) { + dataHandler(data); + } + }); + } + }, + toBoolean: { + value: function(raw) { + return raw === this.downValue; + } + } + }, + + TINKERKIT: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var value = 0; + + this.io.pinMode(this.pin, this.io.MODES.ANALOG); + + this.io.analogRead(this.pin, function(data) { + data = data > 512 ? 1 : 0; + + // This condition simulates digitalRead's + // behavior of limiting calls to changes in + // pin value. + /* istanbul ignore else */ + if (data !== value && data !== state.last) { + dataHandler(data); + } + + value = data; + }); + } + }, + toBoolean: { + value: function(raw) { + return raw === this.downValue; + } + } + }, + + EVS_EV3: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + state.previous = 0; + state.shield = EVS.shieldPort(opts.pin); + state.register = EVS.Touch; + + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + state.ev3.setup(state.shield, EVS.Type_EV3_TOUCH); + state.ev3.read(state.shield, EVS.Touch, EVS.Touch_Bytes, function(data) { + var value = data[0]; + // Since i2cRead is continuous regardless of the reading, + // and digitalRead is continuous but only called for changes + // in reading value, we need to suppress repeated calls to + // dataHandler by limiting to only changed values. + /* istanbul ignore else */ + if (state.previous !== value) { + dataHandler(value); + } + state.previous = value; + }); + } + }, + toBoolean: { + value: function(raw) { + return raw === this.downValue; + } + } + }, + EVS_NXT: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + state.previous = 0; + state.shield = EVS.shieldPort(opts.pin); + + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + state.ev3.setup(state.shield, EVS.Type_ANALOG); + state.ev3.read(state.shield, state.shield.analog, EVS.Analog_Bytes, function(data) { + var value = data[0] | (data[1] << 8); + // Since i2cRead is continuous regardless of the reading, + // and digitalRead is continuous but only called for changes + // in reading value, we need to suppress repeated calls to + // dataHandler by limiting to only changed values. + value = value < 300 ? 1 : 0; + + /* istanbul ignore else */ + if (state.previous !== value) { + dataHandler(value); + } + state.previous = value; + }); + } + }, + toBoolean: { + value: function(raw) { + return raw === this.downValue; + } + } + } +}; + +/** + * Button + * @constructor + * + * five.Button(); + * + * five.Button({ + * pin: 10 + * }); + * + * + * @param {Object} opts [description] + * + */ + +function Button(opts) { + if (!(this instanceof Button)) { + return new Button(opts); + } + + var pinValue; + var raw; + var invert = false; + var downValue = 1; + var upValue = 0; + var controller = null; + var state = { + interval: null, + last: null + }; + + // Create a debounce boundary on event triggers + // this avoids button events firing on + // press noise and false positives + var trigger = Fn.debounce(function(key) { + aliases[key].forEach(function(type) { + this.emit(type); + }, this); + }, 7); + + pinValue = typeof opts === "object" ? opts.pin : opts; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + opts.pinValue = pinValue; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.DEFAULT; + } + + Board.Controller.call(this, controller, opts); + + // `holdtime` is used by an interval to determine + // if the button has been released within a specified + // time frame, in milliseconds. + this.holdtime = opts.holdtime || 500; + + // `opts.isPullup` is included as part of an effort to + // phase out "isFoo" options properties + this.pullup = opts.pullup || opts.isPullup || false; + + this.pulldown = opts.pulldown || opts.isPulldown || false; + + // Turns out some button circuits will send + // 0 for up and 1 for down, and some the inverse, + // so we can invert our function with this option. + // Default to invert in pullup mode, but use opts.invert + // if explicitly defined (even if false) + invert = typeof opts.invert !== "undefined" ? + opts.invert : (this.pullup || false); + + if (invert) { + downValue = downValue ^ 1; + upValue = upValue ^ 1; + } + + state.last = upValue; + + // Create a "state" entry for privately + // storing the state of the button + priv.set(this, state); + + Object.defineProperties(this, { + value: { + get: function() { + return Number(this.isDown); + } + }, + invert: { + get: function() { + return invert; + }, + set: function(value) { + invert = value; + downValue = invert ? 0 : 1; + upValue = invert ? 1 : 0; + + state.last = upValue; + } + }, + downValue: { + get: function() { + return downValue; + }, + set: function(value) { + downValue = value; + upValue = value ^ 1; + invert = value ? true : false; + + state.last = upValue; + } + }, + upValue: { + get: function() { + return upValue; + }, + set: function(value) { + upValue = value; + downValue = value ^ 1; + invert = value ? true : false; + + state.last = downValue; + } + }, + isDown: { + get: function() { + return this.toBoolean(raw); + } + } + }); + + /* istanbul ignore else */ + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + // Update the raw data value, which + // is used by isDown = toBoolean() + raw = data; + + if (!this.isDown) { + /* istanbul ignore else */ + if (state.interval) { + clearInterval(state.interval); + } + trigger.call(this, "up"); + } + + if (this.isDown) { + trigger.call(this, "down"); + + state.interval = setInterval(function() { + /* istanbul ignore else */ + if (this.isDown) { + this.emit("hold"); + } + }.bind(this), this.holdtime); + } + + state.last = data; + }.bind(this)); + } +} + +util.inherits(Button, Emitter); + + +/** + * Fired when the button is pressed down + * + * @event + * @name down + * @memberOf Button + */ + +/** + * Fired when the button is held + * + * @event + * @name hold + * @memberOf Button + */ + +/** + * Fired when the button is released + * + * @event + * @name up + * @memberOf Button + */ + + +/** + * Buttons() + * new Buttons() + */ + +function Buttons(numsOrObjects) { + if (!(this instanceof Buttons)) { + return new Buttons(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Button + }); + + Collection.Emitter.call(this, numsOrObjects); +} + +util.inherits(Buttons, Collection.Emitter); + +Collection.installMethodForwarding( + Buttons.prototype, Button.prototype +); + +// Assign Buttons Collection class as static "method" of Button. +Button.Collection = Buttons; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Button.Controllers = Controllers; + Button.purge = function() { + priv.clear(); + }; +} + + +module.exports = Button; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/color.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/color.js new file mode 100644 index 00000000..81a5a59d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/color.js @@ -0,0 +1,327 @@ +var Board = require("./board"); +var EVS = require("./evshield"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Fn = require("./fn"); +var priv = new Map(); + + +function pad(value, length) { + return Array(length - String(value).length + 1).join("0") + value; +} + +var Controllers = { + EVS_EV3: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + if (opts.mode) { + opts.mode = opts.mode.toUpperCase(); + } + + state.mode = opts.mode === "RAW" ? EVS.Type_EV3_COLOR_RGBRAW : EVS.Type_EV3_COLOR; + state.bytes = state.mode === EVS.Type_EV3_COLOR_RGBRAW ? 6 : 2; + + // Do not change the order of these items. They are listed such that the + // index corresponds to the color code produced by the EV3 color sensor. + // The range is very limited. + state.colors = [ + [], + [0, 0, 0], + [0, 0, 255], + [0, 128, 0], + [255, 255, 0], + [255, 0, 0], + [255, 255, 255], + [139, 69, 19], + ]; + + state.shield = EVS.shieldPort(opts.pin); + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + + state.ev3.setup(state.shield, EVS.Type_EV3); + state.ev3.write(state.shield, 0x81 + state.shield.offset, state.mode); + state.ev3.read(state.shield, EVS.ColorMeasure, state.bytes, function(data) { + var value = ""; + if (state.bytes === 2) { + value += String((data[0] | (data[1] << 8)) || 1); + } else { + for (var i = 0; i < 3; i++) { + value += pad(data[i * 2].toString(16), 2); + } + } + dataHandler(value); + }); + } + }, + toRGB: { + value: function(raw) { + var state = priv.get(this); + + if (state.mode === EVS.Type_EV3_COLOR) { + return raw > 0 && raw < 8 ? state.colors[raw] : state.colors[0]; + } else { + raw = String(raw); + return [0, 0, 0].map(function(zero, index) { + return parseInt(raw.slice(index * 2, index * 2 + 2), 16); + }); + } + } + } + }, + EVS_NXT: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + if (opts.mode) { + opts.mode = opts.mode.toUpperCase(); + } + + state.mode = opts.mode === "RAW" ? EVS.Type_NXT_COLOR_RGBRAW : EVS.Type_NXT_COLOR; + state.bytes = state.mode === EVS.Type_NXT_COLOR_RGBRAW ? 10 : 1; + + if (state.mode === EVS.Type_NXT_COLOR_RGBRAW) { + throw new Error("Raw RGB is not currently supported for the NXT."); + } + + // Do not change the order of these items. They are listed such that the + // index corresponds to the color code produced by the EV3 color sensor. + // The range is very limited. + state.colors = [ + [], + [0, 0, 0], + [0, 0, 255], + [0, 128, 0], + [255, 255, 0], + [255, 0, 0], + [255, 255, 255], + ]; + + state.shield = EVS.shieldPort(opts.pin); + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + state.ev3.setup(state.shield, EVS.Type_NXT_COLOR); + state.ev3.read(state.shield, 0x70 + state.shield.offset, state.bytes, function(data) { + var value = ""; + + if (state.bytes === 1) { + value += String(data[0]); + } else { + + // One day I'll figure this out :| + // There is a lot of documentation that + // claims this is possible, but I couldn't + // figure out how to make sense of the + // data that's returned. + // + // http://www.mathworks.com/help/supportpkg/legomindstormsnxt/ref/legomindstormsnxtcolorsensor.html#zmw57dd0e700 + // https://msdn.microsoft.com/en-us/library/ff631052.aspx + // http://www.lejos.org/nxt/nxj/api/lejos/nxt/ColorSensor.html + // http://www.robotc.net/forums/viewtopic.php?f=52&t=6939 + // http://code.metager.de/source/xref/lejos/classes/src/lejos/nxt/SensorPort.java#calData + // http://code.metager.de/source/xref/lejos/classes/src/lejos/nxt/SensorPort.java#SP_MODE_INPUT + // http://code.metager.de/source/xref/lejos/classes/src/lejos/nxt/SensorPort.java#416 + } + + // if (data[4] !== 0) { + dataHandler(value); + // } + }); + } + }, + toRGB: { + value: function(raw) { + var state = priv.get(this); + + if (state.mode === EVS.Type_NXT_COLOR) { + return raw > 0 && raw < 7 ? state.colors[raw] : state.colors[0]; + } else { + raw = String(raw); + return [0, 0, 0].map(function(zero, index) { + return parseInt(raw.slice(index * 2, index * 2 + 2), 16); + }); + } + } + } + }, + ISL29125: { + + REGISTER: { + value: { + RESET: 0x00, + // mode/lux range + CONFIG1: 0x01, + // ir adjust/filtering + CONFIG2: 0x02, + // interrupt control + CONFIG3: 0x03, + // Same as "GREEN DATA - LOW BYTE" + READ: 0x09 + } + }, + initialize: { + value: function(opts, dataHandler) { + // Cannot change address, so all values const/closed. + var address = opts.address || 0x44; + + // TODO: make configs user "definable" + + opts.address = address; + + this.io.i2cConfig(); + + // Reset chip + this.io.i2cWriteReg(address, this.REGISTER.RESET, 0x46); + + // RGB | 10K Lux | 12bits + this.io.i2cWriteReg(address, this.REGISTER.CONFIG1, 0x05 | 0x08 | 0x00); + + // High adjust + this.io.i2cWriteReg(address, this.REGISTER.CONFIG2, 0x3F); + + // No Interrupts + this.io.i2cWriteReg(address, this.REGISTER.CONFIG3, 0x00); + + this.io.i2cRead(address, this.REGISTER.READ, 6, function(data) { + var value = ""; + + // Register order: GLSB, GMSB, RLSB, RMSB, BLSB, BMSB + var g = (data[1] << 8) | data[0]; + var r = (data[3] << 8) | data[2]; + var b = (data[5] << 8) | data[4]; + + var rgb = [r >> 2, g >> 2, b >> 2].map(function(value) { + return Fn.constrain(value, 0, 255); + }); + + for (var i = 0; i < 3; i++) { + value += pad(rgb[i].toString(16), 2); + } + + dataHandler(value); + }); + } + }, + toRGB: { + value: function(raw) { + raw = String(raw); + return [0, 0, 0].map(function(zero, index) { + return parseInt(raw.slice(index * 2, index * 2 + 2), 16); + }); + } + } + }, +}; + + +var colorNames = ["red", "green", "blue"]; + + +/** + * Color + * @constructor + * + */ + +function Color(opts) { + + if (!(this instanceof Color)) { + return new Color(opts); + } + + var controller = null; + var state = {}; + var freq = opts.freq || 25; + var raw = 0; + var last = null; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (typeof opts.controller === "string") { + controller = Controllers[opts.controller]; + } else { + controller = opts.controller; + } + + if (controller == null) { + throw new Error("Color expects a valid controller"); + } + + priv.set(this, state); + + Board.Controller.call(this, controller, opts); + + if (!this.toRGB) { + this.toRGB = opts.toRGB || function(x) { + return x; + }; + } + + Object.defineProperties(this, { + value: { + get: function() { + return raw; + } + }, + rgb: { + get: function() { + return this.toRGB(raw).reduce(function(accum, value, index) { + accum[colorNames[index]] = value; + return accum; + }, {}); + } + } + }); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + setInterval(function() { + if (raw === undefined) { + return; + } + + var data = { + rgb: this.rgb, + }; + + this.emit("data", data); + + if (raw !== last) { + last = raw; + this.emit("change", data); + } + }.bind(this), freq); +} + +util.inherits(Color, Emitter); + +Color.hexCode = function(rgb) { + if (rgb.red === undefined || rgb.green === undefined || rgb.blue === undefined) { + return null; + } + return rgb.length === 0 ? "unknown" : colorNames.reduce(function(accum, name) { + return accum += pad(rgb[name].toString(16), 2); + }, ""); +}; + + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Color.Controllers = Controllers; + Color.purge = function() { + priv.clear(); + }; +} + +module.exports = Color; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/compass.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/compass.js new file mode 100644 index 00000000..a8730759 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/compass.js @@ -0,0 +1,932 @@ +var Board = require("./board"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Fn = require("./fn"); +var int16 = Fn.int16; +var TAU = Fn.TAU; + +var priv = new Map(); + +var Controllers = { + + HMC5883L: { + REGISTER: { + value: { + // Page 11 + // Table 2: Register List + // + // Configuration Register A + CRA: 0x00, + // Configuration Register B + // This may change, depending on gauss + CRB: 0x01, + // Mode Register + MODE: 0x02, + // Data Output X MSB Register + READ: 0x03, + } + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || 0x1E; + var READLENGTH = 6; + + state.scale = 1; + + Object.assign(state, new Compass.Scale(opts.gauss || 0.88)); + + opts.address = address; + + this.io.i2cConfig(opts); + + // Page 18 + // OPERATIONAL EXAMPLES... + // + // 1. Write CRA (00) – send 0x3C 0x00 0x70 (8-average, 15 Hz default, normal measurement) + // + // Set CRA + // Page 12 + this.io.i2cWrite(address, this.REGISTER.CRA, 0x70); + + // Set CRB + // Page 13 + this.io.i2cWrite(address, this.REGISTER.CRB, 0x40); + + // Page 14 + // Measurement: Continuous + this.io.i2cWrite(address, this.REGISTER.MODE, 0x00); + + this.io.i2cRead(address, this.REGISTER.READ, READLENGTH, function(bytes) { + dataHandler({ + x: int16(bytes[0], bytes[1]), + y: int16(bytes[4], bytes[5]), + z: int16(bytes[2], bytes[3]), + }); + }); + } + }, + toScaledHeading: { + value: function(raw) { + var state = priv.get(this); + + return ToHeading(raw.x * state.scale, raw.y * state.scale); + } + } + }, + + /** + * HMC6352: 2-Axis Compass Module + * 0x42 + * + * http://bildr.org/2011/01/hmc6352/ + */ + HMC6352: { + REGISTER: { + value: { + READ: 0x41 + } + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || 0x21; + var READLENGTH = 2; + + state.scale = 1; + + opts.delay = 10; + opts.address = address; + + this.io.i2cConfig(opts); + + this.io.i2cWrite(address, this.REGISTER.READ); + + // Initialize continuous read + this.io.i2cRead(address, this.REGISTER.READ, READLENGTH, function(bytes) { + dataHandler({ + x: (((bytes[0] << 8) + bytes[1]) / 10) | 0, + y: null, + z: null, + }); + }); + } + }, + toScaledHeading: { + value: function(raw) { + var state = priv.get(this); + return raw.x * state.scale; + }, + }, + }, + + BNO055: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var driver = IMU.Drivers.get(this.board, "BNO055", opts); + var state = priv.get(this); + + // AF p.32, Table 3-19: Magnetometer Unit settings + state.sensitivity = 16; + + driver.on("data", function(data) { + dataHandler(data.magnetometer); + }); + } + }, + toScaledHeading: { + value: function(raw) { + var state = priv.get(this); + + var x = raw.x / state.sensitivity; + var y = raw.y / state.sensitivity; + + return ToHeading(x, y); + }, + }, + }, + + // http://www.nxp.com/files/sensors/doc/data_sheet/MAG3110.pdf + MAG3110: { + REGISTER: { + value: { + // Page 15 + // Table 11 Register Address Map + // DR_STATUS + STATUS: 0x00, + // OUT_X_MSB + READ: 0x01, + // OFF_X_MSB + OFFSETS: 0x09, + // CTRL_REG1 + CTRL_REG1: 0x10, + // CTRL_REG2 + CTRL_REG2: 0x11, + } + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + // MAG3110 has only one possible address + var address = 0x0E; + var isDataPending = false; + var temp; + + state.isCalibrated = false; + state.isPreCalibrated = false; + state.hasEmittedCalibration = false; + state.measurements = 20; + + state.offsets = { + x: 0, + y: 0, + z: 0, + }; + state.accum = { + x: { offset: null, high: 0, low: 0 }, + y: { offset: null, high: 0, low: 0 }, + z: { offset: null, high: 0, low: 0 }, + }; + opts.delay = 2; + opts.address = address; + + if (opts.offsets) { + state.isCalibrated = true; + state.isPreCalibrated = true; + + if (Array.isArray(opts.offsets)) { + temp = opts.offsets.slice(); + opts.offsets = { + x: temp[0], + y: temp[1], + z: temp[2], + }; + } + + state.accum.x.low = opts.offsets.x[0]; + state.accum.x.high = opts.offsets.x[1]; + state.accum.x.offset = (state.accum.x.low + state.accum.x.high) / 2; + + state.accum.y.low = opts.offsets.y[0]; + state.accum.y.high = opts.offsets.y[1]; + state.accum.y.offset = (state.accum.y.low + state.accum.y.high) / 2; + + state.accum.z.low = opts.offsets.z[0]; + state.accum.z.high = opts.offsets.z[1]; + state.accum.z.offset = (state.accum.z.low + state.accum.z.high) / 2; + } + + /* + Page 14 + 4.2.7 MAG3110 Setup Examples + + Continuous measurements with ODR = 80 Hz, OSR = 1 + + 1. Enable automatic magnetic sensor resets by setting bit AUTO_MRST_EN in CTRL_REG2. + (CTRL_REG2 = 0x80) + 2. Put MAG3110 in active mode 80 Hz ODR with OSR = 1 by writing 0x01 to CTRL_REG1 + (CTRL_REG1 = 0x01) + 3. At this point it is possible to sync with MAG3110 utilizing INT1 pin or + using polling of the DR_STATUS register as explained in section 4.2.5. + */ + + this.io.i2cConfig(opts); + /* + Page 21 + 5.5.2 CTRL_REG2 (0x11) + Table 33. + CTRL_REG2 Register + + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + |---|---|---|---|---|---|---|---| + | A | | R | M | | | | | + + A: Automatic Magnetic Sensor Reset. Default value: 0. + R: Data output correction. Default value: 0. + M: Magnetic Sensor Reset (One-Shot). Default value: 0. + + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + |---|---|---|---|---|---|---|---| + | 1 | | 0 | 0 | | | | | + + 0b10000000 = 128 = 0x80 + + RAW + 0b10100000 = 160 = 0xA0 + */ + this.io.i2cWrite(address, this.REGISTER.CTRL_REG2, 0x80); + // this.io.i2cWrite(address, this.REGISTER.CTRL_REG2, 0xA0); + + /* + Page 20 + 5.5.1 CTRL_REG1 (0x10) + Table 30. CTRL_REG1 Register + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + |---|---|---|---|---|---|---|---| + |DR2|DR1|DR0|OS1|OS0|FR |TM |AC | + + See Table 31. CTRL_REG1 Description for complete descriptions + + (Active mode, 80Hz) + + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + |---|---|---|---|---|---|---|---| + | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | + + 0b00000001 = 1 = 0x01 + */ + this.io.i2cWrite(address, this.REGISTER.CTRL_REG1, 0x01); + + var measured = { + x: 0, + y: 0, + z: 0, + }; + + var readCycle = function() { + this.io.i2cReadOnce(address, this.REGISTER.STATUS, 1, function(data) { + /* + Page 16 + 5.1.1 DR_STATUS (0x00) + + Table 12 + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + |---|---|---|---|---|---|---|---| + |OVR|ZOW|XOW|YOW|DR |ZDR|YDR|XDR| + + Table 13 + (Contains Complete descriptions) + + OVR (ZYXOW) (X, Y, Z-axis Data Overwrite. Default value: 0.) + 0: No Data overwritten + 1: Previous X, Y, Z has been overwritten + + ZOW, YOW, XOW: + 0: No Data overwritten + 1: Previous X, Y, Z has been overwritten + + DR (ZYXDR) (X or Y or Z-axis new Data Ready. Default value: 0.) + 0: No new data is ready + 1: New full set of data is ready + + ZDR, YDR, XDR: + 0: No new data is ready + 1: New X, Y, Z data is ready + + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + |---|---|---|---|---|---|---|---| + | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | + + + 0b00001111 = 15 = 0x0F: A complete set of axis data is available + + 0b11111111 = 255 = 0xFF: All data is newly written + + */ + if (!isDataPending && (data[0] === 0x0F || data[0] === 0xFF)) { + isDataPending = true; + + this.io.i2cReadOnce(address, this.REGISTER.READ, 6, function(bytes) { + var timeout = 0; + + isDataPending = false; + + measured.x = int16(bytes[0], bytes[1]); + measured.y = int16(bytes[2], bytes[3]); + measured.z = int16(bytes[4], bytes[5]); + + if (!state.isCalibrated) { + + if (state.accum.x.offset === null) { + state.accum.x.offset = measured.x; + state.accum.x.low = measured.x; + state.accum.x.high = measured.x; + } + + if (state.accum.y.offset === null) { + state.accum.y.offset = measured.y; + state.accum.y.low = measured.y; + state.accum.y.high = measured.y; + } + + state.accum.x.low = Math.min(state.accum.x.low, measured.x); + state.accum.x.high = Math.max(state.accum.x.high, measured.x); + state.accum.x.offset = Math.trunc((state.accum.x.low + state.accum.x.high) / 2); + + state.accum.y.low = Math.min(state.accum.y.low, measured.y); + state.accum.y.high = Math.max(state.accum.y.high, measured.y); + state.accum.y.offset = Math.trunc((state.accum.y.low + state.accum.y.high) / 2); + + state.accum.z.low = Math.min(state.accum.z.low, measured.z); + state.accum.z.high = Math.max(state.accum.z.high, measured.z); + state.accum.z.offset = Math.trunc((state.accum.z.low + state.accum.z.high) / 2); + + --state.measurements; + + if (!state.measurements) { + state.isCalibrated = true; + } + } + + if (state.isCalibrated) { + if (!state.hasEmittedCalibration) { + state.hasEmittedCalibration = true; + + state.offsets.x = state.accum.x.offset; + state.offsets.y = state.accum.y.offset; + state.offsets.z = state.accum.z.offset; + + this.io.i2cWrite(address, this.REGISTER.OFFSETS, [ + state.offsets.x >> 7, (state.offsets.x << 1) & 0xFF, + state.offsets.y >> 7, (state.offsets.y << 1) & 0xFF, + state.offsets.z >> 7, (state.offsets.z << 1) & 0xFF, + ]); + + this.emit("calibrated", { + x: [state.accum.x.low, state.accum.x.high], + y: [state.accum.y.low, state.accum.y.high], + z: [state.accum.z.low, state.accum.z.high], + }); + } + + timeout = Math.floor(1000 / 80); + + dataHandler(measured); + } + + // MAG3110 is set to read at 80Hz (do this after calibration) + setTimeout(readCycle, timeout); + }.bind(this)); + } else { + readCycle(); + } + }.bind(this)); + }.bind(this); + + readCycle(); + } + }, + calibrate: { + value: function(measurements) { + var state = priv.get(this); + + state.isCalibrated = false; + state.measurements = measurements; + } + }, + toScaledHeading: { + value: function(raw) { + var state = priv.get(this); + var scale = { + x: 1 / (state.accum.x.high - state.accum.x.low), + y: 1 / (state.accum.y.high - state.accum.y.low), + }; + + var heading = Math.atan2(-raw.y * scale.y, raw.x * scale.x); + + if (heading < 0) { + heading += TAU; + } + + return Math.trunc(heading * Fn.RAD_TO_DEG); + }, + }, + }, + + /** + * LSM303C: 6Dof 3-Axis Magnetometer & Accelerometer + * + * https://learn.sparkfun.com/tutorials/lsm303c-6dof-hookup-guide + * https://github.com/sparkfun/LSM303C_6_DOF_IMU_Breakout + */ + LSM303C: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var driver = IMU.Drivers.get(this.board, "LSM303C", opts); + + driver.on("data", function(data) { + dataHandler(data.magnetometer); + }); + } + }, + toScaledHeading: { + value: function(raw) { + return ToHeading(raw.x, raw.y); + }, + }, + }, +}; + + +/** + * Compass + * @constructor + * + * five.Compass(); + * + * five.Compass({ + * controller: "HMC5883L", + * freq: 50, + * }); + * + * + * Device Shorthands: + * + * "HMC5883L": new five.Magnetometer() + * + * + * @param {Object} opts [description] + * + */ + +function Compass(opts) { + + if (!(this instanceof Compass)) { + return new Compass(opts); + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var freq = opts.freq || 25; + var controller = null; + var raw = { + x: null, + y: null, + z: null, + }; + var state = { + x: 0, + y: 0, + z: 0, + scale: 0, + register: 0, + heading: 0 + }; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + throw new Error("Compass expects a valid controller"); + } + + Board.Controller.call(this, controller, opts); + + if (!this.toScaledHeading) { + this.toScaledHeading = opts.toScaledHeading || function(raw) { + return raw; + }; + } + + priv.set(this, state); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + setInterval(function() { + if (raw.x === null) { + return; + } + var isChange = false; + + state.x = raw.x; + state.y = raw.y; + state.z = raw.z; + + var heading = this.heading; + + if (heading !== state.heading) { + state.heading = heading; + isChange = true; + } + + this.emit("data", { + heading: state.heading + }); + + if (isChange) { + this.emit("change", { + heading: state.heading + }); + } + }.bind(this), freq); + + Object.defineProperties(this, { + /** + * [read-only] Bearing information + * @name bearing + * @property + * @type Object + * + * + name + abbr + low + mid + high + heading + * + */ + + bearing: { + get: function() { + var length = Compass.Points.length; + var heading = this.heading; + var point; + + for (var i = 0; i < length; i++) { + point = Compass.Points[i]; + + if (heading >= point.low && heading <= point.high) { + // Specify fields to return to avoid returning the + // range array (too much noisy data) + return { + name: point.name, + abbr: point.abbr, + low: point.low, + high: point.high, + heading: heading + }; + } + } + } + }, + + /** + * [read-only] Raw X/Y/Z + * @name raw + * @property + * @type Object + * + x + y + z + */ + raw: { + get: function() { + return { + x: raw.x, + y: raw.y, + z: raw.z + }; + } + }, + + /** + * [read-only] Heading (azimuth) + * @name heading + * @property + * @type number + */ + heading: { + get: function() { + return this.toScaledHeading(raw); + } + } + }); +} + + +util.inherits(Compass, Emitter); + +function ToHeading(x, y) { + /** + * + * Applications of Magnetoresistive Sensors in Navigation Systems + * by Michael J. Caruso of Honeywell Inc. + * http://www.ssec.honeywell.com/position-sensors/datasheets/sae.pdf + * + * + * Azimuth (x=0, y<0) = 90.0 (3) + * Azimuth (x=0, y>0) = 270.0 + * Azimuth (x<0) = 180 - [arcTan(y/x)]*180/PI + * Azimuth (x>0, y<0) = - [arcTan(y/x)]*180/PI + * Azimuth (x>0, y>0) = 360 - [arcTan(y/x)]*180/PI + */ + /** + * http://bildr.org/2012/02/hmc5883l_arduino/ + * @type {[type]} + * Copyright (C) 2011 Love Electronics (loveelectronics.co.uk) + + This program is free software: you can redistribute it and/or modify it under the terms of the version 3 GNU General Public License as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with this program. If not, see . + + */ + + var radians = Math.atan2(y, x); + + if (radians < 0) { + radians += TAU; + } + + if (radians > TAU) { + radians -= TAU; + } + + return radians * Fn.RAD_TO_DEG; +} + + +/** + * Compass.scale Set the scale gauss for compass readings + * @param {Number} gauss [description] + * @return {register} [description] + * + * Ported from: + * http://bildr.org/2012/02/hmc5883l_arduino/ + */ + +Compass.Scale = function(gauss) { + + if (gauss === 0.88) { + this.register = 0x00; + this.scale = 0.73; + } else if (gauss === 1.3) { + this.register = 0x01; + this.scale = 0.92; + } else if (gauss === 1.9) { + this.register = 0x02; + this.scale = 1.22; + } else if (gauss === 2.5) { + this.register = 0x03; + this.scale = 1.52; + } else if (gauss === 4.0) { + this.register = 0x04; + this.scale = 2.27; + } else if (gauss === 4.7) { + this.register = 0x05; + this.scale = 2.56; + } else if (gauss === 5.6) { + this.register = 0x06; + this.scale = 3.03; + } else if (gauss === 8.1) { + this.register = 0x07; + this.scale = 4.35; + } else { + this.register = 0x00; + this.scale = 1; + } + + // Setting is in the top 3 bits of the register. + this.register = this.register << 5; +}; + + +/** + * Compass.Points + * + * 32 Point Compass + * +1 for North + * + */ + +Compass.Points = [{ + name: "North", + abbr: "N", + low: 354.38, + high: 360 +}, { + name: "North", + abbr: "N", + low: 0, + high: 5.62 +}, { + name: "North by East", + abbr: "NbE", + low: 5.63, + high: 16.87 +}, { + name: "North-NorthEast", + abbr: "NNE", + low: 16.88, + high: 28.12 +}, { + name: "NorthEast by North", + abbr: "NEbN", + low: 28.13, + high: 39.37 +}, { + name: "NorthEast", + abbr: "NE", + low: 39.38, + high: 50.62 +}, { + name: "NorthEast by East", + abbr: "NEbE", + low: 50.63, + high: 61.87 +}, { + name: "East-NorthEast", + abbr: "ENE", + low: 61.88, + high: 73.12 +}, { + name: "East by North", + abbr: "EbN", + low: 73.13, + high: 84.37 +}, { + name: "East", + abbr: "E", + low: 84.38, + high: 95.62 +}, { + name: "East by South", + abbr: "EbS", + low: 95.63, + high: 106.87 +}, { + name: "East-SouthEast", + abbr: "ESE", + low: 106.88, + high: 118.12 +}, { + name: "SouthEast by East", + abbr: "SEbE", + low: 118.13, + high: 129.37 +}, { + name: "SouthEast", + abbr: "SE", + low: 129.38, + high: 140.62 +}, { + name: "SouthEast by South", + abbr: "SEbS", + low: 140.63, + high: 151.87 +}, { + name: "South-SouthEast", + abbr: "SSE", + low: 151.88, + high: 163.12 +}, { + name: "South by East", + abbr: "SbE", + low: 163.13, + high: 174.37 +}, { + name: "South", + abbr: "S", + low: 174.38, + high: 185.62 +}, { + name: "South by West", + abbr: "SbW", + low: 185.63, + high: 196.87 +}, { + name: "South-SouthWest", + abbr: "SSW", + low: 196.88, + high: 208.12 +}, { + name: "SouthWest by South", + abbr: "SWbS", + low: 208.13, + high: 219.37 +}, { + name: "SouthWest", + abbr: "SW", + low: 219.38, + high: 230.62 +}, { + name: "SouthWest by West", + abbr: "SWbW", + low: 230.63, + high: 241.87 +}, { + name: "West-SouthWest", + abbr: "WSW", + low: 241.88, + high: 253.12 +}, { + name: "West by South", + abbr: "WbS", + low: 253.13, + high: 264.37 +}, { + name: "West", + abbr: "W", + low: 264.38, + high: 275.62 +}, { + name: "West by North", + abbr: "WbN", + low: 275.63, + high: 286.87 +}, { + name: "West-NorthWest", + abbr: "WNW", + low: 286.88, + high: 298.12 +}, { + name: "NorthWest by West", + abbr: "NWbW", + low: 298.13, + high: 309.37 +}, { + name: "NorthWest", + abbr: "NW", + low: 309.38, + high: 320.62 +}, { + name: "NorthWest by North", + abbr: "NWbN", + low: 320.63, + high: 331.87 +}, { + name: "North-NorthWest", + abbr: "NNW", + low: 331.88, + high: 343.12 +}, { + name: "North by West", + abbr: "NbW", + low: 343.13, + high: 354.37 +}]; + +Object.freeze(Compass.Points); + +/** + * Fires once every N ms, equal to value of `freq`. Defaults to 66ms + * + * @event + * @name read + * @memberOf Compass + */ + + +/** + * Fires when the calculated heading has changed + * + * @event + * @name headingchange + * @memberOf Compass + */ + + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Compass.Controllers = Controllers; + Compass.purge = function() { + priv.clear(); + }; +} + +module.exports = Compass; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/definitions/mpr121.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/definitions/mpr121.js new file mode 100644 index 00000000..42816b2f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/definitions/mpr121.js @@ -0,0 +1,264 @@ +// MPR121* Register Defines +module.exports = { + MAPS: { + MPR121QR2_SHIELD: { + KEYS: { + 0: 1, + 1: 2, + 2: 3, + 3: 4, + 4: 5, + 5: 6, + 6: 7, + 7: 8, + 8: 9, + }, + TARGETS: { + 256: 0, + 32: 1, + 4: 2, + 128: 3, + 16: 4, + 2: 5, + 64: 6, + 8: 7, + 1: 8, + } + }, + MPR121: { + KEYS: { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + 10: 10, + 11: 11, + }, + TARGETS: { + 1: 0, + 2: 1, + 4: 2, + 8: 3, + 16: 4, + 32: 5, + 64: 6, + 128: 7, + 256: 8, + 512: 9, + 1024: 10, + 2048: 11, + } + }, + MPR121_KEYPAD: { + KEYS: { + 0: 1, + 1: 2, + 2: 3, + 3: 4, + 4: 5, + 5: 6, + 6: 7, + 7: 8, + 8: 9, + 9: 10, + 10: 11, + 11: 12, + }, + TARGETS: { + 8: 0, + 128: 1, + 2048: 2, + 4: 3, + 64: 4, + 1024: 5, + 2: 6, + 32: 7, + 512: 8, + 1: 9, + 16: 10, + 256: 11, + }, + }, + MPR121_SHIELD: { + KEYS: { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + 10: 10, + 11: 11, + }, + TARGETS: { + 1: 0, + 2: 1, + 4: 2, + 8: 3, + 16: 4, + 32: 5, + 64: 6, + 128: 7, + 256: 8, + 512: 9, + 1024: 10, + 2048: 11, + }, + }, + }, + MPR121_DEFAULT_ADDRESS: 0x5A, + MPR121_SOFTRESET: 0x80, + + // MPR121 Registers (from data sheet) + ELE0_ELE7_TOUCH_STATUS: 0x00, + ELE8_ELE11_ELEPROX_TOUCH_STATUS: 0x01, + + ELE0_7_OOR_STATUS: 0x02, + ELE8_11_ELEPROX_OOR_STATUS: 0x03, + + ELE0_FILTERED_DATA_LSB: 0x04, + ELE0_FILTERED_DATA_MSB: 0x05, + ELE1_FILTERED_DATA_LSB: 0x06, + ELE1_FILTERED_DATA_MSB: 0x07, + ELE2_FILTERED_DATA_LSB: 0x08, + ELE2_FILTERED_DATA_MSB: 0x09, + ELE3_FILTERED_DATA_LSB: 0x0A, + ELE3_FILTERED_DATA_MSB: 0x0B, + ELE4_FILTERED_DATA_LSB: 0x0C, + ELE4_FILTERED_DATA_MSB: 0x0D, + ELE5_FILTERED_DATA_LSB: 0x0E, + ELE5_FILTERED_DATA_MSB: 0x0F, + ELE6_FILTERED_DATA_LSB: 0x10, + ELE6_FILTERED_DATA_MSB: 0x11, + ELE7_FILTERED_DATA_LSB: 0x12, + ELE7_FILTERED_DATA_MSB: 0x13, + ELE8_FILTERED_DATA_LSB: 0x14, + ELE8_FILTERED_DATA_MSB: 0x15, + ELE9_FILTERED_DATA_LSB: 0x16, + ELE9_FILTERED_DATA_MSB: 0x17, + ELE10_FILTERED_DATA_LSB: 0x18, + ELE10_FILTERED_DATA_MSB: 0x19, + ELE11_FILTERED_DATA_LSB: 0x1A, + ELE11_FILTERED_DATA_MSB: 0x1B, + ELEPROX_FILTERED_DATA_LSB: 0x1C, + ELEPROX_FILTERED_DATA_MSB: 0x1D, + + ELE0_BASELINE_VALUE: 0x1E, + ELE1_BASELINE_VALUE: 0x1F, + ELE2_BASELINE_VALUE: 0x20, + ELE3_BASELINE_VALUE: 0x21, + ELE4_BASELINE_VALUE: 0x22, + ELE5_BASELINE_VALUE: 0x23, + ELE6_BASELINE_VALUE: 0x24, + ELE7_BASELINE_VALUE: 0x25, + ELE8_BASELINE_VALUE: 0x26, + ELE9_BASELINE_VALUE: 0x27, + ELE10_BASELINE_VALUE: 0x28, + ELE11_BASELINE_VALUE: 0x29, + ELEPROX_BASELINE_VALUE: 0x2A, + + MHD_RISING: 0x2B, + NHD_AMOUNT_RISING: 0x2C, + NCL_RISING: 0x2D, + FDL_RISING: 0x2E, + MHD_FALLING: 0x2F, + NHD_AMOUNT_FALLING: 0x30, + NCL_FALLING: 0x31, + FDL_FALLING: 0x32, + NHD_AMOUNT_TOUCHED: 0x33, + NCL_TOUCHED: 0x34, + FDL_TOUCHED: 0x35, + ELEPROX_MHD_RISING: 0x36, + ELEPROX_NHD_AMOUNT_RISING: 0x37, + ELEPROX_NCL_RISING: 0x38, + ELEPROX_FDL_RISING: 0x39, + ELEPROX_MHD_FALLING: 0x3A, + ELEPROX_NHD_AMOUNT_FALLING: 0x3B, + ELEPROX_FDL_FALLING: 0x3C, + ELEPROX_NHD_AMOUNT_TOUCHED: 0x3E, + ELEPROX_NCL_TOUCHED: 0x3F, + ELEPROX_FDL_TOUCHED: 0x40, + + ELE0_TOUCH_THRESHOLD: 0x41, + ELE0_RELEASE_THRESHOLD: 0x42, + ELE1_TOUCH_THRESHOLD: 0x43, + ELE1_RELEASE_THRESHOLD: 0x44, + ELE2_TOUCH_THRESHOLD: 0x45, + ELE2_RELEASE_THRESHOLD: 0x46, + ELE3_TOUCH_THRESHOLD: 0x47, + ELE3_RELEASE_THRESHOLD: 0x48, + ELE4_TOUCH_THRESHOLD: 0x49, + ELE4_RELEASE_THRESHOLD: 0x4A, + ELE5_TOUCH_THRESHOLD: 0x4B, + ELE5_RELEASE_THRESHOLD: 0x4C, + ELE6_TOUCH_THRESHOLD: 0x4D, + ELE6_RELEASE_THRESHOLD: 0x4E, + ELE7_TOUCH_THRESHOLD: 0x4F, + ELE7_RELEASE_THRESHOLD: 0x50, + ELE8_TOUCH_THRESHOLD: 0x51, + ELE8_RELEASE_THRESHOLD: 0x52, + ELE9_TOUCH_THRESHOLD: 0x53, + ELE9_RELEASE_THRESHOLD: 0x54, + ELE10_TOUCH_THRESHOLD: 0x55, + ELE10_RELEASE_THRESHOLD: 0x56, + ELE11_TOUCH_THRESHOLD: 0x57, + ELE11_RELEASE_THRESHOLD: 0x58, + ELEPROX_TOUCH_THRESHOLD: 0x59, + ELEPROX_RELEASE_THRESHOLD: 0x5A, + DEBOUNCE_TOUCH_AND_RELEASE: 0x5B, + AFE_CONFIGURATION: 0x5C, + + FILTER_CONFIG: 0x5D, + ELECTRODE_CONFIG: 0x5E, + ELE0_CURRENT: 0x5F, + ELE1_CURRENT: 0x60, + ELE2_CURRENT: 0x61, + ELE3_CURRENT: 0x62, + ELE4_CURRENT: 0x63, + ELE5_CURRENT: 0x64, + ELE6_CURRENT: 0x65, + ELE7_CURRENT: 0x66, + ELE8_CURRENT: 0x67, + ELE9_CURRENT: 0x68, + ELE10_CURRENT: 0x69, + ELE11_CURRENT: 0x6A, + ELEPROX_CURRENT: 0x6B, + + ELE0_ELE1_CHARGE_TIME: 0x6C, + ELE2_ELE3_CHARGE_TIME: 0x6D, + ELE4_ELE5_CHARGE_TIME: 0x6E, + ELE6_ELE7_CHARGE_TIME: 0x6F, + ELE8_ELE9_CHARGE_TIME: 0x70, + ELE10_ELE11_CHARGE_TIME: 0x71, + ELEPROX_CHARGE_TIME: 0x72, + + GPIO_CONTROL_0: 0x73, + GPIO_CONTROL_1: 0x74, + GPIO_DATA: 0x75, + GPIO_DIRECTION: 0x76, + GPIO_ENABLE: 0x77, + GPIO_SET: 0x78, + GPIO_CLEAR: 0x79, + GPIO_TOGGLE: 0x7A, + AUTO_CONFIG_CONTROL_0: 0x7B, + AUTO_CONFIG_CONTROL_1: 0x7C, + AUTO_CONFIG_USL: 0x7D, + AUTO_CONFIG_LSL: 0x7E, + AUTO_CONFIG_TARGET_LEVEL: 0x7F, + + // Other Constants + // these are suggested values from app note 3944 + TOUCH_THRESHOLD: 0x0F, + RELEASE_THRESHOLD: 0x0A, + NUM_CHANNELS: 12 +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/esc.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/esc.js new file mode 100644 index 00000000..eb95f665 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/esc.js @@ -0,0 +1,476 @@ +var Board = require("./board"); +var Expander = require("./expander"); +var Pins = Board.Pins; +var Collection = require("./mixins/collection"); +var Fn = require("./fn"); +var Emitter = require("events").EventEmitter; +var util = require("util"); + +var priv = new Map(); + + +var Controllers = { + PCA9685: { + initialize: { + value: function(opts) { + var state = priv.get(this); + + this.address = opts.address || 0x40; + this.pwmRange = opts.pwmRange || [544, 2400]; + this.frequency = opts.frequency || 50; + + state.expander = Expander.get({ + address: this.address, + controller: this.controller, + bus: this.bus, + pwmRange: this.pwmRange, + frequency: this.frequency, + }); + + this.pin = state.expander.normalize(opts.pin); + } + }, + write: { + writable: true, + value: function(pin, microseconds) { + var state = priv.get(this); + state.expander.servoWrite(pin, microseconds); + } + } + }, + DEFAULT: { + initialize: { + value: function(opts) { + + // When in debug mode, if pin is not a PWM pin, emit an error + if (opts.debug && !this.board.pins.isServo(this.pin)) { + Board.Pins.Error({ + pin: this.pin, + type: "PWM", + via: "Servo", + }); + } + + this.io.servoConfig(this.pin, this.pwmRange[0], this.pwmRange[1]); + } + }, + write: { + writable: true, + value: function(pin, microseconds) { + microseconds |= 0; + this.io.servoWrite(pin, microseconds); + } + } + } +}; + +var Devices = { + FORWARD: { + deviceName: { + get: function() { + return "FORWARD"; + } + }, + dir: { + value: function(speed, dir) { + if (dir.name === "forward") { + return this.speed(speed); + } + } + } + }, + FORWARD_REVERSE: { + deviceName: { + get: function() { + return "FORWARD_REVERSE"; + } + }, + dir: { + value: function(speed, dir) { + if (dir.name === "forward") { + return this.speed(Fn.fscale(speed, 0, 100, this.neutral, this.range[1])); + } else { + return this.speed(Fn.fscale(speed, 0, 100, this.neutral, this.range[0])); + } + } + } + }, + FORWARD_BRAKE_REVERSE: { + deviceName: { + get: function() { + return "FORWARD_BRAKE_REVERSE"; + } + }, + dir: { + value: function(speed, dir) { + + /* + As far as I can tell, this isn't possible. + + To enable reverse, the brakes must first be applied, + but it's not nearly as simple as it sounds since there + appears to be a timing factor that differs across + speed controllers. + */ + + if (dir.name === "forward") { + this.speed(Fn.fscale(speed, 0, 100, this.neutral, this.range[1])); + } else { + this.speed(Fn.fscale(speed, 0, 100, this.neutral, this.range[0])); + } + } + } + } +}; + +/** + * ESC + * @constructor + * + * @param {Object} opts Options: pin, range + * @param {Number} pin Pin number + */ + +function ESC(opts) { + if (!(this instanceof ESC)) { + return new ESC(opts); + } + + var controller = null; + var pinValue; + var device; + var state = { + // All speed history for this ESC + // history = [ + // { + // timestamp: Date.now(), + // speed: speed + // } + // ]; + history: [], + value: 0 + }; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + priv.set(this, state); + + this.startAt = typeof opts.startAt !== "undefined" ? opts.startAt : null; + this.neutral = opts.neutral; + this.range = opts.range || [0, 100]; + this.pwmRange = opts.pwmRange || [544, 2400]; + this.interval = null; + + // StandardFirmata on Arduino allows controlling + // servos from analog pins. + // If we're currently operating with an Arduino + // and the user has provided an analog pin name + // (eg. "A0", "A5" etc.), parse out the numeric + // value and capture the fully qualified analog + // pin number. + if (typeof opts.controller === "undefined" && Pins.isFirmata(this)) { + if (typeof pinValue === "string" && pinValue[0] === "A") { + pinValue = this.io.analogPins[+pinValue.slice(1)]; + } + + pinValue = +pinValue; + + // If the board's default pin normalization + // came up with something different, use the + // the local value. + if (!Number.isNaN(pinValue) && this.pin !== pinValue) { + this.pin = pinValue; + } + } + + // Allow users to pass in custom device types + device = typeof opts.device === "string" ? + Devices[opts.device] : opts.device; + + if (!device) { + device = Devices.FORWARD; + } + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (!controller) { + controller = Controllers.DEFAULT; + } + + Object.defineProperties(this, Object.assign({}, device, controller, { + value: { + get: function() { + return state.value; + } + }, + history: { + get: function() { + return state.history.slice(-5); + } + }, + last: { + get: function() { + return state.history[state.history.length - 1] || { + last: null + }; + } + } + })); + + this.initialize(opts); + + if (this.deviceName !== "FORWARD") { + if (Number.isNaN(+this.neutral)) { + throw new Error("Directional speed controllers require a neutral point from 0-100 (number)"); + } + + this.startAt = this.neutral; + } + + // Match either null or undefined, but not 0 + if (this.startAt !== null && this.startAt !== undefined) { + this.speed(this.startAt); + } +} + +util.inherits(ESC, Emitter); + +/** + * speed + * + * Set the ESC's speed + * + * @param {Float} speed 0...100 (full range) + * + * @return {ESC} instance + */ + +ESC.prototype.speed = function(speed) { + var state = priv.get(this); + var history = state.history; + var noInterval = false; + var steps = 0; + var lspeed, hspeed; + + speed = Fn.constrain(speed, this.range[0], this.range[1]); + + if (this.interval) { + // Bail out if speed is the same as whatever was + // last _provided_ + if (this.value === speed) { + return this; + } else { + clearInterval(this.interval); + this.interval = null; + } + } + + state.value = speed; + + // This is the very first speed command being received. + // Safe to assume that the ESC and Brushless motor are + // not yet moving. + if (history.length === 0) { + noInterval = true; + } + + // Bail out if speed is the same as whatever was + // last _written_ + + if (this.last.speed === speed) { + return this; + } + + lspeed = this.last.speed; + hspeed = speed; + steps = Math.ceil(Math.abs(lspeed - hspeed)); + + if (!steps || steps === 1) { + noInterval = true; + } + + if (noInterval) { + this.write(this.pin, Fn.fscale(speed, 0, 100, this.pwmRange[0], this.pwmRange[1])); + + history.push({ + timestamp: Date.now(), + speed: speed + }); + return this; + } + + var throttle = lspeed; + + this.interval = setInterval(function() { + + if (hspeed > throttle) { + throttle++; + } else { + throttle--; + } + + this.write(this.pin, Fn.fscale(throttle, 0, 100, this.pwmRange[0], this.pwmRange[1])); + + history.push({ + timestamp: Date.now(), + speed: throttle + }); + + if (steps) { + steps--; + + if (!steps) { + clearInterval(this.interval); + this.interval = null; + } + } + }.bind(this), 1); + + return this; +}; + + +/** + * brake Stop the ESC by hitting the brakes ;) + * @return {Object} instance + */ +ESC.prototype.brake = function() { + var state = priv.get(this); + var speed = this.neutral || 0; + + this.speed(speed); + + state.history.push({ + timestamp: Date.now(), + speed: speed + }); + + return this; +}; + +[ + /** + * forward Set forward speed + * fwd Set forward speed + * + * @param {Number} 0-100, 0 is stopped, 100 is fastest + * @return {Object} this + */ + { + name: "forward", + abbr: "fwd", + value: 1 + }, + /** + * reverse Set revese speed + * rev Set revese speed + * + * @param {Number} 0-100, 0 is stopped, 100 is fastest + * @return {Object} this + */ + { + name: "reverse", + abbr: "rev", + value: 0 + } +].forEach(function(dir) { + var method = function(speed) { + this.dir(speed, dir); + return this; + }; + + ESC.prototype[dir.name] = ESC.prototype[dir.abbr] = method; +}); + + +/** + * stop Stop the ESC + * @return {Object} instance + */ +ESC.prototype.stop = function() { + var state = priv.get(this); + var history = state.history; + var speed = this.type === "bidirectional" ? this.neutral : 0; + + this.write(this.pin, Fn.fscale(speed, 0, 100, this.pwmRange[0], this.pwmRange[1])); + + history.push({ + timestamp: Date.now(), + speed: speed + }); + + return this; +}; + +/** + * ESC.Collection() + * new ESC.Collection() + * + * Constructs an Array-like instance of all escs + */ +function ESCs(numsOrObjects) { + if (!(this instanceof ESCs)) { + return new ESCs(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: ESC + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(ESCs, Collection); + +/** + * + * ESCs, speed(0-100%) + * + * set all escs to the specified speed from 0-100% + * + * eg. array.min(); + + * ESCs, min() + * + * set all escs to the minimum throttle + * + * eg. array.min(); + + * ESCs, max() + * + * set all escs to the maximum throttle + * + * eg. array.max(); + + * ESCs, stop() + * + * stop all escs + * + * eg. array.stop(); + */ + +Collection.installMethodForwarding( + ESCs.prototype, ESC.prototype +); + + +// Assign ESCs Collection class as static "method" of ESC. +// TODO: Eliminate .Array for 1.0.0 +ESC.Array = ESCs; +ESC.Collection = ESCs; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + ESC.Controllers = Controllers; + ESC.purge = function() { + priv.clear(); + }; +} + +module.exports = ESC; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/evshield.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/evshield.js new file mode 100644 index 00000000..28a459b3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/evshield.js @@ -0,0 +1,317 @@ +var Emitter = require("events").EventEmitter; +var util = require("util"); +var shared; + +function Bank(options) { + this.address = options.address; + this.io = options.io; + this.io.i2cConfig(options); +} + +Bank.prototype.read = function(register, numBytes, callback) { + if (register) { + this.io.i2cRead(this.address, register, numBytes, callback); + } else { + this.io.i2cRead(this.address, numBytes, callback); + } +}; + +Bank.prototype.write = function(register, bytes) { + if (!Array.isArray(bytes)) { + bytes = [bytes]; + } + this.io.i2cWrite(this.address, register, bytes); +}; + +function EVS(options) { + if (shared) { + return shared; + } + + this.bank = { + a: new Bank({ + address: EVS.BANK_A, + io: options.io, + }), + b: new Bank({ + address: EVS.BANK_B, + io: options.io, + }) + }; + + shared = this; +} + +EVS.shieldPort = function(pin) { + var port = EVS[pin]; + + if (port === undefined) { + throw new Error("Invalid EVShield pin name"); + } + + var address, analog, bank, motor, mode, offset, sensor; + var endsWithS1 = false; + + if (pin.startsWith("BA")) { + address = EVS.BANK_A; + bank = "a"; + } else { + address = EVS.BANK_B; + bank = "b"; + } + + if (pin.includes("M")) { + motor = pin.endsWith("M1") ? EVS.S1 : EVS.S2; + } + + if (pin.includes("S")) { + endsWithS1 = pin.endsWith("S1"); + + // Used for reading 2 byte integer values from raw sensors + analog = endsWithS1 ? EVS.S1_ANALOG : EVS.S2_ANALOG; + // Sensor Mode (1 or 2?) + mode = endsWithS1 ? EVS.S1_MODE : EVS.S2_MODE; + // Used for read registers + offset = endsWithS1 ? EVS.S1_OFFSET : EVS.S2_OFFSET; + // Used to address "sensor type" + sensor = endsWithS1 ? EVS.S1 : EVS.S2; + } + + return { + address: address, + analog: analog, + bank: bank, + mode: mode, + motor: motor, + offset: offset, + port: port, + sensor: sensor, + }; +}; + +EVS.isRawSensor = function(port) { + return port.analog === EVS.S1_ANALOG || port.analog === EVS.S2_ANALOG; +}; + +util.inherits(EVS, Emitter); + +EVS.prototype.setup = function(port, type) { + this.bank[port.bank].write(port.mode, [type]); +}; + +EVS.prototype.read = function(port, register, numBytes, callback) { + + if (port.sensor && port.offset && !EVS.isRawSensor(port)) { + register += port.offset; + } + + this.bank[port.bank].read(register, numBytes, callback); +}; + +EVS.prototype.write = function(port, register, data) { + this.bank[port.bank].write(register, data); +}; + +/* + * Shield Registers + */ + +EVS.BAS1 = 0x01; +EVS.BAS2 = 0x02; +EVS.BBS1 = 0x03; +EVS.BBS2 = 0x04; + +EVS.BAM1 = 0x05; +EVS.BAM2 = 0x06; +EVS.BBM1 = 0x07; +EVS.BBM2 = 0x08; + +EVS.BANK_A = 0x1A; +EVS.BANK_B = 0x1B; + +EVS.S1 = 0x01; +EVS.S2 = 0x02; + +EVS.M1 = 0x01; +EVS.M2 = 0x02; +EVS.MM = 0x03; + +EVS.Type_NONE = 0x00; +EVS.Type_SWITCH = 0x01; +EVS.Type_ANALOG = 0x02; + +EVS.Type_I2C = 0x09; + +/* + * Sensor Mode NXT + */ +EVS.Type_NXT_LIGHT_REFLECTED = 0x03; +EVS.Type_NXT_LIGHT = 0x04; +EVS.Type_NXT_COLOR = 0x0D; +EVS.Type_NXT_COLOR_RGBRAW = 0x04; +EVS.Type_NXT_COLORRED = 0x0E; +EVS.Type_NXT_COLORGREEN = 0x0F; +EVS.Type_NXT_COLORBLUE = 0x10; +EVS.Type_NXT_COLORNONE = 0x11; + + +EVS.Type_DATABIT0_HIGH = 0x40; + +/* + * Sensor Port Controls + */ +EVS.S1_MODE = 0x6F; +// EVS.S1_EV3_MODE = 0x6F; +EVS.S1_ANALOG = 0x70; +EVS.S1_OFFSET = 0; + +EVS.S2_MODE = 0xA3; +// EVS.S2_EV3_MODE = 0x6F; +EVS.S2_ANALOG = 0xA4; +EVS.S2_OFFSET = 52; + +/* + * Sensor Mode EV3 + */ +EVS.Type_EV3_LIGHT_REFLECTED = 0x00; +EVS.Type_EV3_LIGHT = 0x01; +EVS.Type_EV3_COLOR = 0x02; +EVS.Type_EV3_COLOR_REFRAW = 0x03; +EVS.Type_EV3_COLOR_RGBRAW = 0x04; +EVS.Type_EV3_TOUCH = 0x12; +EVS.Type_EV3 = 0x13; + +/* + * Sensor Read Registers + */ +EVS.Light = 0x83; +EVS.Bump = 0x84; +EVS.ColorMeasure = 0x83; +EVS.Proximity = 0x83; +EVS.Touch = 0x83; +EVS.Ultrasonic = 0x81; +EVS.Mode = 0x81; + +/* + * Sensor Read Byte Counts + */ +EVS.Light_Bytes = 2; +EVS.Analog_Bytes = 2; +EVS.Bump_Bytes = 1; +EVS.ColorMeasure_Bytes = 2; +EVS.Proximity_Bytes = 2; +EVS.Touch_Bytes = 1; + + +/* + * Motor selection + */ +EVS.Motor_1 = 0x01; +EVS.Motor_2 = 0x02; +EVS.Motor_Both = 0x03; + +/* + * Motor next action + */ +// stop and let the motor coast. +EVS.Motor_Next_Action_Float = 0x00; +// apply brakes, and resist change to tachometer, but if tach position is forcibly changed, do not restore position +EVS.Motor_Next_Action_Brake = 0x01; +// apply brakes, and restore externally forced change to tachometer +EVS.Motor_Next_Action_BrakeHold = 0x02; + +EVS.Motor_Stop = 0x60; +EVS.Motor_Reset = 0x52; + +/* + * Motor direction + */ + +EVS.Motor_Reverse = 0x00; +EVS.Motor_Forward = 0x01; + +/* + * Motor Tachometer movement + */ + +// Move the tach to absolute value provided +EVS.Motor_Move_Absolute = 0x00; +// Move the tach relative to previous position +EVS.Motor_Move_Relative = 0x01; + +/* + * Motor completion + */ + +EVS.Motor_Completion_Dont_Wait = 0x00; +EVS.Motor_Completion_Wait_For = 0x01; + +/* + * 0-100 + */ +EVS.Speed_Full = 90; +EVS.Speed_Medium = 60; +EVS.Speed_Slow = 25; + +/* + * Motor Port Controls + */ +EVS.CONTROL_SPEED = 0x01; +EVS.CONTROL_RAMP = 0x02; +EVS.CONTROL_RELATIVE = 0x04; +EVS.CONTROL_TACHO = 0x08; +EVS.CONTROL_BRK = 0x10; +EVS.CONTROL_ON = 0x20; +EVS.CONTROL_TIME = 0x40; +EVS.CONTROL_GO = 0x80; + +EVS.STATUS_SPEED = 0x01; +EVS.STATUS_RAMP = 0x02; +EVS.STATUS_MOVING = 0x04; +EVS.STATUS_TACHO = 0x08; +EVS.STATUS_BREAK = 0x10; +EVS.STATUS_OVERLOAD = 0x20; +EVS.STATUS_TIME = 0x40; +EVS.STATUS_STALL = 0x80; + +EVS.COMMAND = 0x41; +EVS.VOLTAGE = 0x6E; + +EVS.SETPT_M1 = 0x42; +EVS.SPEED_M1 = 0x46; +EVS.TIME_M1 = 0x47; +EVS.CMD_B_M1 = 0x48; +EVS.CMD_A_M1 = 0x49; + +EVS.SETPT_M2 = 0x4A; +EVS.SPEED_M2 = 0x4E; +EVS.TIME_M2 = 0x4F; +EVS.CMD_B_M2 = 0x50; +EVS.CMD_A_M2 = 0x51; + + +/* + * Motor Read registers. + */ +EVS.POSITION_M1 = 0x52; +EVS.POSITION_M2 = 0x56; +EVS.STATUS_M1 = 0x5A; +EVS.STATUS_M2 = 0x5B; +EVS.TASKS_M1 = 0x5C; +EVS.TASKS_M2 = 0x5D; + +EVS.ENCODER_PID = 0x5E; +EVS.SPEED_PID = 0x64; +EVS.PASS_COUNT = 0x6A; +EVS.TOLERANCE = 0x6B; + +/* + * Built-in components + */ +EVS.BTN_PRESS = 0xDA; +EVS.RGB_LED = 0xD7; +EVS.CENTER_RGB_LED = 0xDE; + + + +module.exports = EVS; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/expander.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/expander.js new file mode 100644 index 00000000..d2b4ba97 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/expander.js @@ -0,0 +1,2057 @@ +var Board = require("./board"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var nanosleep = require("./sleep").nano; +var Fn = require("./fn"); +var priv = new Map(); +var active = new Map(); + +function Base() { + Emitter.call(this); + + this.HIGH = 1; + this.LOW = 0; + this.isReady = false; + + this.MODES = {}; + this.pins = []; + this.analogPins = []; +} + +util.inherits(Base, Emitter); + +var Controllers = { + MCP23017: { + ADDRESSES: { + value: [0x20] + }, + REGISTER: { + value: { + // IO A + IODIRA: 0x00, + GPPUA: 0x0C, + GPIOA: 0x12, + OLATA: 0x14, + // IO B + IODIRB: 0x01, + GPPUB: 0x0D, + GPIOB: 0x13, + OLATB: 0x15, + } + }, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.iodir = [0xff, 0xff]; + state.olat = [0xff, 0xff]; + state.gpio = [0xff, 0xff]; + state.gppu = [0x00, 0x00]; + + this.address = opts.address || this.ADDRESSES[0]; + opts.address = this.address; + + this.io.i2cConfig(opts); + this.io.i2cWrite(this.address, [this.REGISTER.IODIRA, state.iodir[this.REGISTER.IODIRA]]); + this.io.i2cWrite(this.address, [this.REGISTER.IODIRB, state.iodir[this.REGISTER.IODIRB]]); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 16; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.INPUT, + this.MODES.OUTPUT + ], + mode: 0, + value: 0, + report: 0, + analogChannel: 127 + }); + + this.pinMode(i, this.MODES.OUTPUT); + this.digitalWrite(i, this.LOW); + } + + this.name = "MCP23017"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return pin; + } + }, + // 1.6.1 I/O DIRECTION REGISTER + pinMode: { + value: function(pin, mode) { + var state = priv.get(this); + var pinIndex = pin; + var port = 0; + var iodir = null; + + if (pin < 8) { + port = this.REGISTER.IODIRA; + } else { + port = this.REGISTER.IODIRB; + pin -= 8; + } + + iodir = state.iodir[port]; + + if (mode === this.io.MODES.INPUT) { + iodir |= 1 << pin; + } else { + iodir &= ~(1 << pin); + } + + this.pins[pinIndex].mode = mode; + this.io.i2cWrite(this.address, [port, iodir]); + + state.iodir[port] = iodir; + } + }, + // 1.6.10 PORT REGISTER + digitalWrite: { + value: function(pin, value) { + var state = priv.get(this); + var pinIndex = pin; + var port = 0; + var gpio = 0; + // var olataddr = 0; + var gpioaddr = 0; + + if (pin < 8) { + port = this.REGISTER.IODIRA; + // olataddr = this.REGISTER.OLATA; + gpioaddr = this.REGISTER.GPIOA; + } else { + port = this.REGISTER.IODIRB; + // olataddr = this.REGISTER.OLATB; + gpioaddr = this.REGISTER.GPIOB; + pin -= 8; + } + + gpio = state.olat[port]; + + if (value === this.io.HIGH) { + gpio |= 1 << pin; + } else { + gpio &= ~(1 << pin); + } + + this.pins[pinIndex].report = 0; + this.pins[pinIndex].value = value; + this.io.i2cWrite(this.address, [gpioaddr, gpio]); + + state.olat[port] = gpio; + state.gpio[port] = gpio; + } + }, + // 1.6.7 PULL-UP RESISTOR + // CONFIGURATION REGISTER + pullUp: { + value: function(pin, value) { + var state = priv.get(this); + var port = 0; + var gppu = 0; + var gppuaddr = 0; + + if (pin < 8) { + port = this.REGISTER.IODIRA; + gppuaddr = this.REGISTER.GPPUA; + } else { + port = this.REGISTER.IODIRB; + gppuaddr = this.REGISTER.GPPUB; + pin -= 8; + } + + gppu = state.gppu[port]; + + if (value === this.io.HIGH) { + gppu |= 1 << pin; + } else { + gppu &= ~(1 << pin); + } + + this.io.i2cWrite(this.address, [gppuaddr, gppu]); + + state.gppu[port] = gppu; + } + }, + digitalRead: { + value: function(pin, callback) { + var pinIndex = pin; + var gpioaddr = 0; + + if (pin < 8) { + gpioaddr = this.REGISTER.GPIOA; + } else { + gpioaddr = this.REGISTER.GPIOB; + pin -= 8; + } + + this.pins[pinIndex].report = 1; + + this.on("digital-read-" + pinIndex, callback); + + this.io.i2cRead(this.address, gpioaddr, 1, function(data) { + var byte = data[0]; + var value = byte >> pin & 0x01; + + this.pins[pinIndex].value = value; + + this.emit("digital-read-" + pinIndex, value); + }.bind(this)); + } + }, + }, + MCP23008: { + ADDRESSES: { + value: [0x20] + }, + REGISTER: { + value: { + IODIR: 0x00, + GPPU: 0x06, + GPIO: 0x09, + OLAT: 0x0A, + } + }, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.iodir = [0xff]; + state.olat = [0xff]; + state.gpio = [0xff]; + state.gppu = [0x00]; + + this.address = opts.address || this.ADDRESSES[0]; + + opts.address = this.address; + + this.io.i2cConfig(opts); + this.io.i2cWrite(this.address, [this.REGISTER.IODIR, state.iodir[this.REGISTER.IODIR]]); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 8; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.INPUT, + this.MODES.OUTPUT + ], + mode: 0, + value: 0, + report: 0, + analogChannel: 127 + }); + + this.pinMode(i, this.MODES.OUTPUT); + this.digitalWrite(i, this.LOW); + } + + this.name = "MCP23008"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return pin; + } + }, + // 1.6.1 I/O DIRECTION REGISTER + pinMode: { + value: function(pin, mode) { + var state = priv.get(this); + var pinIndex = pin; + var port = this.REGISTER.IODIR; + var iodir = state.iodir[port]; + + if (mode === this.io.MODES.INPUT) { + iodir |= 1 << pin; + } else { + iodir &= ~(1 << pin); + } + + this.pins[pinIndex].mode = mode; + this.io.i2cWrite(this.address, [port, iodir]); + + state.iodir[port] = iodir; + } + }, + // 1.6.10 PORT REGISTER + digitalWrite: { + value: function(pin, value) { + var state = priv.get(this); + var pinIndex = pin; + var port = this.REGISTER.IODIR; + var gpioaddr = this.REGISTER.GPIO; + var gpio = state.olat[port]; + + if (value === this.io.HIGH) { + gpio |= 1 << pin; + } else { + gpio &= ~(1 << pin); + } + + this.pins[pinIndex].report = 0; + this.pins[pinIndex].value = value; + this.io.i2cWrite(this.address, [gpioaddr, gpio]); + + state.olat[port] = gpio; + state.gpio[port] = gpio; + } + }, + // 1.6.7 PULL-UP RESISTOR + // CONFIGURATION REGISTER + pullUp: { + value: function(pin, value) { + var state = priv.get(this); + var port = this.REGISTER.IODIR; + var gppuaddr = this.REGISTER.GPPU; + var gppu = state.gppu[port]; + + if (value === this.io.HIGH) { + gppu |= 1 << pin; + } else { + gppu &= ~(1 << pin); + } + + this.io.i2cWrite(this.address, [gppuaddr, gppu]); + + state.gppu[port] = gppu; + } + }, + digitalRead: { + value: function(pin, callback) { + var pinIndex = pin; + var gpioaddr = this.REGISTER.GPIO; + + this.pins[pinIndex].report = 1; + + this.on("digital-read-" + pin, callback); + + this.io.i2cRead(this.address, gpioaddr, 1, function(data) { + var byte = data[0]; + var value = byte >> pin & 0x01; + + this.pins[pinIndex].value = value; + + this.emit("digital-read-" + pin, value); + }.bind(this)); + } + }, + }, + PCF8574: { + ADDRESSES: { + value: [0x20] + }, + REGISTER: {}, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.port = 0x00; + state.ddr = 0x00; + state.pins = 0x00; + + this.address = opts.address || this.ADDRESSES[0]; + + opts.address = this.address; + this.io.i2cConfig(opts); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 8; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.INPUT, + this.MODES.OUTPUT + ], + mode: 1, + value: 0, + report: 0, + analogChannel: 127 + }); + + this.pinMode(i, this.MODES.OUTPUT); + this.digitalWrite(i, this.LOW); + } + + this.name = "PCF8574"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return pin; + } + }, + pinMode: { + value: function(pin, mode) { + var state = priv.get(this); + var pinIndex = pin; + var port = state.port; + var ddr = state.ddr; + var pins = state.pins; + + if (mode === this.MODES.INPUT) { + ddr &= ~(1 << pin); + port &= ~(1 << pin); + } else { + ddr |= (1 << pin); + port &= ~(1 << pin); + } + + this.pins[pinIndex].mode = mode; + + state.port = port; + state.ddr = ddr; + + this.io.i2cWrite(this.address, (pins & ~ddr) | port); + } + }, + digitalWrite: { + value: function(pin, value) { + var state = priv.get(this); + var pinIndex = pin; + var port = state.port; + var ddr = state.ddr; + var pins = state.pins; + + if (value) { + port |= 1 << pin; + } else { + port &= ~(1 << pin); + } + + this.pins[pinIndex].report = 0; + this.pins[pinIndex].value = value; + + state.port = port; + + this.io.i2cWrite(this.address, (pins & ~ddr) | port); + } + }, + digitalRead: { + value: function(pin, callback) { + var state = priv.get(this); + var pinIndex = pin; + + this.pins[pinIndex].report = 1; + + this.on("digital-read-" + pin, callback); + + this.io.i2cRead(this.address, 1, function(data) { + var byte = data[0]; + var value = byte >> pin & 0x01; + + state.pins = byte; + + this.pins[pinIndex].value = value; + + this.emit("digital-read-" + pin, value); + }.bind(this)); + } + }, + }, + PCF8575: { + ADDRESSES: { + value: [0x20] + }, + REGISTER: {}, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.port = [0x00, 0x01]; + state.gpio = [0x00, 0x00]; + + this.address = opts.address || this.ADDRESSES[0]; + + opts.address = this.address; + this.io.i2cConfig(opts); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 16; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.INPUT, + this.MODES.OUTPUT + ], + mode: 1, + value: 0, + report: 0, + analogChannel: 127 + }); + + this.pinMode(i, this.MODES.OUTPUT); + this.digitalWrite(i, this.LOW); + } + + // Set all pins low on initialization + this.io.i2cWrite(this.address, state.gpio); + + this.name = "PCF8575"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return pin; + } + }, + pinMode: { + value: function(pin, mode) { + var pinIndex = pin; + this.pins[pinIndex].mode = mode; + } + }, + digitalWrite: { + value: function(pin, value) { + var state = priv.get(this); + var pinIndex = pin; + var port; + + if (pin < 8) { + port = 0; + } else { + port = 1; + pin -= 8; + } + + if (value === this.io.HIGH) { + state.gpio[port] |= 1 << pin; + } else { + state.gpio[port] &= ~(1 << pin); + } + + this.pins[pinIndex].report = 0; + this.pins[pinIndex].value = value; + + this.io.i2cWrite(this.address, state.gpio); + } + }, + digitalRead: { + value: function(pin, callback) { + var pinIndex = pin; + var port; + + if (pin < 8) { + port = 0; + } else { + port = 1; + pin -= 8; + } + + this.pins[pinIndex].report = 1; + + this.on("digital-read-" + pin, callback); + + this.io.i2cRead(this.address, 2, function(data) { + var byte = data[port]; + var value = byte >> pin & 0x01; + + this.pins[pinIndex].value = value; + + this.emit("digital-read-" + pin, value); + }.bind(this)); + } + }, + }, + PCA9685: { + ADDRESSES: { + value: [0x40] + }, + REGISTER: { + value: { + MODE1: 0x00, + PRESCALE: 0xFE, + BASE: 0x06 + } + }, + initialize: { + value: function(opts) { + var state = priv.get(this); + + // 7.3.5 PWM frequency PRE_SCALE + // + state.frequency = Board.constrain(opts.frequency || 1526, 24, 1526) * 0.9; + + this.address = opts.address || this.ADDRESSES[0]; + this.pwmRange = opts.pwmRange || [0, 4095]; + + Object.defineProperties(this, { + prescale: { + get: function() { + // PCA9685 has an on-board 25MHz clock source + + // 7.3.5 PWM frequency PRE_SCALE + return Math.round(25000000 / (4096 * state.frequency)) - 1; + } + }, + frequency: { + get: function() { + return state.frequency; + } + } + }); + + opts.address = this.address; + + this.io.i2cConfig(opts); + + // Reset + this.io.i2cWriteReg(this.address, this.REGISTER.MODE1, 0x00); + // Sleep + this.io.i2cWriteReg(this.address, this.REGISTER.MODE1, 0x10); + // Set prescalar + this.io.i2cWriteReg(this.address, this.REGISTER.PRESCALE, this.prescale); + // Wake up + this.io.i2cWriteReg(this.address, this.REGISTER.MODE1, 0x00); + // Wait 5 nanoseconds for restart + nanosleep(5); + // Auto-increment + this.io.i2cWriteReg(this.address, this.REGISTER.MODE1, 0xa1); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 16; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.OUTPUT, + this.MODES.PWM, + this.MODES.SERVO, + ], + mode: 0, + value: 0, + report: 0, + analogChannel: 127 + }); + + this.pinMode(i, this.MODES.OUTPUT); + this.digitalWrite(i, this.LOW); + } + + this.name = "PCA9685"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return this.io.name.includes("Tessel 2") ? pin - 1 : pin; + } + }, + pinMode: { + value: function(pin, mode) { + if (this.pins[pin] === undefined) { + throw new RangeError("Invalid PCA9685 pin: " + pin); + } + this.pins[pin].mode = mode; + } + }, + digitalWrite: { + value: function(pin, value) { + this.pwmWrite(pin, value ? 255 : 0); + } + }, + analogWrite: { + value: function(pin, value) { + this.pwmWrite(pin, value); + } + }, + servoWrite: { + value: function(pin, value) { + + var off; + + if (value < 544) { + value = Board.constrain(value, 0, 180); + off = Fn.map(value, 0, 180, this.pwmRange[0] / 4, this.pwmRange[1] / 4); + } else { + off = value / 4; + } + + off |= 0; + + this.io.i2cWrite(this.address, [ + this.REGISTER.BASE + 4 * pin, + 0, 0, + off, off >> 8 + ]); + } + }, + pwmWrite: { + value: function(pin, value) { + + if (this.pins[pin] === undefined) { + throw new RangeError("Invalid PCA9685 pin: " + pin); + } + + value = Board.constrain(value, 0, 255); + + var on = 0; + var off = this.pwmRange[1] * value / 255; + + if (value === 0) { + // Special value for signal fully off. + on = 0; + off = 4096; + } + + if (value === 255) { + // Special value for signal fully on. + on = 4096; + off = 0; + } + + this.io.i2cWrite(this.address, [ + this.REGISTER.BASE + 4 * pin, + on, on >> 8, + off, off >> 8 + ]); + + this.pins[pin].value = value; + } + } + }, + PCF8591: { + ADDRESSES: { + value: [0x48] + }, + REGISTER: {}, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.control = 0x45; + state.reading = false; + + this.address = opts.address || this.ADDRESSES[0]; + + opts.address = this.address; + this.io.i2cConfig(opts); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 4; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.ANALOG + ], + mode: 1, + value: 0, + report: 0, + analogChannel: i + }); + } + + this.analogPins.push(0, 1, 2, 3); + + this.io.i2cWrite(this.address, state.control); + + this.name = "PCF8591"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + if (typeof pin === "string" && pin[0] === "A") { + return +pin.slice(1); + } + return pin; + } + }, + pinMode: { + value: function(pin, mode) { + this.pins[pin].mode = mode; + } + }, + analogRead: { + value: function(pin, callback) { + var state = priv.get(this); + var pinIndex = pin; + + this.pins[pinIndex].report = 1; + + this.on("analog-read-" + pin, callback); + + // Since this operation will read all 4 pins, + // it only needs to be initiated once. + if (!state.reading) { + state.reading = true; + + this.io.i2cRead(this.address, 4, function(data) { + var value; + for (var i = 0; i < 4; i++) { + value = data[i] << 2; + this.pins[i].value = value; + + if (this.pins[i].report) { + this.emit("analog-read-" + i, value); + } + } + }.bind(this)); + } + } + }, + }, + MUXSHIELD2: { + initialize: { + value: function() { + var state = priv.get(this); + + // _S[\d] (Digital: 2, 4, 6, 7) + state.select = [2, 4, 6, 7]; + // _IOS[\d] (Digital: 10, 11, 12) + state.ios = [null, 10, 11, 12]; + // _IO[\d] (Analog In: "A0", "A1", "A2") + state.io = [null, 14, 15, 16]; + state.aio = [null, 0, 1, 2]; + + state.outMode = 8; + state.pinMap = {}; + state.rowReading = [false, false, false]; + state.rowMode = [null, null, null]; + // Each rowValue is a single uint16 + state.rowValues = [0, 0, 0]; + + Object.assign(this.MODES, { + INPUT: 0, + OUTPUT: 1, + ANALOG: 2, + }); + + this.io.pinMode(state.select[0], this.MODES.OUTPUT); + this.io.pinMode(state.select[1], this.MODES.OUTPUT); + this.io.pinMode(state.select[2], this.MODES.OUTPUT); + this.io.pinMode(state.select[3], this.MODES.OUTPUT); + + this.io.pinMode(state.outMode, this.MODES.OUTPUT); + this.io.digitalWrite(state.outMode, this.LOW); + + this.io.pinMode(state.ios[1], this.MODES.OUTPUT); + this.io.pinMode(state.ios[2], this.MODES.OUTPUT); + this.io.pinMode(state.ios[3], this.MODES.OUTPUT); + + var row = 1; + var mask = 16; + var index = 0; + + for (var i = 0; i < 48; i++) { + var band = i & mask; + + if (band === mask) { + row++; + mask *= 2; + index = 0; + } + + state.pinMap["IO" + row + "-" + index] = i; + + this.pins.push({ + row: row, + index: index, + supportedModes: [ + this.MODES.INPUT, + this.MODES.OUTPUT, + this.MODES.ANALOG, + ], + mode: 1, + value: 0, + report: 0, + analogChannel: i + }); + + this.analogPins.push(i); + + // TODO: Not sure about this? + // this.io.pinMode(i, this.MODES.OUTPUT); + // this.io.digitalWrite(i, this.LOW); + + index++; + } + + this.name = "MUXSHIELD2"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return pin; + } + }, + pinMode: { + value: function(pin, mode) { + var state = priv.get(this); + var pinIndex = state.pinMap[pin]; + + if (pinIndex === undefined) { + throw new Error("MUXSHIELD2: Invalid Pin number or name: " + pin); + } + + var row = this.pins[pinIndex].row; + var rowModeIndex = row - 1; + var rowMode = state.rowMode[rowModeIndex]; + + if (rowMode === mode) { + return this; + } + + if (rowMode !== null && rowMode !== mode) { + throw new Error("MUXSHIELD2: Cannot set mixed modes per IO row."); + } + + state.rowMode[rowModeIndex] = mode; + + // MUXSHIELD2 Disallows mixing modes per row. + // Once a mode is set for a given pin in a given row, + // set all the pins in that row to the same mode. + for (var i = 0; i < 16; i++) { + this.pins[rowModeIndex + i].mode = mode; + } + + var IO = state.io[row]; + var IOS = state.ios[row]; + + if (mode === this.MODES.INPUT) { + // Read an analog input as digital + this.io.pinMode(IO, this.MODES.INPUT); + // this.io.digitalWrite(IOS, this.LOW); + } + + if (mode === this.MODES.OUTPUT) { + this.io.pinMode(IO, this.MODES.OUTPUT); + this.io.digitalWrite(IOS, this.HIGH); + } + } + }, + digitalWrite: { + value: function(pin, value) { + var state = priv.get(this); + var pinIndex = state.pinMap[pin]; + + if (pinIndex === undefined) { + throw new Error("MUXSHIELD2: Invalid Pin number or name: " + pin); + } + + var row = this.pins[pinIndex].row; + var rowValueIndex = row - 1; + var rowValue = state.rowValues[rowValueIndex]; + + var ioPin = row - 1; + var offset = ioPin * 16; + var channel = pinIndex - offset; + + if (value) { + rowValue |= 1 << channel; + } else { + rowValue &= ~(1 << channel); + } + + this.io.digitalWrite(state.select[3], this.LOW); + this.io.digitalWrite(state.outMode, this.HIGH); + + var S = state.select[row - 1]; + var IO = state.io[row]; + + for (var i = 15; i >= 0; i--) { + this.io.digitalWrite(S, this.LOW); + this.io.digitalWrite(IO, (rowValue >> i) & 1); + this.io.digitalWrite(S, this.HIGH); + } + + this.io.digitalWrite(state.select[3], this.HIGH); + this.io.digitalWrite(state.outMode, this.LOW); + + this.pins[pinIndex].value = value; + + state.rowValues[rowValueIndex] = rowValue; + } + }, + digitalRead: { + value: function(pin, callback) { + this.ioRead("digital", pin, callback); + } + }, + analogRead: { + value: function(pin, callback) { + this.ioRead("analog", pin, callback); + } + }, + ioRead: { + value: function(type, pin, callback) { + var state = priv.get(this); + var pinIndex = state.pinMap[pin]; + + if (pinIndex === undefined) { + throw new Error("MUXSHIELD2: Invalid Pin number or name: " + pin); + } + + this.on(type + "-read-" + pinIndex, callback); + + var isAnalog = type === "analog" ? true : false; + var row = this.pins[pinIndex].row; + var rowReadingIndex = row - 1; + var offset = rowReadingIndex * 16; + var channel = pinIndex - offset; + + this.pins[pinIndex].report = 1; + this.pins[pinIndex].channel = channel; + this.pins[pinIndex].ioPin = isAnalog ? rowReadingIndex : rowReadingIndex + 14; + + var nextPinIndex = function() { + var startAt = nextPinIndex.lastPinIndex + 1; + + for (var i = startAt; i < this.pins.length; i++) { + if (this.pins[i].report === 1) { + nextPinIndex.lastPinIndex = i; + return nextPinIndex.lastPinIndex; + } + } + + nextPinIndex.lastPinIndex = -1; + + return nextPinIndex(); + }.bind(this); + + nextPinIndex.lastPinIndex = -1; + + var handler = function(value) { + var pinIndex = nextPinIndex.lastPinIndex; + var pin = this.pins[pinIndex]; + + this.emit(type + "-read-" + pinIndex, value); + + this.io.removeListener(type + "-read-" + pin.ioPin, handler); + + setTimeout(read, 10); + }.bind(this); + + var read = function() { + var pinIndex = nextPinIndex(); + var pin = this.pins[pinIndex]; + + this.select(pin.channel); + + if (isAnalog) { + this.io.pinMode(pin.ioPin, this.io.MODES.ANALOG); + this.io.analogRead(pin.ioPin, handler); + } else { + this.io.digitalRead(pin.ioPin, handler); + } + }.bind(this); + + if (!state.rowReading[rowReadingIndex]) { + state.rowReading[rowReadingIndex] = true; + read(); + } + } + }, + + + select: { + value: function(channel) { + var state = priv.get(this); + this.io.digitalWrite(state.outMode, this.LOW); + this.io.digitalWrite(state.select[0], (channel & 1)); + this.io.digitalWrite(state.select[1], (channel & 3) >> 1); + this.io.digitalWrite(state.select[2], (channel & 7) >> 2); + this.io.digitalWrite(state.select[3], (channel & 15) >> 3); + } + } + }, + + GROVEPI: { + ADDRESSES: { + value: [0x04] + }, + REGISTER: {}, + COMMANDS: { + value: { + DIGITAL_READ: 0x01, + DIGITAL_WRITE: 0x02, + ANALOG_READ: 0x03, + ANALOG_WRITE: 0x04, + PIN_MODE: 0x05, + PING_READ: 0x07, + } + }, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.isReading = false; + state.pinMap = { + D2: 2, + D3: 3, + D4: 4, + D5: 5, + D6: 6, + D7: 7, + D8: 8, + A0: 14, + A1: 15, + A2: 16, + }; + + // Override the relevant default "isType" methods + this.isPwm = function(name) { + var number = typeof name === "number" ? name : parseInt(name[1]); + return number === 3 || number === 5 || number === 6; + }; + + this.address = opts.address || this.ADDRESSES[0]; + opts.address = this.address; + + this.io.i2cConfig(opts); + + Object.assign(this.MODES, this.io.MODES); + + var analogChannel; + + for (var i = 0; i < 17; i++) { + analogChannel = 127; + + if (i <= 1 || (i >= 9 && i < 14)) { + // There are no connections for: + // O, 1, 9, 10, 11, 12, 13 + this.pins.push({ + supportedModes: [], + mode: 0, + value: 0, + report: 0, + analogChannel: analogChannel + }); + } else { + + this.pins.push({ + supportedModes: [ + this.MODES.INPUT, + this.MODES.OUTPUT, + ], + mode: 0, + value: 0, + report: 0, + analogChannel: analogChannel + }); + + // Digital pins with PWM Support + // D3, D5, D6 + if (this.isPwm(i)) { + this.pins[i].supportedModes.push( + this.MODES.PWM + ); + } + + if (i >= 14 && i <= 17) { + // A0 = 0 = 14 + // A1 = 1 = 15 + // A2 = 2 = 16 + // + // 14 is the analog offset + this.pins[i].analogChannel = i - 14; + + // Add ANALOG "read" mode + this.pins[i].supportedModes.push( + this.MODES.ANALOG + ); + + this.analogPins.push(i); + + // Default all analog IO pins to + // ANALOG "read" + this.pinMode("A" + this.pins[i].analogChannel, this.MODES.ANALOG); + } else { + // Default all digital IO pins to + // OUTPUT and LOW + this.pinMode("D" + i, this.MODES.OUTPUT); + this.digitalWrite("D" + i, this.LOW); + } + } + } + + this.name = "GROVEPI"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return pin; + } + }, + + pinMode: { + value: function(pin, mode) { + var state = priv.get(this); + var pinIndex = state.pinMap[pin]; + + if (mode === this.io.MODES.INPUT || + mode === this.io.MODES.ANALOG) { + this.pins[pinIndex].mode = 0; + } else { + this.pins[pinIndex].mode = 1; + } + + this.io.i2cWrite( + this.address, [ + this.COMMANDS.PIN_MODE, + pinIndex, + this.pins[pinIndex].mode, + 0 + ] + ); + } + }, + + digitalWrite: { + value: function(pin, value) { + var state = priv.get(this); + var pinIndex = state.pinMap[pin]; + + // Any truthy value is converted to HIGH (1) + value = value ? 1 : 0; + + this.io.i2cWrite( + this.address, [ + this.COMMANDS.DIGITAL_WRITE, + pinIndex, + value, + 0 + ] + ); + + this.pins[pinIndex].value = value; + } + }, + + ioRead: { + value: function(pin, type, callback) { + var state = priv.get(this); + var pinIndex = state.pinMap[pin]; + var isAnalog = type === "analog"; + var length = isAnalog ? 3 : 1; + var command = isAnalog ? this.COMMANDS.ANALOG_READ : this.COMMANDS.DIGITAL_READ; + + this.on(type + "-read-" + pinIndex, callback); + + this.pins[pinIndex].report = 1; + this.pins[pinIndex].command = command; + this.pins[pinIndex].type = type; + this.pins[pinIndex].length = length; + + var nextPinIndex = function() { + var startAt = nextPinIndex.lastPinIndex + 1; + + for (var i = startAt; i < this.pins.length; i++) { + if (this.pins[i].report === 1) { + nextPinIndex.lastPinIndex = i; + return nextPinIndex.lastPinIndex; + } + } + + nextPinIndex.lastPinIndex = -1; + + return nextPinIndex(); + }.bind(this); + + nextPinIndex.lastPinIndex = -1; + + var handler = function(pinIndex, value) { + var pin = this.pins[pinIndex]; + var canEmit = true; + + if (pin.type === "digital" && this.pins[pinIndex].value === value) { + canEmit = false; + } + + this.pins[pinIndex].value = value; + + if (canEmit) { + this.emit(pin.type + "-read-" + pinIndex, value); + } + + setTimeout(read, 1); + }.bind(this); + + var read = function() { + var pinIndex = nextPinIndex(); + var pin = this.pins[pinIndex]; + var isAnalog = pin.type === "analog"; + + this.io.i2cWrite(this.address, [pin.command, pinIndex, 0, 0]); + this.io.i2cReadOnce(this.address, pin.length, function(data) { + var value; + + if (isAnalog) { + value = (data[1] << 8) + data[2]; + } else { + value = data[0]; + } + handler(pinIndex, value); + }.bind(this)); + }.bind(this); + + if (!state.isReading) { + state.isReading = true; + read(); + } + } + }, + + digitalRead: { + value: function(pin, callback) { + this.ioRead(pin, "digital", callback); + }, + }, + analogRead: { + value: function(pin, callback) { + this.ioRead(pin, "analog", callback); + }, + }, + pingRead: { + value: function(settings, callback) { + var state = priv.get(this); + var pinIndex = state.pinMap[settings.pin]; + + this.io.i2cWrite( + this.address, [ + this.COMMANDS.PING_READ, + pinIndex, + 0, 0 + ] + ); + + setTimeout(function() { + this.once("ping-read-" + settings.pin, callback); + + this.io.i2cReadOnce(this.address, 3, function(data) { + // The GrovePi firmware sends this value in CM + // so the value must be converted back to duration. + var value = Math.round(((data[1] << 8) + data[2]) * 29 * 2); + + this.pins[pinIndex].value = value; + this.emit("ping-read-" + settings.pin, value); + }.bind(this)); + }.bind(this), 200); + }, + }, + analogWrite: { + value: function(pin, value) { + this.pwmWrite(pin, value); + } + }, + pwmWrite: { + writable: true, + value: function(pin, value) { + var state = priv.get(this); + var pinIndex = state.pinMap[pin]; + + value = Board.constrain(value, 0, 255); + + this.io.i2cWrite( + this.address, [ + this.COMMANDS.ANALOG_WRITE, + pinIndex, + value, + 0 + ] + ); + + this.pins[pinIndex].value = value; + } + } + }, + "74HC595": { + initialize: { + value: function(opts) { + var state = priv.get(this); + + if (!opts.pins.data) { + throw new Error("Expected pins.data"); + } + + if (!opts.pins.clock) { + throw new Error("Expected pins.clock"); + } + + if (!opts.pins.latch) { + throw new Error("Expected pins.latch"); + } + + state.data = opts.pins.data; + state.clock = opts.pins.clock; + state.latch = opts.pins.latch; + state.value = 0x00; + + Object.assign(this.MODES, this.io.MODES); + + // Reset pins property to empty array. + this.pins = []; + + for (var i = 0; i < 8; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.OUTPUT + ], + mode: 1, + value: 0, + report: 0, + analogChannel: 127 + }); + } + + this.portWrite(0, state.value); + + this.name = "74HC595"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + return pin; + } + }, + pinMode: { + value: function(pin, mode) { + this.pins[pin].mode = mode; + } + }, + digitalWrite: { + value: function(pin, value) { + var state = priv.get(this); + + if (value) { + state.value |= 1 << pin; + } else { + state.value &= ~(1 << pin); + } + + this.pins[pin].value = value; + + this.portWrite(0, state.value); + } + }, + portWrite: { + writable: true, + configurable: true, + value: function(port, value) { + var state = priv.get(this); + + state.value = value; + + this.board.digitalWrite(state.latch, this.io.LOW); + this.board.shiftOut(state.data, state.clock, true, state.value); + this.board.digitalWrite(state.latch, this.io.HIGH); + + for (var i = 0; i < 8; i++) { + this.pins[i].value = (state.value >> i) & 1; + } + } + }, + }, + CD74HC4067: { + /* + | Address 1 (D9) | Address 0 (D8) | Address | + | -------------- | -------------- | ------- | + | 0 | 0 | 0x0A | + | 0 | 1 | 0x0B | + | 1 | 0 | 0x0C | + | 1 | 1 | 0x0D | + */ + ADDRESSES: { + value: [0x0A, 0x0B, 0x0C, 0x0D] + }, + REGISTER: {}, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.reading = false; + + this.address = opts.address || this.ADDRESSES[0]; + + opts.address = this.address; + this.io.i2cConfig(opts); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 16; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.ANALOG + ], + mode: 1, + value: 0, + report: 0, + analogChannel: i + }); + this.analogPins.push(i); + } + + this.name = "CD74HC4067"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + if (typeof pin === "string" && pin[0] === "A") { + return +pin.slice(1); + } + return pin; + } + }, + pinMode: { + value: function(pin, mode) { + this.pins[pin].mode = mode; + } + }, + analogRead: { + value: function(pin, callback) { + var state = priv.get(this); + var pinIndex = pin; + + this.pins[pinIndex].report = 1; + + this.on("analog-read-" + pin, callback); + + this.io.i2cWrite(this.address, pinIndex, 1); + + // Since this operation will read all 4 pins, + // it only needs to be initiated once. + if (!state.reading) { + state.reading = true; + + this.io.i2cRead(this.address, 32, function(data) { + var value; + for (var i = 0; i < 16; i++) { + var index = i * 2; + + value = (data[index] << 8) + data[index + 1]; + + this.pins[i].value = value; + + if (this.pins[i].report) { + this.emit("analog-read-" + i, value); + } + } + }.bind(this)); + } + } + }, + }, + + LIS3DH: { + ADDRESSES: { + value: [0x18] + }, + REGISTER: { + value: { + // Page 26 + // Table 17. Register address map + // + // NAME: BYTE + OUT_ADC1_L: 0x08, + OUT_X_L: 0x28, + CTRL_REG1: 0x20, + CTRL_REG2: 0x21, + CTRL_REG3: 0x22, + CTRL_REG4: 0x23, + CTRL_REG5: 0x24, + + TEMP_CFG_REG: 0x1F, + }, + }, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.reading = false; + + this.address = opts.address || this.ADDRESSES[0]; + + opts.address = this.address; + + this.io.i2cConfig(opts); + + + // Page 29 + // 8.8 CTRL_REG1 + // Table 24. CTRL_REG1 register + // + // ODR3 ODR2 ODR1 ODR0 LPen Zen Yen Xen + // + // + // Enable Axis + // 0b00000111 + // ZYX + // + var ctrl1 = 0x07; // 0b00000111 + // + // Date Rate + // Table 26. Data rate configuration + // + // ODR3 ODR2 ODR1 ODR0 Power mode selection + // 0 0 0 1 = 1 Hz + // 0 0 1 0 = 10 Hz + // 0 0 1 1 = 25 Hz + // 0 1 0 0 = 50 Hz + // 0 1 0 1 = 100 Hz + // 0 1 1 0 = 200 Hz + // 0 1 1 1 = 400 Hz + // + // 0b0111 << 4 = 0b01110000 + // + ctrl1 = (ctrl1 & ~(0xF0)) | (0x07 << 4); + + // ctrl1 = 0b01110111 + // 0b01110000 = 0x70 = 112 + this.io.i2cWrite(this.address, this.REGISTER.CTRL_REG1, ctrl1); + + // Page 31 + // 8.11 CTRL_REG4 + // + // Table 32. CTRL_REG4 register + // + // BDU BLE FS1 FS0 HR ST1 ST0 SIM + // + // BDU Block data update. Default value: 0 + // 0: Continuous update + // 1: Updated when MSB and LSB read + // + // HR High resolution output mode: Default value: 0 + // 0: Disable + // 1: Enable + // + // Setting BDU and HR: + // 0b1---1--- + // + // 0b10001000 = 0x88 = 136 + // + this.io.i2cWrite(this.address, this.REGISTER.CTRL_REG4, 0x88); + // + // Page 31 + // 8.10 CTRL_REG3 + // + // I1_DRDY1 -> ON + // + // 0b00010000 = 0x10 = 16 + this.io.i2cWrite(this.address, this.REGISTER.CTRL_REG3, 0x10); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 4; i++) { + if (i === 0) { + this.pins.push({ + supportedModes: [], + mode: 0, + value: 0, + report: 0, + analogChannel: 0x7F + }); + } else { + this.pins.push({ + supportedModes: [ this.MODES.ANALOG ], + mode: 1, + value: 0, + report: 0, + analogChannel: i + }); + this.analogPins.push(i); + } + } + + this.name = "LIS3DH"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + }, + }, + normalize: { + value: function(pin) { + if (typeof pin === "string" && pin[0] === "A") { + return +pin.slice(1); + } + return pin; + }, + }, + pinMode: { + value: function(pin, mode) { + this.pins[pin].mode = mode; + }, + }, + analogRead: { + value: function(pin, callback) { + var state = priv.get(this); + var pinIndex = pin; + + this.pins[pinIndex].report = 1; + + this.on("analog-read-" + pin, callback); + + // Since this operation will read all 3 ADC pins, + // it only needs to be initiated once. + if (!state.reading) { + state.reading = true; + + // Page 29 + // 8.7 TEMP_CFG_REG (1Fh) + // Table 23. TEMP_CFG_REG description + // + // ADC_PD TEMP_EN 0 0 0 0 0 0 + // + // 0b10000000 = 128 = 0x80 + // + this.io.i2cWrite(this.address, this.REGISTER.TEMP_CFG_REG, 0x80); + + // Page 23, 24, 25 + // bit 1: MS bit. When 0, the address remains unchanged in multiple read/write commands. + // When 1, the address is auto incremented in multiple read/write commands. + this.io.i2cRead(this.address, this.REGISTER.OUT_ADC1_L | 0x80, 6, function(data) { + // V range is 900 + + // First, scale the value to range that these ADCs support, which is + // + // 1.8V - 0.9V + // + // Then, scale that value to the full 10-bit 0-3.3V range + // + this.pins[1].value = Fn.scale(Fn.int16(data[1], data[0]), -32512, 32512, 1023, 0); + this.pins[2].value = Fn.scale(Fn.int16(data[3], data[2]), -32512, 32512, 1023, 0); + this.pins[3].value = Fn.scale(Fn.int16(data[5], data[4]), -32512, 32512, 1023, 0); + + for (var i = 1; i < 4; i++) { + if (this.pins[i].report) { + this.emit("analog-read-" + i, this.pins[i].value); + } + } + }.bind(this)); + } + }, + }, + i2cConfig: { + value: function() { + return this.io.i2cConfig.apply(this.io, arguments); + }, + }, + i2cWrite: { + value: function() { + return this.io.i2cWrite.apply(this.io, arguments); + }, + }, + i2cWriteReg: { + value: function() { + return this.io.i2cWriteReg.apply(this.io, arguments); + }, + }, + i2cRead: { + value: function() { + return this.io.i2cRead.apply(this.io, arguments); + }, + }, + i2cReadOnce: { + value: function() { + return this.io.i2cReadOnce.apply(this.io, arguments); + }, + }, + }, + + ADS1115: { + ADDRESSES: { + value: [0x48, 0x49, 0x4A, 0x4B] + }, + REGISTER: { + value: { + CONFIG: 0x01, + READ: 0x00, + PIN: [0xC1, 0xD1, 0xE1, 0xF1], + PIN_DATA: 0x83, + } + }, + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.reading = false; + + this.address = opts.address || this.ADDRESSES[0]; + + opts.address = this.address; + this.io.i2cConfig(opts); + + Object.assign(this.MODES, this.io.MODES); + + for (var i = 0; i < 4; i++) { + this.pins.push({ + supportedModes: [ + this.MODES.ANALOG + ], + mode: 1, + value: 0, + report: 0, + analogChannel: i + }); + this.analogPins.push(i); + } + + this.name = "ADS1115"; + this.isReady = true; + + this.emit("connect"); + this.emit("ready"); + } + }, + normalize: { + value: function(pin) { + if (typeof pin === "string" && pin[0] === "A") { + return +pin.slice(1); + } + return pin; + } + }, + pinMode: { + value: function(pin, mode) { + this.pins[pin].mode = mode; + } + }, + analogRead: { + value: function(pin, callback) { + var state = priv.get(this); + this.pins[pin].report = 1; + + var ready = false; + + this.on("analog-read-" + pin, callback); + + // Since this operation will read all 4 pins, + // it only needs to be initiated once. + if (!state.reading) { + state.reading = true; + + // CONVERSION DELAY + var delay = function () { + setTimeout(function () { + ready = true; + }, 8); + }; + + this.io.i2cWrite(this.address, this.REGISTER.CONFIG, [this.REGISTER.PIN[pin], this.REGISTER.PIN_DATA]); + delay(); + + this.io.i2cRead(this.address, this.REGISTER.READ, 2, function(data) { + if (ready) { + ready = false; + + var newPin = pin === this.pins.length - 1 ? 0 : pin + 1; + + this.io.i2cWrite(this.address, this.REGISTER.CONFIG, [this.REGISTER.PIN[newPin], this.REGISTER.PIN_DATA]); + + var value = (data[0] << 8) + data[1]; + this.pins[pin].value = value; + + if (this.pins[pin].report) { + this.emit("analog-read-" + pin, value); + } + + pin = newPin; + + delay(); + } + }.bind(this)); + } + } + }, + } +}; + +Controllers["CD74HCT4067"] = Controllers.CD74HC4067; +Controllers["74HC4067"] = Controllers.CD74HC4067; + +Controllers.PCF8574A = Object.assign({}, Controllers.PCF8574, { + ADDRESSES: { + value: [0x38] + } +}); + +var methods = Object.keys(Board.prototype); + +Object.keys(Controllers).forEach(function(name) { + methods.forEach(function(key) { + if (Controllers[name][key] === undefined) { + Controllers[name][key] = { + writable: true, + configurable: true, + value: function() { + throw new Error("Expander:" + name + " does not support " + key); + } + }; + } + }); +}); + +var nonAddressable = [ + "74HC595" +]; + +function Expander(opts) { + if (!(this instanceof Expander)) { + return new Expander(opts); + } + + Base.call(this); + + var expander = null; + var addressError = "Expander cannot reuse an active address"; + var controller = null; + var state = {}; + var controllerValue; + + if (typeof opts === "string") { + controllerValue = opts; + } + + Board.Component.call( + this, opts = Board.Options(opts), { + normalizePin: false, + requestPin: false + } + ); + + if (nonAddressable.includes(opts.controller) && + typeof this.address === "undefined") { + this.address = Fn.uid(); + } + + expander = active.get(this.address); + + if (expander) { + if (this.bus && (expander.bus !== undefined && expander.bus === this.bus)) { + addressError += " on this bus"; + } + throw new Error(addressError); + } + + if (typeof opts.controller === "undefined" && controllerValue) { + opts.controller = controllerValue; + } + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + throw new Error("Expander expects a valid controller"); + } + + Board.Controller.call(this, controller, opts); + + priv.set(this, state); + + if (typeof this.initialize === "function") { + this.initialize(opts); + } + + active.set(this.address, this); +} + +util.inherits(Expander, Base); + + +Expander.get = function(required) { + + if (!required.address || !required.controller) { + throw new Error("Expander.get(...) requires an address and controller"); + } + + if (required.address !== undefined) { + required.address = Number(required.address); + } + + if (Number.isNaN(required.address)) { + throw new Error("Expander.get(...) expects address to be a number"); + } + + if (typeof required.controller !== "string") { + throw new Error("Expander.get(...) expects controller name to be a string"); + } + + // If no address was sent them assume the request wants + // to re-use an active Expander, by controller name. + // if (!required.address) { + // return Expander.byController(required.controller); + // } + + var expander = active.get(required.address); + + if (expander && (expander.name === required.controller.toUpperCase())) { + return expander; + } + + return new Expander(required); +}; + +Expander.byAddress = function(address) { + return active.get(address); +}; + +Expander.byController = function(name) { + var controller = null; + + active.forEach(function(value) { + if (value.name === name.toUpperCase()) { + controller = value; + } + }); + return controller; +}; + +Expander.hasController = function(key) { + return Controllers[key] !== undefined; +}; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Expander.Controllers = Controllers; + Expander.purge = function() { + priv.clear(); + active.clear(); + }; +} + +module.exports = Expander; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/fn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/fn.js new file mode 100644 index 00000000..d50dd73c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/fn.js @@ -0,0 +1,514 @@ +var Fn = { + debounce: require("lodash.debounce"), + cloneDeep: require("lodash.clonedeep"), +}; + +/** + * Format a number such that it has a given number of digits after the + * decimal point. + * + * @param {Number} number - The number to format + * @param {Number} [digits = 0] - The number of digits after the decimal point + * @return {Number} Formatted number + * @example + * Fn.toFixed(5.4564, 2); // -> 5.46 + * @example + * Fn.toFixed(1.5, 2); // -> 1.5 + */ +Fn.toFixed = function(number, digits) { + // Guard against error when number is null or undefined + // Cast result as number + return +(number || 0).toFixed(digits); +}; + + +/** + * Map a value (number) from one range to another. Based on Arduino's map(). + * + * @param {Number} value - value to map + * @param {Number} fromLow - low end of originating range + * @param {Number} fromHigh - high end of originating range + * @param {Number} toLow - low end of target range + * @param {Number} toHigh - high end of target range + * @return {Number} mapped value (integer) + * @example + * Fn.map(500, 0, 1000, 0, 255); // -> + */ + +Fn.map = function(value, fromLow, fromHigh, toLow, toHigh) { + return ((value - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow) | 0; +}; +// Alias +Fn.scale = Fn.map; + +/** + * Like map, but returns a Float32 + * + * For @param info, @see Fn.map + * @return {Float32} + */ +var f32A = new Float32Array(1); + +Fn.fmap = function(value, fromLow, fromHigh, toLow, toHigh) { + f32A[0] = (value - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow; + return f32A[0]; +}; +// Alias +Fn.fscale = Fn.fmap; + +/** + * Constrains a number to be within a range. Based on Arduino's constrain() + * + * @param {Number} value + * @param {Number} lower - lower bound of range for constraint + * @param {Number} upper - upper bound of range for constraint + * @return {Number | NaN} constrained number or NaN if any of the provided + * parameters are not a {Number}. + */ +Fn.constrain = function(value, lower, upper) { + return Math.min(upper, Math.max(lower, value)); +}; + +/** + * Is value between the bounds of lower and upper? + * + * @param {Number} value + * @param {Number} lower - Lower end of bounds to check + * @param {Number} upper - Upper ends of bounds to check + * @return {Boolean} + */ +Fn.inRange = function(value, lower, upper) { + return value >= lower && value <= upper; +}; + +/** + * Generate an Array of Numbers with values between lower and upper; the + * step (increment/decrement) between each defined by tick. + * + * @param {Number} lower - The value of the lowest element in the resulting + * Array. If `Fn.range` invoked with only one + * argument, this parameter will instead define the + * length of the Array, which will start from 0. + * @param {Number} upper - The value of the final element of the Array. + * @param {Number} [tick = 1] - The difference between each element in the + * Array. This value may be negative. + * @return {Array} of {Numbers} + * + * @example + * Fn.range(5, 10); // -> [5, 6, 7, 8, 9, 10]; + * @example + * Fn.range(5); // -> [0, 1, 2, 3, 4]; + * @example + * Fn.range(3, 27, 3); // -> [3, 6, 9, 12, 15, 18, 21, 24, 27]; + * @example + * Fn.range(0, -9, -3); // -> [0, -3, -6, -9]; + */ +Fn.range = function(lower, upper, tick) { + + if (arguments.length === 1) { + upper = lower - 1; + lower = 0; + } + + lower = lower || 0; + upper = upper || 0; + tick = tick || 1; + + var len = Math.max(Math.ceil((upper - lower) / tick), 0), + idx = 0, + range = []; + + while (idx <= len) { + range[idx++] = lower; + lower += tick; + } + + return range; +}; + +/** + * Adds prefix to each element in the range Array returned by Fn.range. + * + * Fn.range.prefixed( prefix, upper ) + * Fn.range.prefixed( prefix, lower, upper ) + * Fn.range.prefixed( prefix, lower, upper, tick ) + * + * @param {*} prefix - You probably want to use a string, but you don't have to. + * @return Array per range parameters, each element prefixed. + * @see Fn.range + * @example + * Fn.range.prefixed("A", 0, 10, 2); // -> ["A0", "A2", "A4", "A6", "A8", "A10"] + */ +Fn.range.prefixed = function(prefix) { + return Fn.range.apply(null, [].slice.call(arguments, 1)).map(function(val) { + return prefix + val; + }); +}; + +/** + * Generate a reasonably-unique ID string + * + * @return {String} - 36-character random-ish string + */ +Fn.uid = function() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(chr) { + var rnd = Math.random() * 16 | 0; + return (chr === "x" ? rnd : (rnd & 0x3 | 0x8)).toString(16); + }).toUpperCase(); +}; + + +/** + * Square your x! + * + * @param {Number} x + * @return {Number| Nan} - x^2—unless you were goofy enough to provide a + * non-numeric x, in which case it's NaN for you! + */ +Fn.square = function(x) { + return x * x; +}; + +/** + * Get a sum for all the values in an Array. This works best if the elements + * in the Array are Numbers. + * + * @param {Array} values + * @return {Number | String} - You probably want a Number so you'll want to + * pass a values Array entirely consisting of + * numeric elements. + */ +Fn.sum = function sum(values) { + var vals; + if (Array.isArray(values)) { + vals = values; + } else { + vals = [].slice.call(arguments); + } + return vals.reduce(function(accum, value) { + return accum + value; + }, 0); +}; + +/** + * Fused multiply-add for precise floating-point calculations. + */ +// fma function +// Copyright (c) 2012, Jens Nockert +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +Fn.fma = function(a, b, c) { + var aHigh = 134217729 * a; + var aLow; + + aHigh = aHigh + (a - aHigh); + aLow = a - aHigh; + + var bHigh = 134217729 * b; + var bLow; + + bHigh = bHigh + (b - bHigh); + bLow = b - bHigh; + + var r1 = a * b; + var r2 = -r1 + aHigh * bHigh + aHigh * bLow + aLow * bHigh + aLow * bLow; + + var s = r1 + c; + var t = (r1 - (s - c)) + (c - (s - r1)); + + return s + (t + r2); +}; +// end fma function copyright + +/** + * Return a value with the bit at the position indicated set (to 1). + * From avr/io.h "BV" => Bit Value + * + * An example: logically OR these bits together: + * var ORed = _BV(0) | _BV(2) | _BV(7); + * + * BIT 7 6 5 4 3 2 1 0 + * --------------------------------------------------------- + * _BV(0) = 0 0 0 0 0 0 0 1 + * _BV(2) = 0 0 0 0 0 1 0 0 + * _BV(7) = 1 0 0 0 0 0 0 0 + * ORed = 1 0 0 0 0 1 0 1 + * + * ORed === 133; + * + * @param {Number} bit - bit position to set + * @return {Number} + * @example + * Fn.bitValue(0); // --> 1 + * @example + * Fn.bitValue(4); // --> 16 + * + */ +Fn._BV = Fn.bitValue = Fn.bv = function(bit) { + return 1 << bit; +}; + +/** + * int16 Combine two bytes to make an signed 16-bit integer + * @param {byte} msb Most signifcant byte + * @param {byte} lsb Least signifcant byte + * @return {word} Signed 16-bit integer + */ +Fn.int16 = function(msb, lsb) { + var result = (msb << 8) | lsb; + + // Check highest bit for sign. If on, value is negative + return result >> 15 ? ((result ^ 0xFFFF) + 1) * -1 : result; +}; + +/** + * uint16 Combine two bytes to make an unsigned 16-bit integer + * @param {byte} msb Most signifcant byte + * @param {byte} lsb Least signifcant byte + * @return {word} unsigned 16-bit integer + */ +Fn.uint16 = function(msb, lsb) { + return (msb << 8) | lsb; +}; + +/** + * int24 Combine three bytes to make a signed 24-bit integer + * @param {byte} b16 b[16:23] + * @param {byte} b8 b[8:15] + * @param {byte} b0 b[0:7] + * @return {word} Signed 24-bit integer + */ +Fn.int24 = function(b16, b8, b0) { + var result = (b16 << 16) | (b8 << 8) | b0; + + // Check highest bit for sign. If on, value is negative + return result >> 23 ? ((result ^ 0xFFFFFF) + 1) * -1 : result; +}; + +/** + * uint24 Combine three bytes to make an unsigned 24-bit integer + * @param {byte} b16 b[16:23] + * @param {byte} b8 b[8:15] + * @param {byte} b0 b[0:7] + * @return {word} Unsigned 24-bit integer + */ +Fn.uint24 = function(b16, b8, b0) { + return (b16 << 16) | (b8 << 8) | b0; +}; + +/** + * int32 Combine four bytes to make a signed 24-bit integer + * @param {byte} b24 b[24:31] + * @param {byte} b16 b[16:23] + * @param {byte} b8 b[8:15] + * @param {byte} b0 b[0:7] + * @return {word} Signed 32-bit integer + */ +Fn.int32 = function(b24, b16, b8, b0) { + var result = (b24 << 24) | (b16 << 16) | (b8 << 8) | b0; + // Check highest bit for sign. If on, value is negative + return result >> 31 ? ((result ^ 0xFFFFFFFF) + 1) * -1 : result; +}; + +/** + * int32 Combine four bytes to make an unsigned 32-bit integer + * @param {byte} b24 b[24:31] + * @param {byte} b16 b[16:23] + * @param {byte} b8 b[8:15] + * @param {byte} b0 b[0:7] + * @return {Number} unsigned 32-bit integer + */ +Fn.uint32 = function(b24, b16, b8, b0) { + // Note: If you left-shift a byte by 24 in JS and that byte's + // MSbit is 1, the resulting value will be negative because JS casts + // bitwise operands (temporarily) to SIGNED 32-bit numbers. The + // final >>> 0 causes the sign bit to be disregarded, making sure our + // result is non-negative. + return ((b24 << 24) | (b16 << 16) | (b8 << 8) | b0) >>> 0; +}; + +/** + * bitSize Get the number of bits in a given number + * @param {number} n The number to evaluate + * @return {number} The bit count + */ +Fn.bitSize = function(n) { + return Math.round(Math.log2(n)); +}; + +/** + * The following generates functions and constants for utility when working + * with binary numbers: + * - Fn.POW_2_0 through Fn.POW_2_53 + * - Fn.u4(value) through Fn.u32(value) + * - Fn.s4(value) through Fn.s32(value) + */ +var POW = "POW_2_"; +var U = "u"; +var S = "s"; +var MAX = Fn.bitSize(Number.MAX_SAFE_INTEGER) + 1; +var bitSizes = [ 4, 8, 10, 12, 16, 20, 24, 32 ]; + +/** + * Generate "constants" that represent powers of 2. Available for powers + * 0 through 53. + * @example + * Fn.POW_2_17; // -> 131072 + */ +for (var i = 0; i < MAX; i++) { + Fn[POW + i] = Math.pow(2, i); +} + +bitSizes.forEach(function(bitSize) { + var decimal = Fn[POW + bitSize]; + var half = decimal / 2 >>> 0; + var halfMinusOne = half - 1; + + /** + * The function Fn["u" + bitSize] will constrain a value to an unsigned + * value of that bit size. + * + * @param {Number} value + * @return {Number} constrained to an unsigned int + * @example + * Fn.u8(255); // --> 255 + * Fn.u8(256); // --> 255 + * Fn.u8(-255); // --> 0 + * Fn.u8(-254); // -- 1 + */ + Fn[U + bitSize] = function(value) { + if (value < 0) { + value += decimal; + } + return Fn.constrain(value, 0, decimal - 1); + }; + + /** + * The function Fn["s" + bitSize] will constrain a value to a signed value + * of that bit size. Remember that, e.g., range for signed 8-bit numbers + * is -128 to 127. + * + * @param {Number} value + * @return {Number} constrained to a SIGNED integer in bitsize range + * @example + * Fn.s8(100); // --> 100 + * Fn.s8(128); // --> -128 + * Fn.s8(127); // --> 127 + * Fn.s8(255); // --> -1 + */ + Fn[S + bitSize] = function(value) { + if (value > halfMinusOne) { + value -= decimal; + } + return Fn.constrain(value, -half, halfMinusOne); + }; +}); +/* + Fn.POW_2_0 => 1 + Fn.POW_2_1 => 2 + Fn.POW_2_2 => 4 + Fn.POW_2_3 => 8 + Fn.POW_2_4 => 16 + Fn.POW_2_5 => 32 + Fn.POW_2_6 => 64 + Fn.POW_2_7 => 128 + Fn.POW_2_8 => 256 + Fn.POW_2_9 => 512 + Fn.POW_2_10 => 1024 + Fn.POW_2_11 => 2048 + Fn.POW_2_12 => 4096 + Fn.POW_2_13 => 8192 + Fn.POW_2_14 => 16384 + Fn.POW_2_15 => 32768 + Fn.POW_2_16 => 65536 + Fn.POW_2_17 => 131072 + Fn.POW_2_18 => 262144 + Fn.POW_2_19 => 524288 + Fn.POW_2_20 => 1048576 + Fn.POW_2_21 => 2097152 + Fn.POW_2_22 => 4194304 + Fn.POW_2_23 => 8388608 + Fn.POW_2_24 => 16777216 + Fn.POW_2_25 => 33554432 + Fn.POW_2_26 => 67108864 + Fn.POW_2_27 => 134217728 + Fn.POW_2_28 => 268435456 + Fn.POW_2_29 => 536870912 + Fn.POW_2_30 => 1073741824 + Fn.POW_2_31 => 2147483648 + Fn.POW_2_32 => 4294967296 + Fn.POW_2_33 => 8589934592 + Fn.POW_2_34 => 17179869184 + Fn.POW_2_35 => 34359738368 + Fn.POW_2_36 => 68719476736 + Fn.POW_2_37 => 137438953472 + Fn.POW_2_38 => 274877906944 + Fn.POW_2_39 => 549755813888 + Fn.POW_2_40 => 1099511627776 + Fn.POW_2_41 => 2199023255552 + Fn.POW_2_42 => 4398046511104 + Fn.POW_2_43 => 8796093022208 + Fn.POW_2_44 => 17592186044416 + Fn.POW_2_45 => 35184372088832 + Fn.POW_2_46 => 70368744177664 + Fn.POW_2_47 => 140737488355328 + Fn.POW_2_48 => 281474976710656 + Fn.POW_2_49 => 562949953421312 + Fn.POW_2_50 => 1125899906842624 + Fn.POW_2_51 => 2251799813685248 + Fn.POW_2_52 => 4503599627370496 + Fn.POW_2_53 => 9007199254740992 + + Fn.u4(value) => 4-bit Unsigned Integer + Fn.s4(value) => 4-bit Signed Integer + + Fn.u8(value) => 8-bit Unsigned Integer + Fn.s8(value) => 8-bit Signed Integer + + Fn.u10(value) => 10-bit Unsigned Integer + Fn.s10(value) => 10-bit Signed Integer + + Fn.u12(value) => 12-bit Unsigned Integer + Fn.s12(value) => 12-bit Signed Integer + + Fn.u16(value) => 16-bit Unsigned Integer + Fn.s16(value) => 16-bit Signed Integer + + Fn.u20(value) => 20-bit Unsigned Integer + Fn.s20(value) => 20-bit Signed Integer + + Fn.u24(value) => 24-bit Unsigned Integer + Fn.s24(value) => 24-bit Signed Integer + + Fn.u32(value) => 32-bit Unsigned Integer + Fn.s32(value) => 32-bit Signed Integer + +} +*/ + +Fn.RAD_TO_DEG = 180 / Math.PI; +Fn.DEG_TO_RAD = Math.PI / 180; +Fn.TAU = 2 * Math.PI; + +module.exports = Fn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gps.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gps.js new file mode 100644 index 00000000..eaeb95d0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gps.js @@ -0,0 +1,482 @@ +var events = require("events"); +var util = require("util"); + +var Board = require("./board"); +var Fn = require("./fn"); +var Pin = require("./pin"); + +var toFixed = Fn.toFixed; + + +var priv = new Map(); + +var Breakouts = { + + /* + * https://www.adafruit.com/products/746 + */ + ADAFRUIT_ULTIMATE_GPS: { + receiver: { + value: "FGPMMOPA6H" + } + } + +}; + +// GPS Antenna Modules +var Receivers = { + + /* + * http://www.gtop-tech.com/en/product/LadyBird-1-PA6H/MT3339_GPS_Module_04.html + */ + FGPMMOPA6H: { + // Later, when we add logging that code will go here + chip: { + value: "MT3339" + } + } + +}; + +// GPS chips +var Chips = { + + DEFAULT: { + baud: { + value: 9600, + writable: true + }, + configure: { + value: function(callback) { + process.nextTick(callback); + } + } + }, + + /* + * http://www.mediatek.com/en/products/connectivity/gps/mt3339/ + */ + MT3339: { + baud: { + value: 9600, + writable: true + }, + configure: { + value: function(callback) { + process.nextTick(callback); + } + }, + frequency: { + get: function() { + var state = priv.get(this); + return state.frequency; + }, + set: function(frequency) { + var state = priv.get(this); + + // Enforce maximum frequency of 10hz + if (frequency < 10) { + frequency = 10; + } + + state.frequency = frequency; + this.sendCommand("$PMTK220," + String(1000 / state.frequency)); + } + }, + restart: { + // Reboot the receiver + value: function(coldRestart) { + + if (coldRestart === true) { + this.sendCommand("$PMTK103"); + } else { + this.sendCommand("$PMTK101"); + setTimeout(function() { + this.sendCommand(""); + }.bind(this), 1000); + } + + } + } + } + +}; + + +/** + * + * @constructor + * + * @param {Object} opts Options: pin(s), chip, receiver, breakout, fixed, serialport, frequency + * + * Sample initialization + * + * new five.GPS({ pins: {rx: 10, tx: 11}); + * + */ + +function GPS(opts) { + + var breakout, receiver, chip, state; + + if (!(this instanceof GPS)) { + return new GPS(opts); + } + + // Allow users to pass in a 2 element array for rx and tx pins + if (Array.isArray(opts)) { + opts = { + pins: { + rx: opts[0], + tx: opts[1], + onOff: opts[2] + } + }; + } + + if (typeof opts.pins === "undefined") { + opts.pins = {}; + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + // Get user values for breakout, receiver and chip + breakout = opts.breakout || {}; + receiver = opts.receiver; + chip = opts.chip; + + // If a breakout is defined check for receiver and chip + if (Breakouts[breakout]) { + if (!receiver && Breakouts[breakout].receiver) { + receiver = Breakouts[breakout].receiver.value; + } + + if (!chip && Breakouts[breakout].chip) { + chip = Breakouts[breakout].chip.value; + } + } + + // If a receiver was defined or derived but chip was not + if (!chip) { + if (receiver && Receivers[receiver].chip) { + chip = Receivers[receiver].chip.value; + } else { + chip = "DEFAULT"; + } + } + + // Allow users to pass in custom chip types + chip = typeof chip === "string" ? + Chips[chip] : opts.chip; + + // Allow users to pass in custom receiver types + receiver = typeof receiver === "string" ? + Receivers[receiver] : opts.receiver; + + // Chip decorates the instance + Object.defineProperties(this, chip); + + // Receiver decorates this instance + if (receiver) { + Object.defineProperties(this, receiver); + } + + // breakout decorates the instance + if (opts.breakout) { + breakout = typeof opts.breakout === "string" ? + Breakouts[opts.breakout] : opts.breakout; + + Board.Controller.call(this, breakout, opts); + } + + // If necessary set default property values + this.fixed = opts.fixed || 6; + this.baud = opts.baud || this.baud; + + // Create a "state" entry for privately + // storing the state of the instance + state = { + sat: {}, + latitude: 0.0, + longitude: 0.0, + altitude: 0.0, + speed: 0.0, + course: 0.0, + frequency: 1, + lowPowerMode: false + }; + + priv.set(this, state); + + // Getters for private state values + Object.defineProperties(this, { + latitude: { + get: function() { + return state.latitude; + } + }, + longitude: { + get: function() { + return state.longitude; + } + }, + altitude: { + get: function() { + return state.altitude; + } + }, + sat: { + get: function() { + return state.sat; + } + }, + speed: { + get: function() { + return state.speed; + } + }, + course: { + get: function() { + return state.course; + } + }, + time: { + get: function() { + return state.time; + } + } + }); + + if (this.initialize) { + this.initialize(opts); + } + +} + +util.inherits(GPS, events.EventEmitter); + +/* + * Default intialization for serial GPS + */ +GPS.prototype.initialize = function(opts) { + + var state = priv.get(this); + state.portId = opts.serialPort || opts.portId || opts.port || opts.bus; + + // firmata.js has a SERIAL_PORT_IDs.DEFAULT that is not + // necessary in other IO plugins so it won't always exist. + if (typeof state.portId === "undefined" && this.io.SERIAL_PORT_IDs) { + state.portId = this.io.SERIAL_PORT_IDs.DEFAULT; + } + + // Set the pin modes + ["tx", "rx"].forEach(function(pin) { + if (this.pins[pin]) { + this.io.pinMode(this.pins[pin], this.io.MODES.SERIAL); + } + }, this); + + if (this.pins.onOff) { + this.io.pinMode(this.pins.onOff, this.io.MODES.OUTPUT); + this.onOff = new Pin(this.pins.onOff); + } + + this.io.serialConfig({ + portId: state.portId, + baud: this.baud, + rxPin: this.pins.rx, + txPin: this.pins.tx + }); + + if (this.configure) { + this.configure(function() { + this.listen(); + if (opts.frequency) { + this.frequency = opts.frequency; + } + }.bind(this)); + } + +}; + +GPS.prototype.sendCommand = function(string) { + + var state = priv.get(this); + var cc = []; + + // Convert the string to a charCode array + for (var i = 0; i < string.length; ++i) { + cc[i] = string.charCodeAt(i); + } + + // Append *, checksum and cr/lf + var hexsum = getNmeaChecksum(string.substring(1)); + cc.push(42, hexsum.charCodeAt(0), hexsum.charCodeAt(1), 13, 10); + + this.io.serialWrite(state.portId, cc); +}; + +GPS.prototype.listen = function() { + + var state = priv.get(this); + var input = ""; + + // Start the read loop + this.io.serialRead(state.portId, function(data) { + + input += new Buffer(data).toString("ascii"); + var sentences = input.split("\r\n"); + + if (sentences.length > 1) { + for (var i = 0; i < sentences.length - 1; i++) { + this.parseNmeaSentence(sentences[i]); + } + input = sentences[sentences.length - 1]; + } + }.bind(this)); +}; + +/* + * NMEA Sentence Information + * http://aprs.gids.nl/nmea + */ +GPS.prototype.parseNmeaSentence = function(sentence) { + + var state = priv.get(this); + var cksum = sentence.split("*"); + + // Check for valid sentence + if (cksum[1] !== getNmeaChecksum(cksum[0].substring(1))) { + return; + } + + this.emit("sentence", sentence); + + var segments = cksum[0].split(","); + var last = { + latitude: state.latitude, + longitude: state.longitude, + altitude: state.altitude, + speed: state.speed, + course: state.course + }; + + switch (segments[0]) { + case "$GPGGA": + // Time, position and fix related data + state.time = segments[1]; + state.latitude = degToDec(segments[2], 2, segments[3], this.fixed); + state.longitude = degToDec(segments[4], 3, segments[5], this.fixed); + state.altitude = Number(segments[9]); + break; + + case "$GPGSA": + // Operating details + state.sat.satellites = segments.slice(3, 15); + state.sat.pdop = Number(segments[15]); + state.sat.hdop = Number(segments[16]); + state.sat.vdop = Number(segments[17]); + this.emit("operations", sentence); + break; + + case "$GPRMC": + // GPS & Transit data + state.time = segments[1]; + state.latitude = degToDec(segments[3], 2, segments[4], this.fixed); + state.longitude = degToDec(segments[5], 3, segments[6], this.fixed); + state.course = Number(segments[8]); + state.speed = toFixed(segments[7] * 0.514444, this.fixed); + break; + + case "$GPVTG": + // Track Made Good and Ground Speed + state.course = Number(segments[1]); + state.speed = toFixed(segments[5] * 0.514444, this.fixed); + break; + + case "$GPGSV": + // Satellites in view + break; + + case "$PGACK": + // Acknowledge command + this.emit("acknowledge", sentence); + break; + + default: + this.emit("unknown", sentence); + break; + } + + this.emit("data", { + latitude: state.latitude, + longitude: state.longitude, + altitude: state.altitude, + speed: state.speed, + course: state.course, + sat: state.sat, + time: state.time + }); + + if (last.latitude !== state.latitude || + last.longitude !== state.longitude || + last.altitude !== state.altitude) { + + this.emit("change", { + latitude: state.latitude, + longitude: state.longitude, + altitude: state.altitude + }); + } + + if (last.speed !== state.speed || + last.course !== state.course) { + + this.emit("navigation", { + speed: state.speed, + course: state.course + }); + } + +}; + +// Convert Lat or Lng to decimal degrees +function degToDec(degrees, intDigitsLength, cardinal, fixed) { + if (degrees) { + var decimal = Number(degrees.substring(0, intDigitsLength)) + Number(degrees.substring(intDigitsLength)) / 60; + + if (cardinal === "S" || cardinal === "W") { + decimal *= -1; + } + return Number(decimal.toFixed(fixed)); + } else { + return 0; + } +} + +function getNmeaChecksum(string) { + var cksum = 0x00; + for (var i = 0; i < string.length; ++i) { + cksum ^= string.charCodeAt(i); + } + cksum = cksum.toString(16).toUpperCase(); + + if (cksum.length < 2) { + cksum = ("00" + cksum).slice(-2); + } + + return cksum; +} + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + GPS.Breakouts = Breakouts; + GPS.Chips = Chips; + GPS.Receivers = Receivers; + GPS.purge = function() { + priv.clear(); + }; +} +module.exports = GPS; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gripper.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gripper.js new file mode 100644 index 00000000..165d9922 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gripper.js @@ -0,0 +1,95 @@ +var Servo = require("./servo"), + __ = require("./fn"); + +/** + * Gripper + * + * Supports: + * [Parallax Boe-Bot gripper](http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/GripperManual-v3.0.pdf) + * + * [DFRobot LG-NS](http://www.dfrobot.com/index.php?route=product/product&filter_name=gripper&product_id=628#.UCvGymNST_k) + * + * + * @param {[type]} servo [description] + */ + +function Gripper(opts) { + + if (!(this instanceof Gripper)) { + return new Gripper(opts); + } + + // Default options mode, assume only when opts is a pin number + if (typeof opts === "number") { + opts = { + servo: { + pin: opts, + range: [0, 180] + }, + scale: [0, 10] + }; + } + + // Default set() args to 0-10 + this.scale = opts.scale || [0, 10]; + + // Setup servo + // Allows pre-constructed servo or creating new servo. + // Defaults for new Servo creation fall back to Servo defaults + this.servo = opts.servo instanceof Servo ? + opts.servo : new Servo(opts.servo); +} + +[ + /** + * open Open the gripper + * + * @return {Object} this + */ + { + name: "open", + args: function() { + return this.servo.range[0]; + } + }, + /** + * close Close the gripper + * + * @return {Object} this + */ + { + name: "close", + args: function() { + return this.servo.range[1]; + } + }, + /** + * set Set the gripper's open width + * + * @param {Number} 0-10, 0 is closed, 10 is open + * + * @return {Object} this + */ + { + name: "set", + args: function(position) { + // Map/Scale position value to a value within + // the servo's lo/hi range + return Math.floor( + __.map( + position, + this.scale[0], this.scale[1], + this.servo.range[1], this.servo.range[0] + ) + ); + } + } +].forEach(function(api) { + Gripper.prototype[api.name] = function() { + return this.servo.to( + api.args.apply(this, [].slice.call(arguments)) + ); + }; +}); + +module.exports = Gripper; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gyro.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gyro.js new file mode 100644 index 00000000..af4b4ebb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/gyro.js @@ -0,0 +1,345 @@ +var Board = require("./board"); +var events = require("events"); +var util = require("util"); +var Fn = require("./fn"); + +var sum = Fn.sum; +var toFixed = Fn.toFixed; + +var priv = new Map(); +var axes = ["x", "y", "z"]; + +var Controllers = { + ANALOG: { + initialize: { + value: function(opts, dataHandler) { + var pins = opts.pins || [], + sensitivity, resolution, + state = priv.get(this), + dataPoints = {}; + + if (opts.sensitivity === undefined) { + throw new Error("Expected a Sensitivity"); + } + + // 4.88mV / (0.167mV/dps * 2) + // 0.67 = 4X + // 0.167 = 1X + sensitivity = opts.sensitivity; + resolution = opts.resolution || 4.88; + state.K = resolution / sensitivity; + + pins.forEach(function(pin, index) { + this.io.pinMode(pin, this.io.MODES.ANALOG); + this.io.analogRead(pin, function(data) { + var axis = axes[index]; + dataPoints[axis] = data; + dataHandler(dataPoints); + }.bind(this)); + }, this); + } + }, + toNormal: { + value: function(raw) { + return raw >> 2; + } + }, + toDegreesPerSecond: { + value: function(raw, rawCenter) { + var normal = this.toNormal(raw); + var center = this.toNormal(rawCenter); + var state = priv.get(this); + + return ((normal - center) * state.K) | 0; + } + } + }, + // http://www.invensense.com/mems/gyro/mpu6050.html + // Default to the +- 250 which has a 131 LSB/dps + MPU6050: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var state = priv.get(this), + driver = IMU.Drivers.get(this.board, "MPU6050", opts); + + state.sensitivity = opts.sensitivity || 131; + + driver.on("data", function(data) { + dataHandler(data.gyro); + }); + } + }, + toNormal: { + value: function(raw) { + return (raw >> 11) + 127; + } + }, + toDegreesPerSecond: { + // Page 12, Paragraph 6.1 + // Sensitivity scale factor + // FS_SEL=0 131 LSB/dps -> 0,007633588 dps/LSB + // FS_SEL=1 65.5 LSB/dps -> 0,015267176 dps/LSB + // FS_SEL=2 32.8 LSB/dps -> 0,00304878 dps/LSB + // FS_SEL=3 16.4 LSB/dps -> 0,06097561 dps/LSB + // Using 4 digits resolution + value: function(raw, rawCenter) { + var state = priv.get(this); + + return toFixed((raw - rawCenter) / state.sensitivity, 4); + } + } + }, + BNO055: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var state = priv.get(this), + driver = IMU.Drivers.get(this.board, "BNO055", opts); + + // AF p.14, OUTPUT SIGNAL GYROSCOPE, set this to 16 as according to AF.51 the default for the unit register + // is degrees. and there may be a bug in the Ada fruit code as it has the setting to radians disabled + // but the sensitivity / scale set to 900 which is used for radian reps + state.sensitivity = 16; + + driver.on("data", function(data) { + dataHandler(data.gyro); + }); + } + }, + toNormal: { + value: function(raw) { + return raw; + } + }, + toDegreesPerSecond: { + // Page 33, Table 3-22 + // Gyroscope unit settings 1dps = 16 LSB -> resolution 0,0625 dps with +=2000 dps range + value: function(raw) { + var state = priv.get(this); + return toFixed(raw / state.sensitivity, 4); + } + } + }, +}; + +function Gyro(opts) { + if (!(this instanceof Gyro)) { + return new Gyro(opts); + } + + var controller = null; + var isCalibrated = false; + var sampleSize = 100; + + var state = { + x: { + angle: 0, + value: 0, + previous: 0, + calibration: [], + stash: [0, 0, 0, 0, 0], + center: 0, + hasValue: false + }, + y: { + angle: 0, + value: 0, + previous: 0, + calibration: [], + stash: [0, 0, 0, 0, 0], + center: 0, + hasValue: false + }, + z: { + angle: 0, + value: 0, + previous: 0, + calibration: [], + stash: [0, 0, 0, 0, 0], + center: 0, + hasValue: false + } + }; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.ANALOG; + } + + Board.Controller.call(this, controller, opts); + + if (!this.toNormal) { + this.toNormal = opts.toNormal || function(raw) { + return raw; + }; + } + + if (!this.toDegreesPerSecond) { + this.toDegreesPerSecond = opts.toDegreesPerSecond || function(raw) { + return raw; + }; + } + + priv.set(this, state); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + var isChange = false; + + Object.keys(data).forEach(function(axis) { + var value = data[axis]; + var sensor = state[axis]; + + sensor.previous = sensor.value; + sensor.stash.shift(); + sensor.stash.push(value); + sensor.hasValue = true; + sensor.value = (sum(sensor.stash) / 5) | 0; + + if (!isCalibrated && + (state.x.calibration.length === sampleSize && + state.y.calibration.length === sampleSize && + (this.z === undefined || state.z.calibration.length === sampleSize))) { + + isCalibrated = true; + state.x.center = (sum(state.x.calibration) / sampleSize) | 0; + state.y.center = (sum(state.y.calibration) / sampleSize) | 0; + state.z.center = (sum(state.z.calibration) / sampleSize) | 0; + + state.x.calibration.length = 0; + state.y.calibration.length = 0; + state.z.calibration.length = 0; + } else { + if (sensor.calibration.length < sampleSize) { + sensor.calibration.push(value); + } + } + + if (sensor.previous !== sensor.value) { + isChange = true; + } + }, this); + + if (isCalibrated) { + state.x.angle += this.rate.x / 100; + state.y.angle += this.rate.y / 100; + state.z.angle += this.rate.z / 100; + + this.emit("data", { + x: this.x, + y: this.y, + z: this.z + }); + + if (isChange) { + this.emit("change", { + x: this.x, + y: this.y, + z: this.z + }); + } + } + }.bind(this)); + } + + Object.defineProperties(this, { + isCalibrated: { + get: function() { + return isCalibrated; + }, + set: function(value) { + if (typeof value === "boolean") { + isCalibrated = value; + } + } + }, + pitch: { + get: function() { + return { + rate: toFixed(this.rate.y, 2), + angle: toFixed(state.y.angle, 2) + }; + } + }, + roll: { + get: function() { + return { + rate: toFixed(this.rate.x, 2), + angle: toFixed(state.x.angle, 2) + }; + } + }, + yaw: { + get: function() { + return { + rate: this.z !== undefined ? toFixed(this.rate.z, 2) : 0, + angle: this.z !== undefined ? toFixed(state.z.angle, 2) : 0 + }; + } + }, + x: { + get: function() { + return toFixed(this.toNormal(state.x.value), 4); + } + }, + y: { + get: function() { + return toFixed(this.toNormal(state.y.value), 4); + } + }, + z: { + get: function() { + return state.z.hasValue ? toFixed(this.toNormal(state.z.value), 4) : undefined; + } + }, + rate: { + get: function() { + var x = this.toDegreesPerSecond(state.x.value, state.x.center); + var y = this.toDegreesPerSecond(state.y.value, state.y.center); + var z = state.z.hasValue ? + this.toDegreesPerSecond(state.z.value, state.z.center) : 0; + + return { + x: x, + y: y, + z: z + }; + } + } + }); +} + +Object.defineProperties(Gyro, { + TK_4X: { + value: 0.67 + }, + TK_1X: { + value: 0.167 + } +}); + + +util.inherits(Gyro, events.EventEmitter); + +Gyro.prototype.recalibrate = function() { + this.isCalibrated = false; +}; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Gyro.Controllers = Controllers; + Gyro.purge = function() { + priv.clear(); + }; +} +module.exports = Gyro; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/hygrometer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/hygrometer.js new file mode 100644 index 00000000..853c1054 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/hygrometer.js @@ -0,0 +1,269 @@ +var Board = require("./board"); +var Fn = require("./fn"); +var Emitter = require("events").EventEmitter; +var util = require("util"); + +var toFixed = Fn.toFixed; +var priv = new Map(); + +var Controllers = { + + SHT31D: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "SHT31D", opts); + driver.on("data", function(data) { + dataHandler(data.humidity); + }); + } + }, + toRelativeHumidity: { + value: function(raw) { + // Page 2, Table 1 + // Based on the "Relative Humidity Conversion" formula + // 1.1 Humidity Sensor Performance + // Typical resoultion 0.01%RH + // + // Page 14 + // 4.13 Conversion of Signal Output + // RH = 100 * (Srh / ((2 ** 26) - 1)) + // Srh = Sensor raw humidity + return toFixed((100 * raw / 65535), 2); + } + } + }, + + + HTU21D: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "HTU21D", opts); + driver.on("data", function(data) { + dataHandler(data.humidity); + }); + } + }, + toRelativeHumidity: { + value: function(raw) { + // Page 15 + // CONVERSION OF SIGNAL OUTPUTS + // RH = -6 + 125 * (Srh / (2 ** 26)) + // Srh = Sensor raw humidity + // + // Page 3, Table `SENSOR PERFORMANCE` + // + // Typical resolution 0.04 %RH + return toFixed((125 * raw / 65536) - 6, 2); + } + } + }, + + HIH6130: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "HIH6130", opts); + driver.on("data", function(data) { + dataHandler(data.humidity); + }); + } + }, + toRelativeHumidity: { + // Page 7, Table 2 + // Typical resoultion 0.04%RH + value: function(raw) { + // Page 3 + // Equation 1: Humidity Conversion Function + return toFixed(raw * 100 / (Fn.POW_2_14 - 1), 2); + } + } + }, + + DHT_I2C_NANO_BACKPACK: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "DHT_I2C_NANO_BACKPACK", opts); + driver.on("data", function(data) { + dataHandler(data.humidity); + }); + } + }, + toRelativeHumidity: { + // DHT11 + + // Page 4, Table + // Typical resolution 1%RH + // + // DHT21 + + // Page 2, Paragraph 5 + // Resolution 0.1%RH + // + // DHT22 + + // Page 2, Paragraph 3 + // Resolution 0.1%RH + value: function(raw) { + return toFixed(raw / 100, 1); + } + } + }, + + TH02: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "TH02", opts); + driver.on("data", function(data) { + dataHandler(data.humidity); + }); + } + }, + toRelativeHumidity: { + // Table 4 + // Resolution 12bit (16 codes per %RH) -> ~ 2 fractional digits + value: function(raw) { + if (raw > 100) { + raw = 0; + } + return toFixed(raw || 0, 2); + } + } + }, + + SI7020: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "SI7020", opts); + driver.on("data", function(data) { + dataHandler(data.humidity); + }); + } + }, + toRelativeHumidity: { + value: function(raw) { + // Page 7, Table 4 + // The device can have 12-bit resolution ~ 2 fractional digits (100 / 2^12) + // + // Humidity formula + // P. 22 + return toFixed((125 * raw / 65536) - 6, 2); + } + } + }, + + BME280: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BME280", opts); + driver.on("data", function(data) { + dataHandler(data.humidity); + }); + } + }, + toRelativeHumidity: { + value: function(raw) { + // Page 23 + // 47445 / 1024 = 46.333 %RH + return toFixed(raw / 1024, 3); + } + } + } +}; + +Controllers.DHT11_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; +Controllers.DHT21_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; +Controllers.DHT22_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; +Controllers.SI7021 = Controllers.SI7020; + + +function Hygrometer(opts) { + if (!(this instanceof Hygrometer)) { + return new Hygrometer(opts); + } + + var controller = null; + var last = null; + var raw = null; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var freq = opts.freq || 25; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + throw new Error("Missing Hygrometer controller"); + } + + priv.set(this, {}); + + Board.Controller.call(this, controller, opts); + + if (!this.toRelativeHumidity) { + this.toRelativeHumidity = opts.toRelativeHumidity || function(x) { + return x; + }; + } + + var propDescriptors = { + relativeHumidity: { + get: function() { + return this.toRelativeHumidity(raw); + } + } + }; + // Convenience aliases + propDescriptors.RH = propDescriptors.relativeHumidity; + + Object.defineProperties(this, propDescriptors); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + setInterval(function() { + if (raw == null) { + return; + } + + if (Number.isNaN(this.relativeHumidity)) { + return; + } + + var data = {}; + data.RH = data.relativeHumidity = this.relativeHumidity; + + this.emit("data", data); + + if (this.relativeHumidity !== last) { + last = this.relativeHumidity; + this.emit("change", data); + } + }.bind(this), freq); +} + +util.inherits(Hygrometer, Emitter); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Hygrometer.Controllers = Controllers; + Hygrometer.purge = function() { + priv.clear(); + }; +} + +module.exports = Hygrometer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/imu.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/imu.js new file mode 100644 index 00000000..c21fcba0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/imu.js @@ -0,0 +1,2762 @@ +var Board = require("./board"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Fn = require("./fn"); +var int16 = Fn.int16; +var uint16 = Fn.uint16; +var uint24 = Fn.uint24; +var s32 = Fn.s32; +var u32 = Fn.u32; + +var priv = new Map(); +var activeDrivers = new Map(); + +// TODO: make real const +var ACCELEROMETER = "accelerometer"; +var ALTIMETER = "altimeter"; +var BAROMETER = "barometer"; +var GYRO = "gyro"; +var HYGROMETER = "hygrometer"; +var MAGNETOMETER = "magnetometer"; +var ORIENTATION = "orientation"; +var THERMOMETER = "thermometer"; + + +function Components(controller, options) { + var state = priv.get(this); + var descriptors = Object.create(null); + + this.components.forEach(function(component) { + + // TODO: Can this be put inside the get accessor? + // - Lazy init? + state[component] = new Components[component]( + Object.assign({ + controller: options.controller || controller, + freq: options.freq, + board: this.board, + }, options) + ); + + descriptors[component] = { + get: function() { + return state[component]; + } + }; + + if (backwardCompatibilityGarbageHacks[component]) { + descriptors[backwardCompatibilityGarbageHacks[component]] = descriptors[component]; + } + }); + + Object.defineProperties(this, descriptors); +} + +Components.accelerometer = require("./accelerometer"); +Components.altimeter = require("./altimeter"); +Components.barometer = require("./barometer"); +Components.gyro = require("./gyro"); +Components.hygrometer = require("./hygrometer"); +Components.magnetometer = require("./compass"); +Components.orientation = require("./orientation"); +Components.thermometer = require("./thermometer"); + +var backwardCompatibilityGarbageHacks = { + thermometer: "temperature", +}; + +var Drivers = { + SHT31D: { + ADDRESSES: { + value: [0x44] + }, + REGISTER: { + value: { + // Table 13 + SOFT_RESET: 0x30A2, + // Table 8 + MEASURE_HIGH_REPEATABILITY: 0x2400, + } + }, + initialize: { + value: function(board, opts) { + var READLENGTH = 6; + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + io.i2cConfig(opts); + + io.i2cWrite(address, [ + // Page 12, Table 13 + this.REGISTER.SOFT_RESET >> 8, + this.REGISTER.SOFT_RESET & 0xFF, + ]); + + var computed = { + temperature: null, + humidity: null, + }; + + // temp msb, temp lsb, temp CRC, humidity msb, humidity lsb, humidity CRC + var readCycle = function() { + // Page 10, Table 8 + // Send high repeatability measurement command + io.i2cWrite(address, [ + this.REGISTER.MEASURE_HIGH_REPEATABILITY >> 8, + this.REGISTER.MEASURE_HIGH_REPEATABILITY & 0xFF, + ]); + + setTimeout(function() { + io.i2cReadOnce(address, READLENGTH, function(data) { + computed.temperature = uint16(data[0], data[1]); + computed.humidity = uint16(data[3], data[4]); + this.emit("data", computed); + readCycle(); + }.bind(this)); + }.bind(this), 16); + }.bind(this); + + readCycle(); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.SHT31D.ADDRESSES.value[0]; + return "sht-31d-" + address; + } + } + }, + + HTU21D: { + ADDRESSES: { + value: [0x40] + }, + REGISTER: { + value: { + HUMIDITY: 0xE5, + TEMPERATURE: 0xE3, + SOFT_RESET: 0xFE, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + // The "no hold" measurement requires waiting + // _at least_ 22ms between register write and + // register read. Delay is measured in μs: + // 22ms = 22000μs; recommend 50ms = 50000μs + opts.delay = 50000; + + io.i2cConfig(opts); + io.i2cWrite(address, this.REGISTER.SOFT_RESET); + + var computed = { + temperature: null, + humidity: null, + }; + + var cycle = 0; + var readCycle = function() { + // Despite the registers being back to back, the HTU21D + // does not like when 5 bytes are requested, so we put + // the two data sources on their own read channels. + var isTemperatureCycle = cycle === 0; + var register = isTemperatureCycle ? this.REGISTER.TEMPERATURE : this.REGISTER.HUMIDITY; + + io.i2cReadOnce(address, register, 2, function(data) { + if (isTemperatureCycle) { + computed.temperature = uint16(data[0], data[1]); + } else { + computed.humidity = uint16(data[0], data[1]); + } + + if (++cycle === 2) { + cycle = 0; + this.emit("data", computed); + } + + readCycle(); + }.bind(this)); + }.bind(this); + + readCycle(); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.HTU21D.ADDRESSES.value[0]; + return "htu-s1d-" + address; + } + } + }, + HIH6130: { + ADDRESSES: { + value: [0x27] + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + io.i2cConfig(opts); + + var computed = { + humidity: null, + temperature: null, + }; + + var delay = 36.65; + + var measureCycle = function() { + // The most common use cases involve continuous + // sampling of sensor data, so that's what this + // controller-driver will provide. + io.i2cWrite(address, 0xA0, [0x00, 0x00]); + + setTimeout(function() { + io.i2cWrite(address, 0x80, [0x00, 0x00]); + io.i2cReadOnce(address, 4, function(data) { + // Page 2, Figure 4. + // Humidity and Temperature Data Fetch, Four Byte Data Read + // B7:6 Contain status bits + var status = data[0] >> 6; + // Mask out B7:6 status bits from H MSB + computed.humidity = int16(data[0] & 0x3F, data[1]); + // Shift off B1:0 (which are empty) + computed.temperature = int16(data[2], data[3] >> 2); + + // Page 3, 2.6 Status Bits + // + // 0 0 Normal + // 0 1 Stale + // 1 0 Command Mode + // 1 1 Diagnostic Condition + // + // When the two status bits read "01", "stale" data is + // indicated. This means that the data that already + // exists in the sensor's output buffer has already + // been fetched by the Master, and has not yet been + // updated with the next data from the current measurement + // cycle. This can happen when the Master polls the + // data quicker than the sensor can update the output buffer. + if (status === 0) { + delay--; + } + + if (status === 1) { + delay++; + } + + this.emit("data", computed); + + measureCycle(); + }.bind(this)); + // Page 3 + // 3.0 Measurement Cycle + // The measurement cycle duration is typically + // 36.65 ms for temperature and humidity readings. + }.bind(this), delay); + }.bind(this); + + measureCycle(); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.HIH6130.ADDRESSES.value[0]; + return "hih6130-" + address; + } + } + }, + DHT_I2C_NANO_BACKPACK: { + ADDRESSES: { + value: [0x0A] + }, + REGISTER: { + value: { + READ: 0x00, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + // Correspond to firmware variables + var dhtPin = 2; + var dhtType = 11; + + opts.address = address; + + io.i2cConfig(opts); + + var dhtVariantExec = /(\d{2})/.exec(opts.controller); + var dhtVariant = dhtVariantExec && dhtVariantExec.length && dhtVariantExec[0]; + + if (dhtVariant) { + dhtType = +dhtVariant; + + if (Number.isNaN(dhtType)) { + dhtType = 11; + } + } + + var computed = { + temperature: null, + humidity: null, + }; + + io.i2cWrite(address, [dhtPin, dhtType]); + io.i2cRead(address, 4, function(data) { + computed.humidity = int16(data[0], data[1]); + computed.temperature = int16(data[2], data[3]); + this.emit("data", computed); + }.bind(this)); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.DHT_I2C_NANO_BACKPACK.ADDRESSES.value[0]; + return "dht_i2c_nano_backpack-" + address; + } + } + }, + MPU6050: { + ADDRESSES: { + value: [0x68, 0x69] + }, + REGISTER: { + value: { + SETUP: [0x6B, 0x00], + READ: 0x3B + } + }, + initialize: { + value: function(board, opts) { + var READLENGTH = 14; + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + var computed = { + accelerometer: {}, + temperature: {}, + gyro: {} + }; + + io.i2cConfig(opts); + io.i2cWrite(address, this.REGISTER.SETUP); + + io.i2cRead(address, this.REGISTER.READ, READLENGTH, function(data) { + computed.accelerometer = { + x: int16(data[0], data[1]), + y: int16(data[2], data[3]), + z: int16(data[4], data[5]) + }; + + computed.temperature = int16(data[6], data[7]); + + computed.gyro = { + x: int16(data[8], data[9]), + y: int16(data[10], data[11]), + z: int16(data[12], data[13]) + }; + + this.emit("data", computed); + }.bind(this)); + }, + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.MPU6050.ADDRESSES.value[0]; + return "mpu-6050-" + address; + } + } + }, + BNO055: { + ADDRESSES: { + value: [0x28, 0x29] + }, + REGISTER: { + value: { + // + // 4.2.1 Register map Page 0 + // + READ: { + /* + All motion data is in the following order: + X LSB + X MSB + Y LSB + Y MSB + Z LSB + Z MSB + + The quarternion data is WXYZ + W LSB + W MSB + X LSB + X MSB + Y LSB + Y MSB + Z LSB + Z MSB + + */ + + // m/s^2 by default + ACCEL: 0x08, // X LSB + + // ? by default + MAG: 0x0E, // X LSB + + // dps by default + GYRO: 0x14, // X LSB + + //euler angles - degrees + EULER: 0x1A, // heading LSB + + //quarternion + QUARTERNION: 0x20, // W LSB + + // °C by default + TEMP: 0x34, + }, + + LENGTH: { + ACCEL: 6, + MAG: 6, + GYRO: 6, + EULER: 6, + QUARTERNION: 8, + TEMP: 1, + }, + + OPR_MODE_ADDR: 0x3D, + OPR_MODES: { + CONFIG: 0x00, + ACCONLY: 0x01, + MAGONLY: 0x02, + GYRONLY: 0x03, + ACCMAG: 0x04, + ACCGYRO: 0x05, + MAGGYRO: 0x06, + AMG: 0x07, + IMUPLUS: 0x08, + COMPASS: 0x09, + M4G: 0x0A, + NDOF_FMC_OFF: 0x0B, + NDOF: 0x0C, + }, + + PWR_MODE_ADDR: 0x3E, + PWR_MODES: { + NORMAL: 0x00, + LOW: 0x01, + SUSPEND: 0x02, + }, + + PAGE_ID_ADDR: 0x07, + PAGE_STATES: { + ZERO: 0x00, + }, + + CALIBRATION: 0x35, + SYS_TRIGGER: 0x3F, + + UNIT_SEL_ADDR: 0x3B, + + AXIS_MAP_CONFIG_ADDR: 0x41, + AXIS_MAP_SIGN_ADDR: 0x42, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + // Page 67 4.3.54 + // a value for what we use to consider the system calibrated, + // 0xC0 represents the just fusion algorithm/system + var calibrationMask = opts.calibrationMask || 0xC0; + + opts.address = address; + + var computed = { + accelerometer: { + x: null, + y: null, + z: null, + }, + gyro: { + x: null, + y: null, + z: null, + }, + magnetometer: { + x: null, + y: null, + z: null, + }, + orientation: { + euler: { + heading: null, + roll: null, + pitch: null, + }, + quarternion: { + w: null, + x: null, + y: null, + z: null, + }, + }, + temperature: null, + calibration: null, + }; + + io.i2cConfig(opts); + + // Put chip into CONFIG operation mode + io.i2cWriteReg(address, this.REGISTER.OPR_MODE_ADDR, this.REGISTER.OPR_MODES.CONFIG); + + // Set register page to 0 + io.i2cWriteReg(address, this.REGISTER.PAGE_ID_ADDR, this.REGISTER.PAGE_STATES.ZERO); + + // Page 70, 4.3.63 SYS_TRIGGER + // + // RST_SYS (Set to reset system) + // + // B7 B6 B5 B4 B3 B2 B1 B0 + // 0 0 1 0 0 0 0 0 + // + io.i2cWriteReg(address, this.REGISTER.SYS_TRIGGER, 0x20); + + var por = new Promise(function(resolve) { + setTimeout(function() { + + // Normal power mode + io.i2cWriteReg(address, this.REGISTER.PWR_MODE_ADDR, this.REGISTER.PWR_MODES.NORMAL); + + // Page 70, 4.3.63 SYS_TRIGGER + // + // CLK_SEL: + // + // B7 B6 B5 B4 B3 B2 B1 B0 + // 0 0 0 0 0 0 0 0 + // + //io.i2cWriteReg(address, this.REGISTER.SYS_TRIGGER, 0x00); + // do we want to enable an external crystal?? + io.i2cWriteReg(address, this.REGISTER.SYS_TRIGGER, opts.enableExternalCrystal ? 0x80 : 0x00); + + // AF Page 24 3.4, Axis remap + // + // AXIS_MAP_CONFIG: + // + // B7 B6 B5 B4 B3 B2 B1 B0 + // 0 0 0 0 0 0 0 0 + // - - z z y y x x + // + // x axis = 00, y axis = 01, z axis = 10 + // + // see also the defaults starting on Page 50 + // + var axisMap = opts.axisMap || 0x24; + io.i2cWriteReg(address, this.REGISTER.AXIS_MAP_CONFIG_ADDR, axisMap); + + // AF Page 24 3.4, Axis remap + // + // AXIS_MAP_CONFIG: + // + // B7 B6 B5 B4 B3 B2 B1 B0 + // 0 0 0 0 0 0 0 0 + // - - - - - x y z + // + // 0 = positive, 1 = negative + // + var axisSign = opts.axisSign || 0x00; + io.i2cWriteReg(address, this.REGISTER.AXIS_MAP_SIGN_ADDR, axisSign); + + // Set operational mode to "nine degrees of freedom" + setTimeout(function() { + io.i2cWriteReg(address, this.REGISTER.OPR_MODE_ADDR, this.REGISTER.OPR_MODES.NDOF); + resolve(); + }.bind(this), 10); + + // Page 13, 1.2, OPERATING CONDITIONS BNO055 + // From reset to config mode + }.bind(this), 650); + }.bind(this)); + + por.then(function() { + return new Promise(function(resolve) { + var readCalibration = function() { + io.i2cReadOnce(address, this.REGISTER.CALIBRATION, 1, function(data) { + + var calibration = data[0]; + var didCalibrationChange = computed.calibration !== calibration; + + + computed.calibration = calibration; + + // It is useful, possibly to know when the calibration state changes + // some of the calibrations are a little picky to get right, so emitting + // the calibration state as it changes is useful. + if (didCalibrationChange) { + this.emit("calibration", computed.calibration); + } + + if ((calibration & calibrationMask) === calibrationMask) { + + // Emit the calibration state so we can work out in our userspace if + // we are good to go, and for when we are performing the calibration steps + // let everyone know we are calibrated. + this.emit("calibrated"); + + resolve(); + } else { + readCalibration(); + } + + }.bind(this)); + }.bind(this); + + readCalibration(); + + }.bind(this)); + }.bind(this)).then(function() { + + // Temperature requires no calibration, begin reading immediately + // here we read out temp, and the calibration state since they are back to back + // and the device can, has been observed to go out of calibration and we may want to check + io.i2cRead(address, this.REGISTER.READ.TEMP, 2, function(data) { + computed.temperature = data[0]; + + var didCalibrationChange = computed.calibration !== data[1]; + computed.calibration = data[1]; + + this.emit("data", computed); + if (didCalibrationChange) { + this.emit("calibration", computed.calibration); + } + }.bind(this)); + + + // ACCEL, MAG and GYRO are 6 bytes each => 18 bytes total + io.i2cRead(address, this.REGISTER.READ.ACCEL, 18, function(data) { + + computed.accelerometer = { + x: int16(data[1], data[0]), + y: int16(data[3], data[2]), + z: int16(data[5], data[4]) + }; + + computed.magnetometer = { + x: int16(data[7], data[6]), + y: int16(data[9], data[8]), + z: int16(data[11], data[10]) + }; + + computed.gyro = { + x: int16(data[13], data[12]), + y: int16(data[15], data[14]), + z: int16(data[17], data[16]) + }; + + this.emit("data", computed); + }.bind(this)); + + // Moved the ndof/quarternions to their own read.. bytes go missing, lots of 32 byte buffers everywhere + io.i2cRead(address, this.REGISTER.READ.EULER, 14, function(data) { + + // raw euler + computed.orientation.euler = { + heading: int16(data[1], data[0]), + roll: int16(data[3], data[2]), + pitch: int16(data[5], data[4]) + }; + + // scaled quarternion - unitless + computed.orientation.quarternion = { + w: int16(data[7], data[6]), + x: int16(data[9], data[8]), + y: int16(data[11], data[10]), + z: int16(data[13], data[12]) + }; + + this.emit("data", computed); + }.bind(this)); + + }.bind(this)); + }, + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.BNO055.ADDRESSES.value[0]; + return "bno055-" + address; + } + } + }, + + MPL115A2: { + ADDRESSES: { + value: [0x60] + }, + REGISTER: { + value: { + // Page 5 + // Table 2. Device Memory Map + COEFFICIENTS: 0x04, + PADC_MSB: 0x00, + CONVERT: 0x12, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + io.i2cConfig(opts); + + var computed = { + pressure: null, + temperature: null, + }; + + var cof = { + a0: null, + b1: null, + b2: null, + c12: null + }; + + var handler = function(data) { + + // Page 5 + // 3.1 Pressure, Temperature and Coefficient Bit-Width Specifications + var Padc = uint16(data[0], data[1]) >> 6; + var Tadc = uint16(data[2], data[3]) >> 6; + + // Page 6 + // 3.2 Compensation + computed.pressure = cof.a0 + (cof.b1 + cof.c12 * Tadc) * Padc + cof.b2 * Tadc; + computed.temperature = Tadc; + + this.emit("data", computed); + + readCycle(); + }.bind(this); + + var readCycle = function() { + io.i2cWriteReg(address, this.REGISTER.CONVERT, 0x00); + // Page 5 + // Table 2. Device Memory Map + // Starting from PADC_MSB, read 4 bytes: + // + // Padc_MSB + // Padc_LSB + // Tadc_MSB + // Tadc_LSB + // + io.i2cReadOnce(address, this.REGISTER.PADC_MSB, 4, handler); + + // TODO: User specified "frequency" needs to be applied here. + }.bind(this); + + var pCoefficients = new Promise(function(resolve) { + io.i2cReadOnce(address, this.REGISTER.COEFFICIENTS, 8, function(data) { + var A0 = int16(data[0], data[1]); + var B1 = int16(data[2], data[3]); + var B2 = int16(data[4], data[5]); + var C12 = int16(data[6], data[7]) >> 2; + + // Source: + // https://github.com/adafruit/Adafruit_MPL115A2 + // a0 is the pressure offset coefficient + // b1 is the pressure sensitivity coefficient + // b2 is the temperature coefficient of offset (TCO) + // c12 is the temperature coefficient of sensitivity (TCS) + cof.a0 = A0 / 8; + cof.b1 = B1 / 8192; + cof.b2 = B2 / 16384; + cof.c12 = C12 / 4194304; + + resolve(); + }.bind(this)); + }.bind(this)); + + pCoefficients.then(readCycle); + }, + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.MPL115A2.ADDRESSES.value[0]; + return "mpl115a2-" + address; + } + } + }, + // Based off of the AdaFruit Arduino library for this chip + // https://github.com/adafruit/Adafruit_MPL3115A2_Library + MPL3115A2: { + ADDRESSES: { + value: [0x60] + }, + REGISTER: { + // Page 18 + // 13 Register descriptions + value: { + STATUS: 0x00, + PRESSURE: 0x01, + CONFIG: 0x13, + BAR_IN_MSB: 0x14, + BAR_IN_LSB: 0x15, + CONTROL: 0x26, + } + }, + MASK: { + value: { + STATUS: { + PRESSURE_DATA_READ: 0x04 + }, + CONTROL: { + SBYB: 0x01, + OS128: 0x38, + ALTIMETER: 0x80, + PRESSURE: 0x00 + }, + CONFIG: { + TDEFE: 0x01, + PDEFE: 0x02, + DREM: 0x04 + } + } + }, + initialize: { + value: function(board, opts) { + var READLENGTH = 6; + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + var isPressure = false; + var elevation = null; + var offset = 0; + + opts.address = address; + + // See http://www.henrylahr.com/?p=99 for implementation approach + // + var altNow = 0; + var computed = { + pressure: 0, + altitude: 0, + temperature: 0 + }; + + if (typeof opts.elevation !== "undefined") { + elevation = opts.elevation; + } + + if (elevation !== null && elevation <= 0) { + offset = Math.abs(elevation) + 1; + elevation = 1; + } + + var waitForReady = function(next) { + io.i2cReadOnce(address, this.REGISTER.STATUS, 1, function(data) { + if (data[0] & this.MASK.STATUS.PRESSURE_DATA_READ) { + next(); + } else { + setTimeout(function() { + waitForReady(next); + }, 100); + } + }.bind(this)); + }.bind(this); + + var readValues = function() { + var modeMask = isPressure ? this.MASK.CONTROL.PRESSURE : this.MASK.CONTROL.ALTIMETER; + var mode = this.MASK.CONTROL.SBYB | this.MASK.CONTROL.OS128 | modeMask; + + io.i2cWrite(address, this.REGISTER.CONTROL, mode); + + waitForReady(function() { + io.i2cReadOnce(address, this.REGISTER.PRESSURE, READLENGTH, function(data) { + var value = uint24(data[1], data[2], data[3]) >> 4; + var temperature = uint16(data[4], data[5]) >> 4; + var altVal; + + computed.temperature = temperature; + + if (isPressure) { + computed.pressure = value; + this.emit("data", computed); + } else { + var m = data[1]; + var c = data[2]; + var l = data[3]; + var fl = (l >> 4) / 16; + + altVal = (m << 8 | c) + fl; + altNow = (altNow * 3 + altVal) / 4; + + computed.altitude = altNow - offset; + } + + isPressure = !isPressure; + + readValues(); + }.bind(this)); + }.bind(this)); + }.bind(this); + + var reads = []; + var calibrate = function() { + // Clear Oversampling and OST + io.i2cWrite(address, this.REGISTER.CONTROL, 0x3B); + io.i2cWrite(address, this.REGISTER.CONTROL, 0x39); + + setTimeout(function() { + io.i2cReadOnce(address, this.REGISTER.PRESSURE, READLENGTH, function(data) { + var m = data[1]; + var c = data[2]; + var l = data[3]; + var fl = (l >> 4) / 4; + + reads.push((m << 10 | c << 2) + fl); + + if (reads.length === 4) { + var curpress = (reads[0] + reads[1] + reads[2] + reads[3]) / 4; + var seapress = curpress / Math.pow(1 - elevation * 0.0000225577, 5.255); + + // Update Barometric input for Altitude + io.i2cWrite(address, this.REGISTER.BAR_IN_MSB, (seapress / 2) >> 8); + io.i2cWrite(address, this.REGISTER.BAR_IN_LSB, (seapress / 2) & 0xFF); + + // Get into Altitude mode + // One shot & OST bit + io.i2cWrite(address, this.REGISTER.CONTROL, 0xBB); + io.i2cWrite(address, this.REGISTER.CONTROL, 0xB9); + + setTimeout(function() { + io.i2cReadOnce(address, this.REGISTER.PRESSURE, READLENGTH, function(data) { + var m = data[1]; + var c = data[2]; + var l = data[3]; + var fl = (l >> 4) / 16; + + altNow = (m << 8 | c) + fl; + + readValues(false); + }); + }.bind(this), 550); + + } else { + calibrate(); + } + }.bind(this)); + }.bind(this), 500); + }.bind(this); + + io.i2cConfig( + Object.assign(opts, { + settings: { + stopTX: true + } + }) + ); + + // configure the chip + // Set Altitude Offset. + io.i2cWriteReg(address, 0x2D, 0x00); + + io.i2cWriteReg(address, this.REGISTER.BAR_IN_MSB, 0); + io.i2cWriteReg(address, this.REGISTER.BAR_IN_LSB, 0); + + io.i2cWriteReg(address, this.REGISTER.CONFIG, + this.MASK.CONFIG.TDEFE | + this.MASK.CONFIG.PDEFE | + this.MASK.CONFIG.DREM); + + if (elevation !== null) { + calibrate(); + } else { + readValues(); + } + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.MPL3115A2.ADDRESSES.value[0]; + return "mpl3115a2-" + address; + } + } + }, + BMP180: { + ADDRESSES: { + value: [0x77] + }, + REGISTER: { + value: { + COEFFICIENTS: 0xAA, + READ: 0x00, + READ_START: 0xF4, + READ_RESULT: 0xF6, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + var elevation = null; + var offset = 0; + + if (typeof opts.elevation !== "undefined") { + elevation = opts.elevation; + } + + if ((elevation != null && elevation <= 0) || + elevation == null) { + offset = Math.abs(elevation) + 1; + elevation = 1; + } + + opts.address = address; + + /** + * Table 1: Operating conditions, output signal and mechanical characteristics + * + * Pressure Conversion Delay (ms) + * + * [ + * 5, LOW + * 8, STANDARD + * 14, HIGH + * 26, ULTRA + * ] + * + * These numbers are derived from rounding the Max column of + * Table 1, for the Conversion Time entries. + */ + + var mode = opts.mode || 3; + var kpDelay = [5, 8, 14, 26][mode]; + var oss = Fn.constrain(mode, 0, 3); + + var cof = { + a1: null, + a2: null, + a3: null, + a4: null, + a5: null, + a6: null, + b1: null, + b2: null, + b5: null, + mb: null, + mc: null, + md: null, + }; + + io.i2cConfig(opts); + + var pCoefficients = new Promise(function(resolve) { + io.i2cReadOnce(address, this.REGISTER.COEFFICIENTS, 22, function(data) { + // BMP085 + // Page 12 + // 3.4 Calibration Coefficients + // + // BMP180 + // Page 13 + // 3.4 Calibration Coefficients + // + cof.a1 = int16(data[0], data[1]); + cof.a2 = int16(data[2], data[3]); + cof.a3 = int16(data[4], data[5]); + cof.a4 = uint16(data[6], data[7]); + cof.a5 = uint16(data[8], data[9]); + cof.a6 = uint16(data[10], data[11]); + cof.b1 = int16(data[12], data[13]); + cof.b2 = int16(data[14], data[15]); + cof.mb = int16(data[16], data[17]); + cof.mc = int16(data[18], data[19]); + cof.md = int16(data[20], data[21]); + + resolve(); + }); + }.bind(this)); + + pCoefficients.then(function() { + + // BMP085 + // Pages 10, 11 + // 3.3 Measurement of pressure and temperature + // Pages 12, 13, 14 + // 3.5 Calculating pressure and temperature + // + // BMP180 + // Pages 11, 12 + // 3.3 Measurement of pressure and temperature + // Pages 13, 14, 15, 16 + // 3.5 Calculating pressure and temperature + // + var computed = { + altitude: null, + pressure: null, + temperature: null, + }; + + var cycle = 0; + + // BMP180 + // Pages 11, 15 + // 3.3 Measurement of pressure and temperature + // 3.5 Calculating pressure and temperature + var readCycle = function() { + + // cycle 0: temperature + // cycle 1: pressure + + var isTemperatureCycle = cycle === 0; + var component = isTemperatureCycle ? 0x2E : 0x34 + (oss << 6); + var numBytes = isTemperatureCycle ? 2 : 3; + var delay = isTemperatureCycle ? 5 : kpDelay; + + + io.i2cWriteReg(address, this.REGISTER.READ_START, component); + + // Once the READ_START register is set, + // delay the READ_RESULT request based on the + // mode value provided by the user, or default. + setTimeout(function() { + io.i2cReadOnce(address, this.REGISTER.READ_RESULT, numBytes, function(data) { + var compensated, uncompensated; + var x1, x2, x3, b3, b4, b6, b7, b6s, bx; + + if (isTemperatureCycle) { + // TEMPERATURE + uncompensated = int16(data[0], data[1]); + + // Compute the true temperature + x1 = ((uncompensated - cof.a6) * cof.a5) >> 15; + x2 = ((cof.mc << 11) / (x1 + cof.md)) >> 0; + + // Compute b5, which is used by the pressure cycle + cof.b5 = (x1 + x2) | 0; + + // Steps of 0.1°C + computed.temperature = ((cof.b5 + 8) >> 4) / 10; + } else { + // PRESSURE + uncompensated = uint24(data[0], data[1], data[2]) >> (8 - oss); + + b6 = cof.b5 - 4000; + b6s = b6 * b6; + bx = b6s >> 12; + + // Intermediary x1 & x2 to calculate x3 for b3 + x1 = (cof.b2 * bx) >> 11; + x2 = (cof.a2 * b6) >> 11; + x3 = x1 + x2; + b3 = ((((cof.a1 * 4 + x3) << oss) + 2) / 4) >> 0; + + // Intermediary x1 & x2 to calculate x3 for b4 + x1 = (cof.a3 * b6) >> 13; + x2 = (cof.b1 * bx) >> 16; + x3 = ((x1 + x2) + 2) >> 2; + b4 = (cof.a4 * (x3 + 32768)) >> 15; + b7 = (uncompensated - b3) * (50000 >> oss); + + if (b7 < Fn.POW_2_31) { + compensated = (b7 * 2) / b4; + } else { + compensated = (b7 / b4) * 2; + } + + compensated >>= 0; + + x1 = (compensated >> 8) * (compensated >> 8); + x1 = (x1 * 3038) >> 16; + x2 = (-7357 * compensated) >> 16; + + compensated += (x1 + x2 + 3791) >> 4; + + // Steps of 1Pa (= 0.01hPa = 0.01mbar) (=> 0.001kPa) + computed.pressure = compensated; + + // 3.7 Calculating pressure at sea level + var seapress = compensated / Math.pow(1 - elevation * 0.0000225577, 5.255); + var altitude = 44330 * (1 - Math.pow(compensated / seapress, 1 / 5.255)); + + // Page 3 (of BMP280 Datasheet) + // ...relative accuracy is ±0.12 hPa, which is equivalent to + // ±1 m difference in altitude. + computed.altitude = Math.round(altitude - offset); + } + + if (++cycle === 2) { + cycle = 0; + this.emit("data", computed); + } + + readCycle(); + }.bind(this)); + }.bind(this), delay); + }.bind(this); + + // Kick off "read loop" + // + readCycle(); + }.bind(this)); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.BMP180.ADDRESSES.value[0]; + return "bmp180-" + address; + } + } + }, + + BMP280: { + ADDRESSES: { + value: [0x77] + }, + REGISTER: { + value: { + COEFFICIENTS: 0x88, + CONFIG: 0xF5, + MEASURE: 0xF4, + // 0xF7, 0xF8, 0xF9 + // MSB, LSB, XLSB + PRESSURE: 0xF7, + // 0xFA, 0xFB, 0xFC + // MSB, LSB, XLSB + TEMPERATURE: 0xFA, + RESET: 0xE0, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + var elevation = null; + var offset = 0; + + if (typeof opts.elevation !== "undefined") { + elevation = opts.elevation; + } + + if ((elevation != null && elevation <= 0) || + elevation == null) { + offset = Math.abs(elevation) + 1; + elevation = 1; + } + + opts.address = address; + + var dig = { + T1: null, + T2: null, + T3: null, + P1: null, + P2: null, + P3: null, + P4: null, + P5: null, + P6: null, + P7: null, + P8: null, + P9: null, + }; + + io.i2cConfig(opts); + + // Page. 24 + // 4.3.2 Register 0xE0 "reset" + io.i2cWrite(address, this.REGISTER.RESET, 0xB6); + + var pCoefficients = new Promise(function(resolve) { + io.i2cReadOnce(address, this.REGISTER.COEFFICIENTS, 24, function(data) { + + // Page 21, Table 17 + // Compensation parameter storage, naming and data type + // These are received LSB FIRST + // + + dig.T1 = uint16(data[1], data[0]); + dig.T2 = int16(data[3], data[2]); + dig.T3 = int16(data[5], data[4]); + + dig.P1 = uint16(data[7], data[6]); + dig.P2 = int16(data[9], data[8]); + dig.P3 = int16(data[11], data[10]); + dig.P4 = int16(data[13], data[12]); + dig.P5 = int16(data[15], data[14]); + dig.P6 = int16(data[17], data[16]); + dig.P7 = int16(data[19], data[18]); + dig.P8 = int16(data[21], data[20]); + dig.P9 = int16(data[23], data[22]); + + resolve(); + }); + }.bind(this)); + + pCoefficients.then(function() { + /* + CTRL_MEAS bits + + | DATA LSB | + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + | - | - | - | - | - | - | - | - | + | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | + */ + + io.i2cWrite(address, this.REGISTER.MEASURE, 0x3F); + + var computed = { + altitude: null, + pressure: null, + temperature: null, + }; + + // + // Page 12 + // 3.3.1 Pressure measurement + // + // Page 13 + // 3.3.2 Temperature measurement + // + + io.i2cRead(address, this.REGISTER.PRESSURE, 6, function(data) { + var compensated = 0; + + // Page 45 + // "Returns temperature in DegC, double precision. Output value of + // '51.23' equals 51.23 DegC. t_fine carries fine temperature as global value" + var fine; + + // var1, var2 + // + // Expect: + // + // int32 + // + var v1, v2; + + // Page 44 + // "Both pressure and temperature values are expected to be + // received in 20 bit format, positive, stored in a 32 bit signed integer. " + // + // V = int32(uint24(m, l, xl)) + // V >> 4; + // + + // Page 45 + var P = s32(uint24(data[0], data[1], data[2])); + var T = s32(uint24(data[3], data[4], data[5])); + + P >>= 4; + T >>= 4; + + // TEMPERATURE + + // Page 45 + // bmp280_compensate_T_int32 + // var1 = ((((adc_T>>3) – ((BMP280_S32_t)dig_T1<<1))) * + // ((BMP280_S32_t)dig_T2)) >> 11; + // var2 = (((((adc_T>>4) – ((BMP280_S32_t)dig_T1)) * + // ((adc_T>>4) – ((BMP280_S32_t)dig_T1))) >> 12) * + // ((BMP280_S32_t)dig_T3)) >> 14; + // + // + var adc16 = T >> 4; + var adc16subT1 = adc16 - dig.T1; + v1 = (((T >> 3) - (dig.T1 << 1)) * dig.T2) >> 11; + v2 = (((adc16subT1 * adc16subT1) >> 12) * dig.T3) >> 14; + + // t_fine = var1 + var2; + fine = v1 + v2; + + // Page 7, 8 + // Table 2: Parameter specification + // + // + // Temperature 0.01 °C + // + // As toFixed(2) + // + // C = +(((t_fine * 5 + 128) >> 8) / 100).toFixed(resolution) + // + computed.temperature = ((fine * 5 + 128) >> 8) / 100; + + v1 = undefined; + v2 = undefined; + + + // PRESSURE + // Page 46 + // bmp280_compensate_P_int32 + // + // Every single seemingly arbitrary magic number comes from the datasheet. + // Datasheets are evidently written by people that don't care about + // anyone else actually understanding how a thing works. + // + + // var1 = (((BMP280_S32_t)t_fine)>>1) – (BMP280_S32_t)64000; + v1 = s32(fine >> 1) - 64000; + + // var2 = (((var1>>2) * (var1>>2)) >> 11 ) * ((BMP280_S32_t)dig_P6); + v2 = (((v1 >> 2) * (v1 >> 2)) >> 11) * s32(dig.P6); + + // var2 = var2 + ((var1*((BMP280_S32_t)dig_P5))<<1); + v2 += (v1 * s32(dig.P5)) << 1; + + // var2 = (var2>>2)+(((BMP280_S32_t)dig_P4)<<16); + v2 = (v2 >> 2) + (s32(dig.P4) << 16); + + + // var1 = (((dig_P3 * (((var1>>2) * (var1>>2)) >> 13 )) >> 3) + + // ((((BMP280_S32_t)dig_P2) * var1)>>1))>>18; + v1 = (((dig.P3 * (((v1 >> 2) * (v1 >> 2)) >> 13)) >> 3) + ((s32(dig.P2) * v1) >> 1)) >> 18; + + // var1 =((((32768+var1))*((BMP280_S32_t)dig_P1))>>15); + v1 = (((Fn.POW_2_15 + v1) * s32(dig.P1)) >> 15); + + if (v1 === 0) { + // Prevent division by zero + return 0; + } + + // p = (((BMP280_U32_t)(((BMP280_S32_t)1048576)-adc_P)-(var2>>12)))*3125; + compensated = u32((s32(Fn.POW_2_20) - P) - (v2 >> 12)) * 3125; + + if (compensated < Fn.POW_2_31) { + // p = (p << 1) / ((BMP280_U32_t)var1); + compensated = ((compensated << 1) >>> 0) / u32(v1); + } else { + // p = (p / (BMP280_U32_t)var1) * 2; + compensated = ((compensated / u32(v1)) >>> 0) * 2; + } + + compensated = u32(compensated) >>> 0; + + // var1 = (((BMP280_S32_t)dig_P9) * ((BMP280_S32_t)(((p>>3) * (p>>3))>>13)))>>12; + var compshift3r = compensated >> 3; + v1 = (s32(dig.P9) * s32(((compshift3r * compshift3r) >> 13))) >> 12; + + // var2 = (((BMP280_S32_t)(p>>2)) * ((BMP280_S32_t)dig_P8))>>13; + v2 = (s32(compensated >> 2) * s32(dig.P8)) >> 13; + + // p = (BMP280_U32_t)((BMP280_S32_t)p + ((var1 + var2 + dig_P7) >> 4)); + compensated = u32(s32(compensated) + ((v1 + v2 + dig.P7) >> 4)); + + // Steps of 1Pa (= 0.01hPa = 0.01mbar) (=> 0.001kPa) + computed.pressure = compensated; + + // Calculating pressure at sea level (copied from BMP180) + var seapress = compensated / Math.pow(1 - elevation * 0.0000225577, 5.255); + var altitude = 44330 * (1 - Math.pow(compensated / seapress, 1 / 5.255)); + + // Page 3 + // ...relative accuracy is ±0.12 hPa, which is equivalent to + // ±1 m difference in altitude. + computed.altitude = Math.round(altitude - offset); + + this.emit("data", computed); + }.bind(this)); + }.bind(this)); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.BMP280.ADDRESSES.value[0]; + return "bmp280-" + address; + } + } + }, + + BME280: { + ADDRESSES: { + value: [0x77] + }, + REGISTER: { + value: { + COEFFICIENTS_TP: 0x88, + COEFFICIENTS_H: 0xE1, + CONFIG: 0xF5, + MEASURE_H: 0xF2, + MEASURE_TP: 0xF4, + PRESSURE: 0xF7, + // 0xF7, 0xF8, 0xF9 + // MSB, LSB, XLSB + TEMPERATURE: 0xFA, + // 0xFA, 0xFB, 0xFC + // MSB, LSB, XLSB + HUMIDITY: 0xFD, + // 0xFD, 0xFE + // MSB, LSB + RESET: 0xE0, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + var elevation = null; + var offset = 0; + + if (typeof opts.elevation !== "undefined") { + elevation = opts.elevation; + } + + if ((elevation != null && elevation <= 0) || + elevation == null) { + offset = Math.abs(elevation) + 1; + elevation = 1; + } + + opts.address = address; + + var dig = { + T1: null, + T2: null, + T3: null, + P1: null, + P2: null, + P3: null, + P4: null, + P5: null, + P6: null, + P7: null, + P8: null, + P9: null, + H1: null, + H2: null, + H3: null, + H4: null, + H5: null, + H6: null, + }; + + io.i2cConfig(opts); + + // Page. 24 + // 4.3.2 Register 0xE0 "reset" + io.i2cWrite(address, this.REGISTER.RESET, 0xB6); + + var pCoefficients = new Promise(function(resolveCoeffs) { + + // Page 22, + // Table 16: Compensation parameter storage, naming and data type + // These are received LSB FIRST + // + // The H register is not contiguous! + + + Promise.all([ + new Promise(function(resolve) { + io.i2cReadOnce(address, 0x88, 24, function(data) { + dig.T1 = uint16(data[1], data[0]); + dig.T2 = int16(data[3], data[2]); + dig.T3 = int16(data[5], data[4]); + + dig.P1 = uint16(data[7], data[6]); + dig.P2 = int16(data[9], data[8]); + dig.P3 = int16(data[11], data[10]); + dig.P4 = int16(data[13], data[12]); + dig.P5 = int16(data[15], data[14]); + dig.P6 = int16(data[17], data[16]); + dig.P7 = int16(data[19], data[18]); + dig.P8 = s32(int16(data[21], data[20])); + dig.P9 = s32(int16(data[23], data[22])); + resolve(); + }); + }), + new Promise(function(resolve) { + io.i2cReadOnce(address, 0xA1, 1, function(data) { + dig.H1 = Fn.u8(data[0]); + resolve(); + }); + }), + new Promise(function(resolve) { + io.i2cReadOnce(address, 0xE1, 8, function(data) { + /* + 0xE1 => data[0] + 0xE2 => data[1] + 0xE3 => data[2] + 0xE4 => data[3] + 0xE5 => data[4] + 0xE6 => data[5] + 0xE7 => data[6] + */ + + // 0xE2 0xE1 + // H2 [15:8] [7:0] + dig.H2 = s32(int16(data[1], data[0])); + + // 0xE3 + dig.H3 = s32(data[2]); + + // Special Bit arrangements for H4 & H5 + // + // 0xE5 0xE4 + // H4 [3:0] [11:4] signed short + // 0xE6 0xE5 + // H5 [11:4] [3:0] signed short + + dig.H4 = s32((data[3] << 4) | (data[4] & 0xF)); + dig.H5 = s32((data[5] << 4) | (data[4] >> 4)); + + // 0xE7 + dig.H6 = Fn.s8(data[6]); + + resolve(); + }); + }) + ]).then(resolveCoeffs); + }.bind(this)); + + pCoefficients.then(function() { + /* + Table 19: Register 0xF2 "ctrl_hum" + + Bit 2, 1, 0 + Controls oversampling of humidity + + + osrs_h[2:0] Humidity oversampling + 000 Skipped (output set to 0x8000) + 001 oversampling ×1 + 010 oversampling ×2 + 011 oversampling ×4 + 100 oversampling ×8 + 101, others oversampling ×16 + + | | | HUM | + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + | - | - | - | - | - | - | - | - | + | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | + */ + io.i2cWrite(address, this.REGISTER.MEASURE_H, 0x05); + + /* + Table 22: Register 0xF4 "ctrl_meas" + + Bit 7, 6, 5 + Controls oversampling of temperature data + + Bit 4, 3, 2 + Controls oversampling of pressure data + + Bit 1, 0 + Controls the sensor mode of the device + + + osrs_h[2:0] Humidity oversampling + 000 Skipped (output set to 0x8000) + 001 oversampling ×1 + 010 oversampling ×2 + 011 oversampling ×4 + 100 oversampling ×8 + 101, others oversampling ×16 + + + 000 Skipped (output set to 0x80000) + 001 oversampling ×1 + 010 oversampling ×2 + 011 oversampling ×4 + 100 oversampling ×8 + 101, others oversampling ×16 + + 00 Sleep mode + 01 and 10 Forced mode + 11 Normal mode + + | TEMP | PRES | Mode | + | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + | - | - | - | - | - | - | - | - | + | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | + + */ + io.i2cWrite(address, this.REGISTER.MEASURE_TP, 0xB7); + + + var computed = { + altitude: null, + pressure: null, + humidity: null, + temperature: null, + }; + + // + // Page 12 + // 3.3.1 Pressure measurement + // + // Page 13 + // 3.3.2 Temperature measurement + // + + var standby = Date.now(); + + io.i2cRead(address, this.REGISTER.PRESSURE, 8, function(data) { + // + // Response time to complete 63% of a step is 1 second. + // Don't emit a reading until a complete step has occurred. + // This will be ~1587ms + // (1 / 63 * 100) * 1000 = 1587.3015873015872ms + // if ((standby + 1587) > Date.now()) { + if (!process.env.IS_TEST_MODE) { + if ((standby + 1000) > Date.now()) { + return; + } + } + + var compensated = 0; + + // Page 45 + // "Returns temperature in DegC, double precision. Output value of + // '51.23' equals 51.23 DegC. t_fine carries fine temperature as global value" + var fine; + + // var1, var2 + // + // Expect: + // + // int32 + // + var v1, v2, vx; + + // Page 50 + // "Both pressure and temperature values are expected to be + // received in 20 bit format, positive, stored in a 32 bit signed integer. " + // + // V = int32(uint24(m, l, xl)) + // V >> 4; + // + + // Page 50 + var P = s32(uint24(data[0], data[1], data[2])); + var T = s32(uint24(data[3], data[4], data[5])); + var H = s32(uint16(data[6], data[7])); + + P >>= 4; + T >>= 4; + + // TEMPERATURE + + // Page 23 + // bmp280_compensate_T_int32 + // var1 = ((((adc_T>>3) – ((BMP280_S32_t)dig_T1<<1))) * + // ((BMP280_S32_t)dig_T2)) >> 11; + // var2 = (((((adc_T>>4) – ((BMP280_S32_t)dig_T1)) * + // ((adc_T>>4) – ((BMP280_S32_t)dig_T1))) >> 12) * + // ((BMP280_S32_t)dig_T3)) >> 14; + // + // + var adc16 = T >> 4; + var adc16subT1 = adc16 - dig.T1; + v1 = (((T >> 3) - (dig.T1 << 1)) * dig.T2) >> 11; + v2 = (((adc16subT1 * adc16subT1) >> 12) * dig.T3) >> 14; + + // t_fine = var1 + var2; + fine = v1 + v2; + + // Page 7, 8 + // Table 2: Parameter specification + // + // + // Temperature 0.01 °C + // + // As toFixed(2) + // + // C = +(((t_fine * 5 + 128) >> 8) / 100).toFixed(resolution) + // + computed.temperature = ((fine * 5 + 128) >> 8) / 100; + + v1 = undefined; + v2 = undefined; + + + // PRESSURE + // Page 23 + // bmp280_compensate_P_int32 + // + // Every single seemingly arbitrary magic number comes from the datasheet. + // Datasheets are evidently written by people that don't care about + // anyone else actually understanding how a thing works. + // + + // var1 = (((BMP280_S32_t)t_fine)>>1) – (BMP280_S32_t)64000; + v1 = s32(fine >> 1) - 64000; + + // var2 = (((var1>>2) * (var1>>2)) >> 11 ) * ((BMP280_S32_t)dig_P6); + v2 = (((v1 >> 2) * (v1 >> 2)) >> 11) * s32(dig.P6); + + // var2 = var2 + ((var1*((BMP280_S32_t)dig_P5))<<1); + v2 += (v1 * s32(dig.P5)) << 1; + + // var2 = (var2>>2)+(((BMP280_S32_t)dig_P4)<<16); + v2 = (v2 >> 2) + (s32(dig.P4) << 16); + + + // var1 = (((dig_P3 * (((var1>>2) * (var1>>2)) >> 13 )) >> 3) + + // ((((BMP280_S32_t)dig_P2) * var1)>>1))>>18; + v1 = (((dig.P3 * (((v1 >> 2) * (v1 >> 2)) >> 13)) >> 3) + ((s32(dig.P2) * v1) >> 1)) >> 18; + + // var1 =((((32768+var1))*((BMP280_S32_t)dig_P1))>>15); + v1 = (((Fn.POW_2_15 + v1) * s32(dig.P1)) >> 15); + + if (v1 === 0) { + // Prevent division by zero + return 0; + } + + // p = (((BMP280_U32_t)(((BMP280_S32_t)1048576)-adc_P)-(var2>>12)))*3125; + compensated = u32((s32(Fn.POW_2_20) - P) - (v2 >> 12)) * 3125; + + if (compensated < Fn.POW_2_31) { + // p = (p << 1) / ((BMP280_U32_t)var1); + compensated = ((compensated << 1) >>> 0) / u32(v1); + } else { + // p = (p / (BMP280_U32_t)var1) * 2; + compensated = ((compensated / u32(v1)) >>> 0) * 2; + } + + compensated = u32(compensated) >>> 0; + + // var1 = (((BMP280_S32_t)dig_P9) * ((BMP280_S32_t)(((p>>3) * (p>>3))>>13)))>>12; + var compshift3r = compensated >> 3; + v1 = (s32(dig.P9) * s32(((compshift3r * compshift3r) >> 13))) >> 12; + + // var2 = (((BMP280_S32_t)(p>>2)) * ((BMP280_S32_t)dig_P8))>>13; + v2 = (s32(compensated >> 2) * dig.P8) >> 13; + + // p = (BMP280_U32_t)((BMP280_S32_t)p + ((var1 + var2 + dig_P7) >> 4)); + compensated = u32(s32(compensated) + ((v1 + v2 + dig.P7) >> 4)); + + // Steps of 1Pa (= 0.01hPa = 0.01mbar) (=> 0.001kPa) + computed.pressure = compensated; + + // Calculating pressure at sea level (copied from BMP180) + var seapress = compensated / Math.pow(1 - elevation * 0.0000225577, 5.255); + var altitude = 44330 * (1 - Math.pow(compensated / seapress, 1 / 5.255)); + + // Page 3 + // ...relative accuracy is ±0.12 hPa, which is equivalent to + // ±1 m difference in altitude. + computed.altitude = Math.round(altitude - offset); + + + // Page 23, 24 + // BME280_U32_t bme280_compensate_H_int32(BME280_S32_t adc_H) + + // BME280_S32_t v_x1_u32r; + // v_x1_u32r = (t_fine – ((BME280_S32_t)76800)); + vx = s32(fine - 76800); + + // v_x1_u32r = (((((adc_H << 14) – (((BME280_S32_t)dig_H4) << 20) – (((BME280_S32_t)dig_H5) * v_x1_u32r)) + + // ((BME280_S32_t)16384)) >> 15) * (((((((v_x1_u32r * ((BME280_S32_t)dig_H6)) >> 10) * (((v_x1_u32r * ((BME280_S32_t)dig_H3)) >> 11) + ((BME280_S32_t)32768))) >> 10) + ((BME280_S32_t)2097152)) * + // ((BME280_S32_t)dig_H2) + 8192) >> 14)); + + vx = (((((H << 14) - s32(dig.H4 << 20) - (dig.H5 * vx)) + Fn.POW_2_14) >> 15) * + (((((((vx * dig.H6) >> 10) * (((vx * dig.H3) >> 11) + Fn.POW_2_15)) >> 10) + Fn.POW_2_21) * dig.H2 + Fn.POW_2_13) >> 14)); + + // v_x1_u32r = (v_x1_u32r - (((((v_x1_u32r >> 15) * (v_x1_u32r >> 15)) >> 7) * ((int32_t)_bme280_calib.dig_H1)) >> 4)); + vx -= (((((vx >> 15) * (vx >> 15)) >> 7) * s32(dig.H1) >> 4)); + + // v_x1_u32r = (v_x1_u32r < 0 ? 0 : v_x1_u32r); + // v_x1_u32r = (v_x1_u32r > 419430400 ? 419430400 : v_x1_u32r); + vx = Fn.constrain(vx, 0, 419430400); + + computed.humidity = u32(vx >> 12); + + this.emit("data", computed); + }.bind(this)); + }.bind(this)); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.BME280.ADDRESSES.value[0]; + return "bme280-" + address; + } + } + }, + SI7020: { + ADDRESSES: { + value: [0x40] + }, + REGISTER: { + value: { + HUMIDITY: 0xE5, + TEMPERATURE: 0xE0, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + // The "no hold" measurement requires waiting + // _at least_ 22ms between register write and + // register read. Delay is measured in μs: + // 22ms = 22000μs; recommend 50ms = 50000μs + opts.delay = 50000; + + io.i2cConfig(opts); + + // Reference + // P. 19 + var computed = { + temperature: null, + humidity: null, + }; + + // Despite the registers being back to back, the SI7020 + // does not like when 5 bytes are requested, so we put + // the two data sources on their own read channels. + io.i2cRead(address, this.REGISTER.TEMPERATURE, 2, function(data) { + computed.temperature = uint16(data[0], data[1]); + this.emit("data", computed); + }.bind(this)); + + io.i2cRead(address, this.REGISTER.HUMIDITY, 2, function(data) { + computed.humidity = uint16(data[0], data[1]); + this.emit("data", computed); + }.bind(this)); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.SI7020.ADDRESSES.value[0]; + return "si7020-" + address; + } + }, + }, + + MS5611: { + ADDRESSES: { + value: [0x77] + }, + REGISTER: { + value: { + COEFFICIENTS: 0xA2, + READ: 0x00, + PRESSURE: 0x40, + TEMPERATURE: 0x50, + RESET: 0x1E, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + var elevation = null; + var offset = 0; + + + if (typeof opts.elevation !== "undefined") { + elevation = opts.elevation; + } + + if ((elevation != null && elevation <= 0) || + elevation == null) { + offset = Math.abs(elevation) + 1; + elevation = 1; + } + + opts.address = address; + + var computed = { + altitude: null, + pressure: null, + temperature: null, + }; + + /** + * Page 6 + * + * Startup in I2C Mode + * + * 1. Reset + * 2. Read PROM (128 bits of calibration data) + * 3. D1 Conversion + * 4. D2 Conversion + * 5. Read ADC (24 but pressure/temperature) + */ + var mode = opts.mode || 5; + /* + [ + ULTRA_LOW_POWER + LOW_POWER + STANDARD + HIGH_RES + ULTRA_HIGH_RES * + ] + */ + + var kpDelay = [1, 2, 3, 4, 5, 10][mode]; + + /** + * Page 7 + */ + var cof = { + C1: null, + C2: null, + C3: null, + C4: null, + C5: null, + C6: null, + }; + + var cKeys = Object.keys(cof); + + + // TODO: confirm this is actually necessary? + opts.delay = kpDelay * 1000; + + io.i2cConfig(opts); + io.i2cWrite(address, this.REGISTER.RESET); + + var pCoefficients = new Promise(function(resolve) { + // First, a small delay is required following the reset... + setTimeout(function() { + // Next, each coefficient must be read on it's own. + var cofs = cKeys.map(function(key, index) { + var register = this.REGISTER.COEFFICIENTS + (index * 2); + return new Promise(function(resolve) { + io.i2cReadOnce(address, register, 2, function(data) { + cof[key] = uint16(data[0], data[1]); + resolve(); + }); + }); + }.bind(this)); + + Promise.all(cofs).then(resolve); + }.bind(this), 50); + }.bind(this)); + + pCoefficients.then(function() { + // Page 7, 8 + // + var cycle = 0; + var D1, D2; + var dT, TEMP, OFF, SENS, P; + var TEMP2, OFF2, SENS2; + + var readCycle = function() { + + // cycle 0: temperature + // cycle 1: pressure + + var isTemperatureCycle = cycle === 0; + var component = (isTemperatureCycle ? 0x50 : 0x40) + mode; + + io.i2cWrite(address, component); + + if (isTemperatureCycle) { + D2 = 0; + dT = 0; + TEMP = 0; + TEMP2 = 0; + OFF2 = 0; + SENS2 = 0; + } else { + D1 = 0; + OFF = 0; + SENS = 0; + P = 0; + } + + // Once the READ_START register is set, + // delay the READ_RESULT request based on the + // mode value provided by the user, or default. + setTimeout(function() { + io.i2cReadOnce(address, this.REGISTER.READ, 3, function(data) { + + if (isTemperatureCycle) { + // TEMPERATURE + D2 = uint24(data[0], data[1], data[2]); + + // Calculate temperature + // Page 7 + // Difference between actual and reference temperature [2] + // dT + // = D2 - TREF + // = D2 - C5 * (2 ** 8) + dT = D2 - (cof.C5 * Fn.POW_2_8); + + // Actual temperature (-40…85°C with 0.01°C resolution) + // TEMP + // = 20°C + dT * TEMP * SENS + // = 2000 + dT * C6 / (2 ** 23) + TEMP = 2000 + dT * cof.C6 / Fn.POW_2_23; + + // SECOND ORDER TEMPERATURE COMPENSATION + // Page 8 + // These ridiculous magic numbers come from + // the datasheet. No explanation is given. + // + if (TEMP < 2000) { + TEMP2 = Math.pow(dT, 2) / Fn.POW_2_31; + OFF2 = 5 * Math.pow(TEMP - 2000, 2) / 2; + SENS2 = 5 * Math.pow(TEMP - 2000, 2) / Fn.POW_2_2; + + if (TEMP < -1500) { + OFF2 = OFF2 + 7 * Math.pow(TEMP + 1500, 2); + SENS2 = SENS2 + 11 * Math.pow(TEMP + 1500, 2) / 2; + } + } + + + TEMP -= TEMP2; + + computed.temperature = TEMP / 100; + } else { + // PRESSURE + D1 = uint24(data[0], data[1], data[2]); + + // Offset at actual temperature [3] + // OFF + // = OFFT1 +TCO* dT = C2 * (2 ** 16) + (C4 * dT )/ (2 ** 7) + OFF = cof.C2 * Fn.POW_2_16 + (cof.C4 * dT) / Fn.POW_2_7; + + // Sensitivity at actual temperature [4] + // SENS =SENST1 +TCS* dT= C1 * (2 ** 15) + (C3 * dT )/ (2 ** 8) + SENS = cof.C1 * Fn.POW_2_15 + (cof.C3 * dT) / Fn.POW_2_8; + + // SECOND ORDER TEMPERATURE COMPENSATION + // Page 8 + OFF -= OFF2; + SENS -= SENS2; + + // Temperature compensated pressure (10…1200mbar with 0.01mbar resolution) + // P = D1 * SENS - OFF = (D1 * SENS / 2 21 - OFF) / 2 15 + P = (D1 * SENS / Fn.POW_2_21 - OFF) / Fn.POW_2_15; + + // Steps of 1Pa (= 0.01hPa = 0.01mbar) (=> 0.001kPa) + computed.pressure = P; + + // Sea level pressure... + var seapress = P / Math.pow(1 - elevation * 0.0000225577, 5.255); + var altitude = 44330 * (1 - Math.pow(P / seapress, 1 / 5.255)); + + computed.altitude = altitude - offset; + } + + if (++cycle === 2) { + cycle = 0; + this.emit("data", computed); + } + + readCycle(); + }.bind(this)); + }.bind(this), kpDelay); + }.bind(this); + + // Kick off "read loop" + // + readCycle(); + }.bind(this)); + } + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.MS5611.ADDRESSES.value[0]; + return "ms5611-" + address; + } + }, + }, + + TH02: { + ADDRESSES: { + value: [0x40] + }, + COMMAND: { + value: { + MEASURE_HUMIDITY: 0x01, + MEASURE_TEMPERATURE: 0x11, + } + }, + REGISTER: { + value: { + STATUS: 0x00, + READ: 0x01, + CONFIG: 0x03, + } + }, + initialize: { + value: function(board, opts) { + var io = board.io; + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + var computed = { + temperature: null, + humidity: null, + }; + + var cycle = 0; + + io.i2cConfig( + Object.assign(opts, { + settings: { + stopTX: true + } + }) + ); + + var readCycle = function() { + // 1. Determine which data we want to request + var isTemperatureCycle = cycle === 0; + var command = isTemperatureCycle ? + this.COMMAND.MEASURE_TEMPERATURE : + this.COMMAND.MEASURE_HUMIDITY; + + + var conversion = new Promise(function(resolve) { + // 2. Send the appropriate measurement/conversion + // command for this read cycle. + io.i2cWrite(address, this.REGISTER.CONFIG, command); + + // 3. Await an affirmative status result. This signifies that + // measurement and conversion are complete and values may + // be read from the peripheral register.get + // + // Register design like this is really painful to work + // with. These peripherals have ample space to store data + // in different registers, but do not. + var requestStatus = function() { + io.i2cReadOnce(address, this.REGISTER.STATUS, 1, function(data) { + var status = data[0]; + + if (!(status & 0x01)) { + resolve(); + } else { + requestStatus(); + } + }); + }.bind(this); + + requestStatus(); + }.bind(this)); + + // Page. 16, 18 + // + conversion.then(function() { + // Both values will be placed in the 0x01 after + // the command is received and the measurement taken. + + // The datasheet _SAYS_ read the MSB and LSB from 0x01 and 0x02, + // but in reality, reading from 0x01 produces nothing. Trial and + // error testing resulted in discovering the correct data located + // in 0x02 & 0x03. + // + // One might assume that we could then read 2 bytes from 0x02, + // but that also produces garbage, so in the end we need to read + // 3 bytes from 0x01. + Promise.all([ + new Promise(function(resolve) { + io.i2cReadOnce(address, 0x01, 1, function(data) { + resolve(data[0]); + }); + }), + new Promise(function(resolve) { + io.i2cReadOnce(address, 0x02, 1, function(data) { + resolve(data[0]); + }); + }) + ]).then(function(data) { + + if (isTemperatureCycle) { + computed.temperature = ((uint16(data[0], data[1]) >> 2) / 32) - 50; + } else { + computed.humidity = ((uint16(data[0], data[1]) >> 4) / 16) - 24; + } + + if (++cycle === 2) { + cycle = 0; + this.emit("data", computed); + } + + readCycle(); + }.bind(this)); + }.bind(this)); + }.bind(this); + + readCycle(); + }, + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.TH02.ADDRESSES.value[0]; + return "th02-" + address; + } + } + }, + + /** + * LSM303C: 6Dof 3-Axis Magnetometer & Accelerometer + * + * https://learn.sparkfun.com/tutorials/lsm303c-6dof-hookup-guide + * https://github.com/sparkfun/LSM303C_6_DOF_IMU_Breakout + */ + LSM303C: { + ADDRESSES: { + value: { + ACC: 0x1D, + MAG: 0x1E + } + }, + COMMAND: { + value: { + ACC_SETUP: [0x4, 0x3F, 0x3F, 0x3F], + MAG_SETUP: [0xD8, 0x60, 0x40, 0xD8, 0x8, 0x00] + } + }, + REGISTER: { + value: { + ACC_CTRL_SEQ: [0x23, 0x20, 0x20, 0x20], + ACC_STATUS: 0x27, + ACC_OUTX_L: 0x28, + ACC_OUTX_H: 0x29, + ACC_OUTY_L: 0x2A, + ACC_OUTY_H: 0x2B, + ACC_OUTZ_L: 0x2C, + ACC_OUTZ_H: 0x2D, + MAG_CTRL_SEQ: [0x20, 0x21, 0x24, 0x20, 0x23, 0x22], + MAG_STATUS: 0x27, + MAG_OUTX_L: 0x28, + MAG_OUTX_H: 0x29, + MAG_OUTY_L: 0x2A, + MAG_OUTY_H: 0x2B, + MAG_OUTZ_L: 0x2C, + MAG_OUTZ_H: 0x2D, + MAG_TEMP_OUT_L: 0x2E, + MAG_TEMP_OUT_H: 0x2F, + } + }, + initialize: { + value: function(board, opts) { + + var ACC_SENSITIVITY = 0.06103515625; // LSB/mg + var MAG_SENSITIVITY = 0.00048828125; // LSB/Ga + + var io = board.io; + var frequency = this.freq || 40; + var addresses = this.ADDRESSES; + + var accelerometer = {}; + var magnetometer = {}; + var computed = { + temperature: 0, + magnetometer, + accelerometer + }; + + // ACC Initialization sequence (4 bytes) + var initializeAccelerometer = function() { + io.i2cConfig(Object.assign({}, opts, { address: addresses.ACC })); + this.REGISTER.ACC_CTRL_SEQ + .forEach(function(ctrlReg, i) { + io.i2cWrite(addresses.ACC, ctrlReg, this.COMMAND.ACC_SETUP[i]); + }.bind(this)); + }.bind(this); + + // MAG Initialization sequence (6 bytes) + var initializeMagnetometer = function() { + io.i2cConfig(Object.assign({}, opts, { address: addresses.MAG })); + this.REGISTER.MAG_CTRL_SEQ + .forEach(function (ctrlReg, i) { + io.i2cWrite(addresses.MAG, ctrlReg, this.COMMAND.MAG_SETUP[i]); + }.bind(this)); + }.bind(this); + + var readAccelerometer = function(done) { + io.i2cReadOnce(addresses.ACC, this.REGISTER.ACC_OUTX_L, 6, function(data) { + accelerometer.x = int16(data[1], data[0]) * ACC_SENSITIVITY; + accelerometer.y = int16(data[3], data[2]) * ACC_SENSITIVITY; + accelerometer.z = int16(data[5], data[4]) * ACC_SENSITIVITY; + done(); + }); + }.bind(this); + + var readMagnetometer = function(done) { + io.i2cReadOnce(addresses.MAG, this.REGISTER.MAG_OUTX_L, 6, function(data) { + magnetometer.x = int16(data[1], data[0]) * MAG_SENSITIVITY; + magnetometer.y = int16(data[3], data[2]) * MAG_SENSITIVITY; + magnetometer.z = int16(data[5], data[4]) * MAG_SENSITIVITY; + done(); + }); + }.bind(this); + + var readTemperature = function(done) { + io.i2cReadOnce(addresses.MAG, this.REGISTER.MAG_TEMP_OUT_L, 2, function(data) { + computed.temperature = int16(data[1], data[0]); + done(); + }); + }.bind(this); + + // Rinse and repeat + var readCycle = function() { + Promise.all([ + new Promise(readAccelerometer), + new Promise(readMagnetometer), + new Promise(readTemperature) + ]) + .then(function() { + this.emit("data", computed); + setTimeout(readCycle, frequency); + }.bind(this)); + }.bind(this); + + // Kick off + initializeAccelerometer(); + initializeMagnetometer(); + readCycle(); + }, + }, + identifier: { + value: function(opts) { + var address = opts.address || Drivers.LSM303C.ADDRESSES.value[0]; + return "lsm303c-" + address; + } + } + }, +}; + +// Otherwise known as... +Drivers.BMP085 = Drivers.BMP180; +Drivers.GY521 = Drivers.MPU6050; +Drivers.SI7021 = Drivers.SI7020; +Drivers.DHT11_I2C_NANO_BACKPACK = Drivers.DHT_I2C_NANO_BACKPACK; +Drivers.DHT21_I2C_NANO_BACKPACK = Drivers.DHT_I2C_NANO_BACKPACK; +Drivers.DHT22_I2C_NANO_BACKPACK = Drivers.DHT_I2C_NANO_BACKPACK; + + +Drivers.get = function(board, driverName, opts) { + var drivers, driverKey, driver; + + if (!activeDrivers.has(board)) { + activeDrivers.set(board, {}); + } + + opts = opts || {}; + + drivers = activeDrivers.get(board); + driverKey = Drivers[driverName].identifier.value(opts); + + if (!drivers[driverKey]) { + driver = new Emitter(); + Object.defineProperties(driver, Drivers[driverName]); + driver.initialize(board, opts); + drivers[driverKey] = driver; + } + + return drivers[driverKey]; +}; + +Drivers.clear = function() { + activeDrivers.clear(); +}; + +var Controllers = { + /** + * MPU6050 3-axis Gyro/Accelerometer and Thermometer + * + * http://playground.arduino.cc/Main/MPU6050 + */ + + MPU6050: { + initialize: { + value: function(opts) { + Components.call(this, "MPU6050", opts); + } + }, + components: { + value: [ACCELEROMETER, GYRO, THERMOMETER] + }, + }, + + BNO055: { + initialize: { + value: function(opts) { + var state = priv.get(this); + var CONTROLLER = "BNO055"; + + state.calibrationMask = opts.calibrationMask || 0xC0; + + // here we want to catch the events coming out of the driver and re-emit them + // not sure what is cleaner here, picking these up from a data event + // in the sub controllers, or this + var driver = Drivers.get(this.board, CONTROLLER, opts); + driver.on("calibrated", function() { + this.emit("calibrated"); + }.bind(this)); + + driver.on("calibration", function(state) { + this.emit("calibration", state); + }.bind(this)); + + Components.call(this, CONTROLLER, opts); + } + }, + components: { + value: [ACCELEROMETER, GYRO, MAGNETOMETER, ORIENTATION, THERMOMETER] + }, + calibration: { + get: function() { + return this.orientation.calibration; + } + }, + isCalibrated: { + get: function() { + //returns if the system and all sensors are fully calibrated + var calibrationMask = priv.get(this).calibrationMask; + return (this.orientation.calibration & calibrationMask) === calibrationMask; + } + } + }, + MPL115A2: { + initialize: { + value: function(opts) { + Components.call(this, "MPL115A2", opts); + } + }, + components: { + value: [BAROMETER, THERMOMETER] + }, + }, + SHT31D: { + initialize: { + value: function(opts) { + Components.call(this, "SHT31D", opts); + } + }, + components: { + value: [HYGROMETER, THERMOMETER] + }, + }, + HTU21D: { + initialize: { + value: function(opts) { + Components.call(this, "HTU21D", opts); + } + }, + components: { + value: [HYGROMETER, THERMOMETER] + }, + }, + HIH6130: { + initialize: { + value: function(opts) { + Components.call(this, "HIH6130", opts); + } + }, + components: { + value: [HYGROMETER, THERMOMETER] + }, + }, + DHT_I2C_NANO_BACKPACK: { + initialize: { + value: function(opts) { + Components.call(this, "DHT_I2C_NANO_BACKPACK", opts); + } + }, + components: { + value: [HYGROMETER, THERMOMETER] + }, + }, + MPL3115A2: { + initialize: { + value: function(opts) { + Components.call(this, "MPL3115A2", opts); + } + }, + components: { + value: [ALTIMETER, BAROMETER, THERMOMETER] + }, + }, + // This controller and driver pair are used for both + // BMP180 and BMP085 + BMP180: { + initialize: { + value: function(opts) { + Components.call(this, "BMP180", opts); + } + }, + components: { + value: [ALTIMETER, BAROMETER, THERMOMETER] + }, + }, + BMP280: { + initialize: { + value: function(opts) { + Components.call(this, "BMP280", opts); + } + }, + components: { + value: [ALTIMETER, BAROMETER, THERMOMETER] + }, + }, + BME280: { + initialize: { + value: function(opts) { + Components.call(this, "BME280", opts); + } + }, + components: { + value: [ALTIMETER, BAROMETER, HYGROMETER, THERMOMETER] + }, + }, + SI7020: { + initialize: { + value: function(opts) { + Components.call(this, "SI7020", opts); + } + }, + components: { + value: [HYGROMETER, THERMOMETER] + }, + }, + MS5611: { + initialize: { + value: function(opts) { + Components.call(this, "MS5611", opts); + } + }, + components: { + value: [ALTIMETER, BAROMETER, THERMOMETER] + }, + }, + + TH02: { + initialize: { + value: function(opts) { + Components.call(this, "TH02", opts); + } + }, + components: { + value: [HYGROMETER, THERMOMETER] + }, + }, + + LSM303C: { + initialize: { + value: function(opts) { + Components.call(this, "LSM303C", opts); + } + }, + components: { + value: [MAGNETOMETER, THERMOMETER, ACCELEROMETER] + }, + }, +}; + +// Otherwise known as... +Controllers.BMP085 = Controllers.BMP180; +Controllers.GY521 = Controllers.MPU6050; +Controllers.SI7021 = Controllers.SI7020; +Controllers.DHT11_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; +Controllers.DHT21_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; +Controllers.DHT22_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; + + +function IMU(opts) { + + if (!(this instanceof IMU)) { + return new IMU(opts); + } + + var controller, state; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + throw new Error("Missing IMU/Multi controller"); + } + + this.freq = opts.freq || 20; + + state = {}; + priv.set(this, state); + + Board.Controller.call(this, controller, opts); + + if (typeof this.initialize === "function") { + this.initialize(opts); + } + + // The IMU/Multi isn't considered "ready" + // until one of the components has notified via + // a change event. + this.isReady = false; + + setInterval(function() { + if (this.isReady) { + this.emit("data", this); + } + }.bind(this), this.freq); + + var awaiting = this.components.slice(); + + if (this.components && this.components.length > 0) { + this.components.forEach(function(component) { + if (!(this[component] instanceof Emitter)) { + return; + } + + this[component].on("change", function() { + if (awaiting.length) { + var index = awaiting.indexOf(component); + + if (index !== -1) { + awaiting.splice(index, 1); + } + } + + if (!awaiting.length && !this.isReady) { + this.isReady = true; + } + + if (this.isReady) { + this.emit("change", this, component); + } + }.bind(this)); + }, this); + } +} + +util.inherits(IMU, Emitter); + +IMU.Drivers = Drivers; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + IMU.Controllers = Controllers; + IMU.purge = function() { + priv.clear(); + }; +} + +module.exports = IMU; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.js new file mode 100644 index 00000000..7db63f70 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.js @@ -0,0 +1,163 @@ +/* istanbul ignore if */ +if (!Array.prototype.includes) { + require("./array-includes-shim"); +} + +module.exports = { + // extract-start:apinames + Accelerometer: require("./accelerometer"), + Animation: require("./animation"), + Altimeter: require("./altimeter"), + Barometer: require("./barometer"), + Board: require("./board"), + Button: require("./button"), + Color: require("./color"), + Collection: require("./mixins/collection"), + Compass: require("./compass"), + ESC: require("./esc"), + Expander: require("./expander"), + Fn: require("./fn"), + GPS: require("./gps"), + Gripper: require("./gripper"), + Gyro: require("./gyro"), + Hygrometer: require("./hygrometer"), + IMU: require("./imu"), + Keypad: require("./keypad"), + LCD: require("./lcd"), + Led: require("./led"), + LedControl: require("./led/ledcontrol"), + Light: require("./light"), + Joystick: require("./joystick"), + Motion: require("./motion"), + Motor: require("./motor"), + Orientation: require("./orientation"), + Piezo: require("./piezo"), + Ping: require("./ping"), + Pin: require("./pin"), + Proximity: require("./proximity"), + Relay: require("./relay"), + Repl: require("./repl"), + Sensor: require("./sensor"), + Servo: require("./servo"), + ShiftRegister: require("./shiftregister"), + Sonar: require("./sonar"), + Stepper: require("./stepper"), + Switch: require("./switch"), + Thermometer: require("./thermometer"), + Wii: require("./wii") + // extract-end:apinames +}; + +// Customized constructors +// +// +module.exports.Board.Virtual = function(opts) { + var temp; + + if (opts instanceof module.exports.Expander) { + temp = { + io: opts + }; + } else { + temp = opts; + } + + return new module.exports.Board( + Object.assign({}, { + repl: false, + debug: false, + sigint: false + }, temp) + ); +}; + +module.exports.Multi = module.exports.IMU; + +module.exports.Analog = function(opts) { + return new module.exports.Sensor(opts); +}; + +module.exports.Digital = function(opts) { + var pin; + + if (typeof opts === "number" || typeof opts === "string") { + pin = opts; + opts = { + type: "digital", + pin: pin + }; + } else { + opts.type = opts.type || "digital"; + } + + return new module.exports.Sensor(opts); +}; + +module.exports.Sensor.Analog = module.exports.Analog; +module.exports.Sensor.Digital = module.exports.Digital; + +/** + * @deprecated Will be deleted in version 1.0.0. Use Thermometer instead. + */ +module.exports.Temperature = module.exports.Thermometer; + + +/** + * @deprecated Will be deleted in version 1.0.0. Use Motion or Proximity instead. + */ +module.exports.IR = function() { + throw new Error("IR has been removed. Use Motion or Proximity instead."); +}; + +/** + * @deprecated Will be deleted in version 1.0.0. Use Proximity instead. + */ +module.exports.IR.Distance = function() { + throw new Error("IR.Distance has been removed. Use Proximity instead."); +}; + +/** + * @deprecated Will be deleted in version 1.0.0. Use Proximity instead. + */ +module.exports.IR.Proximity = function() { + throw new Error("IR.Proximity has been removed. Use Proximity instead."); +}; + +/** + * @deprecated Will be deleted in version 1.0.0. Use Motion instead. + */ +module.exports.IR.Motion = function() { + throw new Error("IR.Motion has been removed. Use Motion instead."); +}; + +// TODO: Eliminate .Array for 1.0.0 +module.exports.IR.Reflect = {}; +module.exports.IR.Reflect.Array = require("./reflectancearray"); +module.exports.IR.Reflect.Collection = module.exports.IR.Reflect.Array; + +module.exports.Luxmeter = function(options) { + return new module.exports.Light(options); +}; + +module.exports.Magnetometer = function(options) { + return new module.exports.Compass(options); +}; + +// Short-handing, Aliases +module.exports.Boards = module.exports.Board.Collection; +module.exports.Buttons = module.exports.Button.Collection; +module.exports.ESCs = module.exports.ESC.Collection; +module.exports.Leds = module.exports.Led.Collection; +module.exports.Led.RGBs = module.exports.Led.RGB.Collection; +module.exports.Motors = module.exports.Motor.Collection; +module.exports.Pins = module.exports.Pin.Collection; +module.exports.Relays = module.exports.Relay.Collection; +module.exports.Sensors = module.exports.Sensor.Collection; +module.exports.Servos = module.exports.Servo.Collection; +module.exports.Switches = module.exports.Switch.Collection; + +// Direct Alias +module.exports.Touchpad = module.exports.Keypad; + +// Back Compat +module.exports.Nunchuk = module.exports.Wii.Nunchuk; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.sublime-project b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.sublime-project new file mode 100644 index 00000000..cdba8b83 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.sublime-project @@ -0,0 +1,8 @@ +{ + "folders": + [ + { + "path": "/Users/rwaldron/clonez/johnny-five" + } + ] +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.sublime-workspace b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.sublime-workspace new file mode 100644 index 00000000..3b63c19d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/johnny-five.sublime-workspace @@ -0,0 +1,2405 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "digital", + "digitalRead" + ], + [ + "res", + "result" + ], + [ + "meta", + "meta_features" + ], + [ + "feat", + "featuresList" + ], + [ + "met", + "meta_features" + ], + [ + "char", + "character" + ], + [ + "asyn", + "asyncIterable" + ], + [ + "iter", + "iterResult" + ], + [ + "re", + "return-value" + ], + [ + "it", + "IteratorResult" + ], + [ + "ass", + "assert" + ], + [ + "T", + "Test262Error" + ], + [ + "Type", + "TypeError" + ], + [ + "ne", + "nextCount" + ], + [ + "A", + "ArrayBuffer" + ], + [ + "call", + "callCount" + ], + [ + "B", + "BH1750" + ], + [ + "does", + "doesNotThrow" + ], + [ + "sec", + "secondsPerStep" + ], + [ + "MI", + "MICROSTEPS" + ], + [ + "te", + "test" + ], + [ + "se", + "sentence" + ], + [ + "port", + "portId" + ], + [ + "int", + "inherits" + ], + [ + "inst", + "installMethodForwarding" + ], + [ + "MP", + "MPR121_SHIELD" + ], + [ + "start", + "startsWith" + ], + [ + "ShiftR", + "ShiftRegister" + ], + [ + "sc", + "scale" + ], + [ + "dh", + "dhtType" + ], + [ + "i2c", + "i2cWrite" + ], + [ + "p", + "println" + ], + [ + "cl", + "cl\tcl" + ], + [ + "ca", + "calibration" + ], + [ + "com", + "component" + ], + [ + "mag", + "magnetometer" + ], + [ + "ali", + "altimeter" + ], + [ + "TEMP", + "TEMPERATURE" + ], + [ + "co", + "component" + ], + [ + "ther", + "thermometer" + ], + [ + "to", + "toFixed" + ], + [ + "ch", + "chScales" + ], + [ + "data", + "dataHandler" + ], + [ + "Tin", + "TintMs" + ], + [ + "las", + "lastCall" + ], + [ + "c", + "cl\tconsole.log" + ], + [ + "cons", + "console" + ], + [ + "on", + "oncomplete" + ], + [ + "Ini", + "Infinity" + ], + [ + "def", + "defaultTarget" + ], + [ + "in", + "interval" + ], + [ + "Pre", + "Previewer" + ], + [ + "loop", + "loopFunction" + ], + [ + "next", + "nextTick" + ], + [ + "cal", + "callCount" + ], + [ + "sp", + "spy" + ], + [ + "sta", + "startTime" + ], + [ + "0x", + "0xff" + ], + [ + "loo", + "loopFunction" + ], + [ + "pro", + "progress" + ], + [ + "proto", + "prototype" + ], + [ + "segm", + "segment" + ], + [ + "seg", + "segment" + ], + [ + "Se", + "segment" + ], + [ + "e", + "enqueue" + ], + [ + "curr", + "currentSpeed" + ], + [ + "BMP8", + "BMP180" + ], + [ + "prop", + "property" + ], + [ + "func", + "function" + ], + [ + "comp", + "component" + ], + [ + "num", + "numsOrObjects" + ], + [ + "deep", + "deepEqual" + ], + [ + "sa", + "samplingInterval" + ], + [ + "thr", + "throw" + ], + [ + "alti", + "altimeter" + ], + [ + "al", + "all" + ], + [ + "has", + "hasAxis" + ], + [ + "acce", + "accelerometer" + ], + [ + "this", + "thisEmitTime" + ], + [ + "i2cW", + "i2cWrite" + ], + [ + "ex", + "expander" + ], + [ + "i2", + "i2cWrite" + ], + [ + "defin", + "defineProperties" + ], + [ + "retur", + "returnValue" + ], + [ + "col", + "colHz" + ], + [ + "I", + "I2C_BACKPACK" + ], + [ + "i2Co", + "i2cConfig" + ], + [ + "con", + "controller" + ], + [ + "buffer", + "BUFFER_SIZE" + ], + [ + "confi", + "configuration" + ], + [ + "Led", + "LedControl" + ], + [ + "fu", + "function" + ], + [ + "instance", + "instanceof" + ], + [ + "defa", + "defaultOctave" + ], + [ + "fun", + "func\tfunction" + ], + [ + "bl", + "blink" + ], + [ + "To", + "ToRGB" + ], + [ + "dat", + "dataHandler" + ], + [ + "An", + "Animation" + ], + [ + "norma", + "normalized" + ], + [ + "normal", + "normalize" + ], + [ + "key", + "keyFrame" + ], + [ + "stat", + "status" + ], + [ + "X", + "XYZ_DATA_CFG" + ], + [ + "Si", + "SI7020" + ], + [ + "M", + "MPL3115A2" + ], + [ + "SH", + "SHT31D" + ], + [ + "MMA", + "MMA8452" + ], + [ + "th", + "threshold" + ], + [ + "de", + "degrees" + ], + [ + "repl", + "replyBuffer" + ], + [ + "o", + "offsets" + ], + [ + "isC", + "isCalibrated" + ], + [ + "is", + "isTemperatureCycle" + ], + [ + "cop", + "compensated" + ], + [ + "constr", + "constrain" + ], + [ + "print", + "println" + ], + [ + "use", + "useFakeTimers" + ], + [ + "exp", + "expect" + ], + [ + "sea", + "seapress" + ], + [ + "Co", + "Coefficients" + ], + [ + "h", + "hrstart" + ], + [ + "set", + "setTimeout" + ], + [ + "sandb", + "sandbox" + ], + [ + "report", + "reportversion" + ], + [ + "ana", + "analogRead" + ], + [ + "new", + "newBoard" + ], + [ + "random10B", + "random10bv" + ] + ] + }, + "buffers": + [ + { + "file": "button.js", + "settings": + { + "buffer_size": 8938, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/eg/stepper-driver.js", + "settings": + { + "buffer_size": 1435, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "contents": "ECMAScript 2015 Internationalization API Specification (Standard ECMA-402 2nd Edition / June 2015)\n\n\n\nECMAScript Internationalization API Specification (Standard ECMA-402 1st Edition / December 2012)\n\n\n\nECMAScript® 2015 Language Specification (Standard ECMA-262 6th Edition / June 2015)\n\n\n\nTest262: ECMAScript Test Suite (ECMA TR/104) http://ecma-international.org/publications/techreports/E-TR-104.htm http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-414.pdf", + "settings": + { + "buffer_size": 476, + "line_ending": "Unix", + "name": "ECMAScript 2015 Internationalization API Specifica" + } + }, + { + "contents": "function sleep(delay) {\n var start = Date.now();\n while (Date.now() < start + delay);\n}", + "settings": + { + "buffer_size": 89, + "line_ending": "Unix" + } + }, + { + "contents": "function each(items, callback) {\n items.forEach(callback)\n}\n\n\neach([1, 2, 3], (() => {\n // ...\n})); \n", + "settings": + { + "buffer_size": 103, + "line_ending": "Unix", + "name": "function each(items, callback) {" + } + }, + { + "file": "/Users/rwaldron/Downloads/customfirmata/customfirmata.ino", + "settings": + { + "buffer_size": 1877, + "line_ending": "Unix" + } + }, + { + "file": "imu.js", + "settings": + { + "buffer_size": 79312, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/package.json", + "settings": + { + "buffer_size": 8785, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/test/thermometer.js", + "settings": + { + "buffer_size": 46827, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "thermometer.js", + "settings": + { + "buffer_size": 28682, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "servo.js", + "settings": + { + "buffer_size": 15407, + "line_ending": "Unix" + } + }, + { + "file": "sensor.js", + "settings": + { + "buffer_size": 10565, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "contents": "const SI = 1.70158;\nconst SIO = 1.70158 * 1.525;\nconst SB = 7.5625;\nconst HALF = 0.5;\n\nexports.linear = n => n;\n\nexports.inQuad = n => n * n;\n\nexports.outQuad = n => n * (2 - n);\n\nexports.inOutQuad = n => {\n n *= 2;\n if (n < 1) return HALF * n * n;\n return -HALF * (--n * (n - 2) - 1);\n};\n\nexports.inCube = n => n * n * n;\n\nexports.outCube = n => --n * n * n + 1;\n\nexports.inOutCube = n => {\n n *= 2;\n if (n < 1) return HALF * n * n * n;\n return HALF * ((n -= 2) * n * n + 2);\n};\n\nexports.inQuart = n => n * n * n * n;\n\nexports.outQuart = n => 1 - (--n * n * n * n);\n\nexports.inOutQuart = n => {\n n *= 2;\n if (n < 1) return HALF * n * n * n * n;\n return -HALF * ((n -= 2) * n * n * n - 2);\n};\n\nexports.inQuint = n => n * n * n * n * n\n}\n\nexports.outQuint = n => --n * n * n * n * n + 1\n}\n\nexports.inOutQuint = n => {\n n *= 2;\n if (n < 1) return HALF * n * n * n * n * n;\n return HALF * ((n -= 2) * n * n * n * n + 2);\n};\n\nexports.inSine = n => 1 - Math.cos(n * Math.PI / 2);\n\nexports.outSine = n => Math.sin(n * Math.PI / 2);\n\nexports.inOutSine = n => HALF * (1 - Math.cos(Math.PI * n));\n\nexports.inExpo = n => 0 == n ? 0 : Math.pow(1024, n - 1);\n\nexports.outExpo = n => 1 == n ? n : 1 - Math.pow(2, -10 * n);\n\nexports.inOutExpo = n => {\n if (0 == n) return 0;\n if (1 == n) return 1;\n if ((n *= 2) < 1) return HALF * Math.pow(1024, n - 1);\n return HALF * (-Math.pow(2, -10 * (n - 1)) + 2);\n};\n\nexports.inCirc = n => 1 - Math.sqrt(1 - n * n);\n\nexports.outCirc = n => Math.sqrt(1 - (--n * n));\n\nexports.inOutCirc = n => {\n n *= 2\n if (n < 1) return -HALF * (Math.sqrt(1 - n * n) - 1);\n return HALF * (Math.sqrt(1 - (n -= 2) * n) + 1);\n};\n\nexports.inBack = n => {\n return n * n * ((SI + 1) * n - SI);\n};\n\nexports.outBack = n => {\n return --n * n * ((SI + 1) * n + SI) + 1;\n};\n\nexports.inOutBack = n => {\n if ((n *= 2) < 1) return HALF * (n * n * ((SIO + 1) * n - SIO));\n return HALF * ((n -= 2) * n * ((SIO + 1) * n + SIO) + 2);\n};\n\nexports.outBounce = n => {\n if (n < (1 / 2.75)) {\n return SB * n * n;\n } else if (n < (2 / 2.75)) {\n return SB * (n -= (1.5 / 2.75)) * n + 0.75;\n } else if (n < (2.5 / 2.75)) {\n return SB * (n -= (2.25 / 2.75)) * n + 0.9375;\n } else {\n return SB * (n -= (2.625 / 2.75)) * n + 0.984375;\n }\n};\n\nexports.inBounce = n => 1 - exports.outBounce(1 - n);\nexports.inOutBounce = n => {\n return n < HALF ? exports.inBounce(n * 2) * HALF : exports.outBounce(n * 2 - 1) * HALF + HALF;\n};\n", + "file": "utils/easing.js", + "file_size": 2446, + "file_write_time": 131580948731805796, + "settings": + { + "buffer_size": 2446, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/tpl/.readme.md", + "settings": + { + "buffer_size": 9791, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/Gruntfile.js", + "settings": + { + "buffer_size": 15027, + "line_ending": "Unix" + } + }, + { + "file": "johnny-five.js", + "settings": + { + "buffer_size": 4426, + "line_ending": "Unix" + } + }, + { + "file": "accelerometer.js", + "settings": + { + "buffer_size": 30662, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "board.js", + "settings": + { + "buffer_size": 31512, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/.travis.yml", + "settings": + { + "buffer_size": 610, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/test/animation.js", + "settings": + { + "buffer_size": 27620, + "line_ending": "Unix" + } + }, + { + "contents": "#include \n\n#define DEBUG_MODE 1\n\n#define DEFAULT_ADDRESS 0x20\n\n// Registers\n#define IODIR 0x00\n#define GPPU 0x06\n#define GPIO 0x09\n\nint pins[7] = {8, 7, 6, 5, 4, 3, 2};\nint iodir[7] = {1, 1, 1, 1, 1, 1, 1};\n\nbyte buffer[1];\nbyte reg;\nbyte state;\n\n\nvoid resetGPIO() {\n //1 = Pin is configured as an input.\n //0 = Pin is configured as an output.\n\n for (int i = 0; i < 7; i++) {\n pinMode(pins[i], INPUT);\n digitalWrite(pins[i], LOW);\n }\n}\n\nint readGPIO() {\n byte portValue;\n\n \n for (int i = 0; i < 7; i++) {\n if (iodir[i] == 1) {\n if (digitalRead(pins[i])) {\n portValue |= 1 << i;\n } else {\n portValue &= ~(1 << i);\n }\n }\n }\n\n return portValue;\n}\n\nvoid setup() {\n #if DEBUG_MODE\n Serial.begin(9600);\n #endif\n\n resetGPIO();\n\n Wire.begin((int)DEFAULT_ADDRESS);\n Wire.onRequest(onRequest);\n Wire.onReceive(onReceive);\n}\n\nvoid loop() {\n\n if (reg == IODIR) {\n for (int i = 0; i < 7; i++) {\n iodir[i] = (state >> i) & 1;\n }\n }\n\n buffer[0] = readGPIO();\n\n delay(10);\n}\n\nvoid onRequest() {\n Wire.write(buffer, 1);\n}\n\nvoid onReceive(int howMany) {\n\n if (howMany > 0) {\n reg = (byte)Wire.read();\n }\n\n if (howMany > 1) {\n state = (byte)Wire.read();\n buffer[0] = state;\n }\n\n\n // if (howMany == 2) {\n // // Do a write\n // } else {\n // if (howMany == 1) {\n // // Do a read\n // }\n // }\n\n\n #if DEBUG_MODE\n Serial.println(howMany);\n Serial.print(\"reg: \");\n Serial.print(reg);\n Serial.print(\": \");\n Serial.print(state);\n Serial.println(\"--------------------\");\n #endif\n}\n\n", + "settings": + { + "buffer_size": 1584, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/appveyor.yml", + "settings": + { + "buffer_size": 299, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "contents": "fatal: [johnny-five.io]: FAILED! => {\"changed\": true, \"cmd\": \"npm run build\", \"delta\": \"0:00:01.114390\", \"end\": \"2017-10-26 14:59:07.866199\", \"failed\": true, \"rc\": 1, \"start\": \"2017-10-26 14:59:06.751809\", \"stderr\": \"\\nnpm ERR! Linux 3.13.0-85-generic\\nnpm ERR! argv \\\"node\\\" \\\"/usr/bin/npm\\\" \\\"run\\\" \\\"build\\\"\\nnpm ERR! node v0.12.13\\nnpm ERR! npm v3.8.6\\nnpm ERR! code ELIFECYCLE\\nnpm ERR! johnny-five.io@0.0.1 build: `grunt bootstrap && grunt regen && grunt`\\nnpm ERR! Exit status 3\\nnpm ERR! \\nnpm ERR! Failed at the johnny-five.io@0.0.1 build script 'grunt bootstrap && grunt regen && grunt'.\\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\\nnpm ERR! If you do, this is most likely a problem with the johnny-five.io package,\\nnpm ERR! not with npm itself.\\nnpm ERR! Tell the author that this fails on your system:\\nnpm ERR! grunt bootstrap && grunt regen && grunt\\nnpm ERR! You can get information on how to open an issue for this project with:\\nnpm ERR! npm bugs johnny-five.io\\nnpm ERR! Or if that isn't available, you can get their info via:\\nnpm ERR! npm owner ls johnny-five.io\\nnpm ERR! There is likely additional logging output above.\\n\\nnpm ERR! Please include the following file with any support request:\\nnpm ERR! /mnt/temp/npm-debug.log\", \"stderr_lines\": [\"\", \"npm ERR! Linux 3.13.0-85-generic\", \"npm ERR! argv \\\"node\\\" \\\"/usr/bin/npm\\\" \\\"run\\\" \\\"build\\\"\", \"npm ERR! node v0.12.13\", \"npm ERR! npm v3.8.6\", \"npm ERR! code ELIFECYCLE\", \"npm ERR! johnny-five.io@0.0.1 build: `grunt bootstrap && grunt regen && grunt`\", \"npm ERR! Exit status 3\", \"npm ERR! \", \"npm ERR! Failed at the johnny-five.io@0.0.1 build script 'grunt bootstrap && grunt regen && grunt'.\", \"npm ERR! Make sure you have the latest version of node.js and npm installed.\", \"npm ERR! If you do, this is most likely a problem with the johnny-five.io package,\", \"npm ERR! not with npm itself.\", \"npm ERR! Tell the author that this fails on your system:\", \"npm ERR! grunt bootstrap && grunt regen && grunt\", \"npm ERR! You can get information on how to open an issue for this project with:\", \"npm ERR! npm bugs johnny-five.io\", \"npm ERR! Or if that isn't available, you can get their info via:\", \"npm ERR! npm owner ls johnny-five.io\", \"npm ERR! There is likely additional logging output above.\", \"\", \"npm ERR! Please include the following file with any support request:\", \"npm ERR! /mnt/temp/npm-debug.log\"], \"stdout\": \"\\n> johnny-five.io@0.0.1 build /mnt/temp\\n> grunt bootstrap && grunt regen && grunt\\n\\nLoading \\\"Gruntfile.js\\\" tasks...\\u001b[31mERROR\\u001b[39m\\n\\u001b[31m>> \\u001b[39mSyntaxError: /mnt/temp/node_modules/boom/lib/index.js:5\\u001b[31m\\n>> \\u001b[39mconst Hoek = require('hoek');\\u001b[31m\\n>> \\u001b[39m^^^^^\\u001b[31m\\n>> \\u001b[39mUse of const in strict mode.\\n\\u001b[33mWarning: Task \\\"bootstrap\\\" not found.\\u0007 Use --force to continue.\\u001b[39m\\n\\n\\u001b[31mAborted due to warnings.\\u001b[39m\", \"stdout_lines\": [\"\", \"> johnny-five.io@0.0.1 build /mnt/temp\", \"> grunt bootstrap && grunt regen && grunt\", \"\", \"Loading \\\"Gruntfile.js\\\" tasks...\\u001b[31mERROR\\u001b[39m\", \"\\u001b[31m>> \\u001b[39mSyntaxError: /mnt/temp/node_modules/boom/lib/index.js:5\\u001b[31m\", \">> \\u001b[39mconst Hoek = require('hoek');\\u001b[31m\", \">> \\u001b[39m^^^^^\\u001b[31m\", \">> \\u001b[39mUse of const in strict mode.\", \"\\u001b[33mWarning: Task \\\"bootstrap\\\" not found.\\u0007 Use --force to continue.\\u001b[39m\", \"\", \"\\u001b[31mAborted due to warnings.\\u001b[39m\"]}", + "settings": + { + "buffer_size": 3509, + "line_ending": "Unix", + "name": "fatal: [johnny-five.io]: FAILED! => {\"changed\": tr" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/node_modules/boom/lib/index.js", + "settings": + { + "buffer_size": 7650, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/node_modules/boom/package.json", + "settings": + { + "buffer_size": 2255, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/test/accelerometer.js", + "settings": + { + "buffer_size": 34914, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/eg/sensor-and-button.js", + "settings": + { + "buffer_size": 494, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/test/common/bootstrap.js", + "settings": + { + "buffer_size": 4152, + "line_ending": "Unix" + } + }, + { + "file": "/Users/rwaldron/clonez/johnny-five/test/imu.js", + "settings": + { + "buffer_size": 31609, + "line_ending": "Unix" + } + }, + { + "contents": "| Module | Bus | I2C Address | \n| -------------- | ---- | ----------- |\n| climate-si7020 | ︎︎I2C | 0x40 |\n| ambient-attx4 | SPI | |\n| accel-mma84 | ︎︎I2C | 0x1D |\n| gps-a2235h | UART | |\n| servo-pca9685 | ︎︎I2C | 0x73 | ", + "settings": + { + "buffer_size": 287, + "line_ending": "Unix", + "name": "| Module | Bus | I2C Address |" + } + }, + { + "contents": "/Users/rwaldron/clonez/moddable/modules/drivers/mcp23008/modMcp23008.c (59) # Break: (host): unable to initialize gMCP23008!\n\n\n\nWith my \"fake_mcp23008\"\nFound address: 32 (0x20)\nDone.\nFound 1 device(s).\n", + "settings": + { + "buffer_size": 202, + "line_ending": "Unix", + "name": "/Users/rwaldron/clonez/moddable/modules/drivers/mc" + } + }, + { + "contents": "#include \n\n#define DEBUG_MODE 1\n\n// I2C Defaults\n#define I2C_DEFAULT_ADDRESS 0x20\n\nint pins[7] = {8, 7, 6, 5, 4, 3, 2};\nint iodir[7] = {1, 1, 1, 1, 1, 1, 1};\nint gpio[7] = {0, 0, 0, 0, 0, 0, 0};\n\n\nbyte buffer[1];\nbyte reg;\nbyte state;\n\nvoid resetGPIO() {\n //1 = Pin is configured as an input.\n //0 = Pin is configured as an output.\n\n for (int i = 0; i < 7; i++) {\n pinMode(pins[i], INPUT);\n digitalWrite(pins[i], LOW);\n }\n}\n\nvoid setup() {\n #if DEBUG_MODE\n Serial.begin(9600);\n #endif\n\n resetPins();\n\n Wire.begin((int)I2C_DEFAULT_ADDRESS);\n Wire.onRequest(onRequest);\n Wire.onReceive(onReceive);\n}\n\nvoid loop() {\n readGPIO();\n // int index = toIndex(state);\n\n // if (state == 0) {\n // index = 0xFF;\n // }\n\n // #if DEBUG_MODE\n // if (index != 0xff) {\n // Serial.println(index);\n // }\n // #endif\n\n // buffer[0] = index >> 8;\n // buffer[1] = index & 0xFF;\n\n // buffer[0] = state >> 8;\n // buffer[1] = state & 0xFF;\n\n delay(10);\n}\n\nint readGPIO() {\n for (int i = 0; i < 7; i++) {\n if (iodir[i] == 1) {\n gpio[i] = digitalRead(pins[i]);\n }\n }\n}\n// int read() {\n// // 2, 7, 6, 4\n// // 3, 1, 5\n// int rowPins[4] = {7, 2, 3, 5};\n// int colPins[3] = {6, 8, 4};\n// int state = 0;\n\n\n// resetPins();\n\n// for (int row = 0; row < 4; row++) {\n// // \"Open\" the row for reading...\n// // Set the row to OUTPUT and put all pins LOW\n// pinMode(rowPins[row], OUTPUT);\n// digitalWrite(rowPins[row], LOW);\n// // Iterate across the columns in this row\n// for (int col = 0; col < 3; col++) {\n// // Read and update the state byte\n// if (!digitalRead(colPins[col])) {\n// state |= 1 << ((row + 1) * 3 + (col + 1) - 4);\n// }\n// }\n// // \"Close\" the row...\n// // Set the row to INPUT and put all pins HIGH\n// pinMode(rowPins[row], INPUT);\n// digitalWrite(rowPins[row], HIGH);\n// }\n\n// return state;\n// }\n\nvoid onRequest() {\n Wire.write(buffer, 1);\n}\n\nvoid onReceive(int howMany) {\n\n if (howMany > 0) {\n reg = (byte)Wire.read();\n }\n\n if (howMany > 1) {\n state = (byte)Wire.read();\n buffer[0] = state;\n }\n\n\n // if (howMany == 2) {\n // // Do a write\n // } else {\n // if (howMany == 1) {\n // // Do a read\n // }\n // }\n\n\n #if DEBUG_MODE\n Serial.println(howMany);\n Serial.print(\"reg: \");\n Serial.print(reg);\n Serial.print(\": \");\n Serial.print(state);\n Serial.println(\"--------------------\");\n #endif\n}\n\n", + "settings": + { + "buffer_size": 2474, + "line_ending": "Unix", + "name": "#include " + } + }, + { + "contents": "http://www.web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/010-sync-xhr.html", + "settings": + { + "buffer_size": 110, + "line_ending": "Unix", + "name": "http://www.web-platform.test:8000/html/browsers/br" + } + } + ], + "build_system": "", + "build_system_choices": + [ + ], + "build_varint": "", + "command_palette": + { + "height": 375.0, + "last_filter": "", + "selected_items": + [ + [ + "re", + "Package Control: Remove Package" + ], + [ + "ins", + "Package Control: Install Package" + ], + [ + "insta", + "Package Control: Install Package" + ], + [ + "pack", + "Package Control: Install Package" + ], + [ + "Snippet: c", + "Snippet: cl" + ], + [ + "Snippet: ", + "Snippet: Prototype" + ], + [ + "prv", + "PackageResourceViewer: Extract Package" + ], + [ + "Pa", + "Package Control: Install Package" + ], + [ + "pac", + "Package Control: Install Package" + ], + [ + "Package Control: remo", + "Package Control: Remove Package" + ], + [ + "Pack", + "Package Control: Install Package" + ] + ], + "width": 378.0 + }, + "console": + { + "height": 125.0, + "history": + [ + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "expanded_folders": + [ + "/Users/rwaldron/clonez/johnny-five", + "/Users/rwaldron/clonez/johnny-five/eg", + "/Users/rwaldron/clonez/johnny-five/firmwares", + "/Users/rwaldron/clonez/johnny-five/lib", + "/Users/rwaldron/clonez/johnny-five/test", + "/Users/rwaldron/clonez/johnny-five/test/common", + "/Users/rwaldron/clonez/johnny-five/test/util", + "/Users/rwaldron/clonez/johnny-five/tpl", + "/Users/rwaldron/clonez/johnny-five/util" + ], + "file_history": + [ + "/Users/rwaldron/codez/test262-filterable-transform-stream/babel.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-bil-nsl-bd-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dd-nsl-dds-dunder-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dd-nsl-err.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/includes/String.prototype.includes_SuccessNoLocation.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/includes/String.prototype.includes_Success.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/includes/String.prototype.includes_FailMissingLetter.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/includes/String.prototype.includes_lengthProp.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/includes/String.prototype.includes_FailLocation.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/includes/String.prototype.includes_FailBadLocation.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_4.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_3.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_2.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail_2.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail.js", + "/Users/rwaldron/clonez/test262/tools/generation/lib/util/parse_yaml.py", + "/Users/rwaldron/clonez/test262/tools/lint/lib/fix.py", + "/Users/rwaldron/clonez/test262/tools/misc/__init__.py", + "/Users/rwaldron/clonez/test262/tools/misc/requirements.txt", + "/Users/rwaldron/clonez/test262/harness/propertyHelper.js", + "/Users/rwaldron/clonez/test262/make.py", + "/Users/rwaldron/clonez/test262/src/strict-mode-reserved-words/error/early-error.template", + "/Users/rwaldron/clonez/test262/test/built-ins/parseFloat/tonumber-numeric-separator-literal-hil-hds-nsl-hd.js", + "/Users/rwaldron/clonez/test262/test/built-ins/parseFloat/tonumber-numeric-separator-literal-dot-dd-nsl-dds-ep.js", + "/Users/rwaldron/clonez/test262/test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-obj-own-property.js", + "/Users/rwaldron/clonez/test262/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-od-nsl-ods.js", + "/Users/rwaldron/clonez/test262/test/built-ins/parseFloat/tonumber-numeric-separator-literal-oil-ods-nsl-od.js", + "/Users/rwaldron/clonez/test262/src/strict-mode-reserved-words/syntax/early-error.template", + "/Users/rwaldron/clonez/test262/src/strict-mode-reserved-words/await-bindingidentifier.case", + "/Users/rwaldron/clonez/test262/features.txt", + "/Users/rwaldron/clonez/test262/src/async-functions/await-as-identifier-reference-escaped.case", + "/Users/rwaldron/clonez/test262/src/strict-mode-reserved-words/error/label-identifier.template", + "/Users/rwaldron/clonez/test262/src/strict-mode-reserved-words/error/identifier-reference.template", + "/Users/rwaldron/clonez/test262/src/strict-mode-reserved-words/await-name.case", + "/Users/rwaldron/clonez/test262/src/strict-mode-reserved-words/await-label.case", + "/Users/rwaldron/clonez/test262/src/async-functions/await-as-binding-identifier.case", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/string-numeric-separator-literal-oil-ods-nsl-ods.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/numeric-separator-literal-oil-od-nsl-od-err.js", + "/Users/rwaldron/clonez/test262/src/async-functions/await-as-label-identifier.case", + "/Users/rwaldron/.Trash/await.case", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/numeric-separator-literal-oil-od-nsl-ods.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/numeric-separator-literal-oil-od-nsl-od.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/numeric-separator-literal-oil-od-nsl-od-one-of.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/numeric-separator-literal-oil-ods-nsl-od.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/string-numeric-separator-literal-nzd-nsl-dd.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Number/string-numeric-separator-literal-sign-plus-dds-nsl-dd.js", + "/Users/rwaldron/.ssh/config", + "/Users/rwaldron/clonez/test262/test/language/statements/try/catch-parameter-boundnames-restriction-eval-eval-throws.js", + "/Users/rwaldron/clonez/test262/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-eval-throws.js", + "/Users/rwaldron/clonez/test262/test/language/statements/try/catch-parameter-boundnames-restriction-eval-negative-early.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Array/isArray/proxy-revoked.js", + "/Users/rwaldron/clonez/test262/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-negative-early.js", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/error-async-generator-syntax/async-gen-decl.template", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-elision-iter-nrml-close.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-get-err.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-elision-iter-abpt.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-nrml-close-null.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-nrml-close-skip.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-nrml-close-err.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-thrw-close-skip.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-rtrn-close.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-rest-rtrn-close-null.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-rtrn-close-null.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-rest-rtrn-close-err.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-rest-nrml-close-skip.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-elision-iter-nrml-close-null.case", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-ep-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-nsl-ep-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-nsl-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dd-ep.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dds-ep.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dds-ep.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dd-ep.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-ep-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dil-dot-nsl-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-dunder-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-signed-integer--------------ignore.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd-one-of.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dds-nsl-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-sign-minus-dds-nsl-dd.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-nsl-od-dunder-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-dunder-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-hil-nsl-hd-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dds-dunder-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dds-nsl-dd.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dil-dot-dds-nsl-ep-dd-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-one-of.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-od.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-od-nsl-ods.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-od.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-oil-ods-nsl-ods.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-hil-od-nsl-od-one-of.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-nzd-nsl-dd-one-of.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd-err.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js", + "/Users/rwaldron/clonez/test262/test/language/expressions/arrow-function/param-dflt-yield-id-non-strict.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-bds--------------ignore.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dd-exponentpart.js", + "/Users/rwaldron/clonez/test262/test/language/literals/numeric/numeric-separator-literal-nonzerodigit-nsl-decimaldigit-1-9.js", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-nrml-close.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elem-trlg-iter-list-rtrn-close-err.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-elision-iter-nrml-close-skip.case", + "/Users/rwaldron/clonez/test262/src/async-generators/yield-promise-reject-next-catch.case", + "/Users/rwaldron/clonez/test262/test/language/expressions/exponentiation/applying-the-exp-operator_A1.js", + "/Users/rwaldron/clonez/test262/test/harness/testbuiltinobject-function-not-constructor-no-error.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Array/prototype/length.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Array/prototype/find/predicate-call-this-non-strict.js", + "/Users/rwaldron/clonez/test262/test/built-ins/String/15.5.5.5.2-3-1.js", + "/Users/rwaldron/clonez/test262/test/built-ins/RegExp/property-escapes/generated/Any.js", + "/Users/rwaldron/clonez/test262/test/built-ins/Array/prototype/find/length.js", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-rest-iteration.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-rest-lref.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-rest-nested-array-null.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-rest-nested-array-undefined-hole.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-rest-nested-array-undefined-own.case", + "/Users/rwaldron/clonez/test262/src/dstr-assignment-async-iteration/array-rest-nested-array-undefined.case" + ], + "find": + { + "height": 37.0 + }, + "find_in_files": + { + "height": 95.0, + "where_history": + [ + "/Users/rwaldron/clonez/johnny-five", + "/Users/rwaldron/clonez/johnny-five/test", + "/Users/rwaldron/clonez/johnny-five/lib", + "" + ] + }, + "find_state": + { + "case_sensitive": true, + "find_history": + [ + "isConversionAvailable", + "analogHandler", + "this.", + "console.log(", + "thermometer", + "var ", + "132", + "ANALOG", + "analogHandler", + "STEP_IN", + "STEP_IN_OUT", + "STEP_BOUNCE", + "2.75", + "0.5", + "7.5625", + "s", + " .5", + "STEP", + "s", + "1.70158", + "{\n return ", + "function(n){", + "function", + "es6-shim", + "exportable", + "module.exports", + "es6-shim", + "cu", + ", ", + "fractional", + "0.05", + "RATE", + "READREGISTER", + ": (", + "<< 2) / 4", + "MMA7660", + "3);", + "analogToGravity", + "ESPLORA", + "Espl", + "0.5294117647058824", + "(x", + "fractional", + "MPU", + ", ", + "6050", + "3, d", + "analogToGravity", + "ADXL335", + "I2C_DEFAULT_ADDRESS", + "state", + "buffer", + "I2C_BUFFER_SIZE", + "resetPins", + "address", + "buffer", + "I2C_BUFFER_SIZE", + "this.sp.", + "this.sp", + "conn", + "LEDs", + "Coll", + "8", + "LIS3DH", + "toFi", + "MPU", + "uint32", + "uint", + "uint32", + "<<", + ">>", + "Fn.u32", + "s32", + "Fn.s32", + "Fn.", + "uint24", + "57600", + "stepsP", + "resolution", + "scaleTo", + "change", + "new Date().getTime()", + "Hoek", + "tap", + "digitalRead" + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": false, + "replace_history": + [ + "u32", + "s32" + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 9, + "sheets": + [ + { + "buffer": 0, + "file": "button.js", + "semi_transient": false, + "settings": + { + "buffer_size": 8938, + "regions": + { + }, + "selection": + [ + [ + 1388, + 1388 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 1, + "type": "text" + }, + { + "buffer": 1, + "file": "/Users/rwaldron/clonez/johnny-five/eg/stepper-driver.js", + "semi_transient": false, + "settings": + { + "buffer_size": 1435, + "regions": + { + }, + "selection": + [ + [ + 519, + 519 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 29, + "type": "text" + }, + { + "buffer": 2, + "semi_transient": false, + "settings": + { + "buffer_size": 476, + "regions": + { + }, + "selection": + [ + [ + 290, + 476 + ] + ], + "settings": + { + "auto_name": "ECMAScript 2015 Internationalization API Specifica", + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 28, + "type": "text" + }, + { + "buffer": 3, + "semi_transient": false, + "settings": + { + "buffer_size": 89, + "regions": + { + }, + "selection": + [ + [ + 89, + 89 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 8, + "type": "text" + }, + { + "buffer": 4, + "semi_transient": false, + "settings": + { + "buffer_size": 103, + "regions": + { + }, + "selection": + [ + [ + 96, + 96 + ] + ], + "settings": + { + "auto_name": "function each(items, callback) {", + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 27, + "type": "text" + }, + { + "buffer": 5, + "file": "/Users/rwaldron/Downloads/customfirmata/customfirmata.ino", + "semi_transient": false, + "settings": + { + "buffer_size": 1877, + "regions": + { + }, + "selection": + [ + [ + 931, + 931 + ] + ], + "settings": + { + "syntax": "Packages/C++/C.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 26, + "type": "text" + }, + { + "buffer": 6, + "file": "imu.js", + "semi_transient": false, + "settings": + { + "buffer_size": 79312, + "regions": + { + }, + "selection": + [ + [ + 1065, + 1065 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 149.0, + "zoom_level": 1.0 + }, + "stack_index": 23, + "type": "text" + }, + { + "buffer": 7, + "file": "/Users/rwaldron/clonez/johnny-five/package.json", + "semi_transient": false, + "settings": + { + "buffer_size": 8785, + "regions": + { + }, + "selection": + [ + [ + 319, + 313 + ] + ], + "settings": + { + "syntax": "Packages/JavaScriptNext - ES6 Syntax/JSON (JavaScriptNext).tmLanguage", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 5.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 6, + "type": "text" + }, + { + "buffer": 8, + "file": "/Users/rwaldron/clonez/johnny-five/test/thermometer.js", + "semi_transient": false, + "settings": + { + "buffer_size": 46827, + "regions": + { + }, + "selection": + [ + [ + 6101, + 6101 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 4472.0, + "zoom_level": 1.0 + }, + "stack_index": 7, + "type": "text" + }, + { + "buffer": 9, + "file": "thermometer.js", + "semi_transient": false, + "settings": + { + "buffer_size": 28682, + "regions": + { + }, + "selection": + [ + [ + 861, + 861 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + }, + { + "buffer": 10, + "file": "servo.js", + "semi_transient": true, + "settings": + { + "buffer_size": 15407, + "regions": + { + }, + "selection": + [ + [ + 0, + 0 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 5, + "type": "text" + }, + { + "buffer": 11, + "file": "sensor.js", + "semi_transient": false, + "settings": + { + "buffer_size": 10565, + "regions": + { + }, + "selection": + [ + [ + 1842, + 1920 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 811.0, + "zoom_level": 1.0 + }, + "stack_index": 2, + "type": "text" + }, + { + "buffer": 12, + "file": "utils/easing.js", + "semi_transient": false, + "settings": + { + "buffer_size": 2446, + "regions": + { + }, + "selection": + [ + [ + 573, + 573 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 15, + "type": "text" + }, + { + "buffer": 13, + "file": "/Users/rwaldron/clonez/johnny-five/tpl/.readme.md", + "semi_transient": false, + "settings": + { + "buffer_size": 9791, + "regions": + { + }, + "selection": + [ + [ + 1155, + 1155 + ] + ], + "settings": + { + "syntax": "Packages/MarkdownEditing/Markdown.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 13, + "type": "text" + }, + { + "buffer": 14, + "file": "/Users/rwaldron/clonez/johnny-five/Gruntfile.js", + "semi_transient": false, + "settings": + { + "buffer_size": 15027, + "regions": + { + }, + "selection": + [ + [ + 10707, + 10707 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 5816.0, + "zoom_level": 1.0 + }, + "stack_index": 14, + "type": "text" + }, + { + "buffer": 15, + "file": "johnny-five.js", + "semi_transient": false, + "settings": + { + "buffer_size": 4426, + "regions": + { + }, + "selection": + [ + [ + 3557, + 3557 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1839.0, + "zoom_level": 1.0 + }, + "stack_index": 16, + "type": "text" + }, + { + "buffer": 16, + "file": "accelerometer.js", + "semi_transient": false, + "settings": + { + "buffer_size": 30662, + "regions": + { + }, + "selection": + [ + [ + 6568, + 6568 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 3.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 19, + "type": "text" + }, + { + "buffer": 17, + "file": "board.js", + "semi_transient": false, + "settings": + { + "buffer_size": 31512, + "regions": + { + }, + "selection": + [ + [ + 0, + 0 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 17, + "type": "text" + }, + { + "buffer": 18, + "file": "/Users/rwaldron/clonez/johnny-five/.travis.yml", + "semi_transient": false, + "settings": + { + "buffer_size": 610, + "regions": + { + }, + "selection": + [ + [ + 65, + 66 + ] + ], + "settings": + { + "syntax": "Packages/YAML/YAML.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 11, + "type": "text" + }, + { + "buffer": 19, + "file": "/Users/rwaldron/clonez/johnny-five/test/animation.js", + "semi_transient": false, + "settings": + { + "buffer_size": 27620, + "regions": + { + }, + "selection": + [ + [ + 9044, + 9044 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 5786.0, + "zoom_level": 1.0 + }, + "stack_index": 24, + "type": "text" + }, + { + "buffer": 20, + "semi_transient": false, + "settings": + { + "buffer_size": 1584, + "regions": + { + }, + "selection": + [ + [ + 415, + 415 + ] + ], + "settings": + { + "syntax": "Packages/C++/C.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 9, + "type": "text" + }, + { + "buffer": 21, + "file": "/Users/rwaldron/clonez/johnny-five/appveyor.yml", + "semi_transient": false, + "settings": + { + "buffer_size": 299, + "regions": + { + }, + "selection": + [ + [ + 34, + 34 + ] + ], + "settings": + { + "syntax": "Packages/YAML/YAML.sublime-syntax" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 12, + "type": "text" + }, + { + "buffer": 22, + "semi_transient": false, + "settings": + { + "buffer_size": 3509, + "regions": + { + }, + "selection": + [ + [ + 1045, + 1045 + ] + ], + "settings": + { + "auto_name": "fatal: [johnny-five.io]: FAILED! => {\"changed\": tr", + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 25, + "type": "text" + }, + { + "buffer": 23, + "file": "/Users/rwaldron/clonez/johnny-five/node_modules/boom/lib/index.js", + "semi_transient": false, + "settings": + { + "buffer_size": 7650, + "regions": + { + }, + "selection": + [ + [ + 45, + 45 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 31, + "type": "text" + }, + { + "buffer": 24, + "file": "/Users/rwaldron/clonez/johnny-five/node_modules/boom/package.json", + "semi_transient": false, + "settings": + { + "buffer_size": 2255, + "regions": + { + }, + "selection": + [ + [ + 773, + 782 + ] + ], + "settings": + { + "syntax": "Packages/JavaScriptNext - ES6 Syntax/JSON (JavaScriptNext).tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 30, + "type": "text" + } + ] + }, + { + "selected": 1, + "sheets": + [ + { + "buffer": 25, + "file": "/Users/rwaldron/clonez/johnny-five/test/accelerometer.js", + "semi_transient": false, + "settings": + { + "buffer_size": 34914, + "regions": + { + }, + "selection": + [ + [ + 10131, + 10131 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 7917.0, + "zoom_level": 1.0 + }, + "stack_index": 18, + "type": "text" + }, + { + "buffer": 26, + "file": "/Users/rwaldron/clonez/johnny-five/eg/sensor-and-button.js", + "semi_transient": false, + "settings": + { + "buffer_size": 494, + "regions": + { + }, + "selection": + [ + [ + 329, + 385 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 3, + "type": "text" + }, + { + "buffer": 27, + "file": "/Users/rwaldron/clonez/johnny-five/test/common/bootstrap.js", + "semi_transient": false, + "settings": + { + "buffer_size": 4152, + "regions": + { + }, + "selection": + [ + [ + 2820, + 2820 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1805.0, + "zoom_level": 1.0 + }, + "stack_index": 10, + "type": "text" + }, + { + "buffer": 28, + "file": "/Users/rwaldron/clonez/johnny-five/test/imu.js", + "semi_transient": false, + "settings": + { + "buffer_size": 31609, + "regions": + { + }, + "selection": + [ + [ + 2741, + 2741 + ] + ], + "settings": + { + "syntax": "Packages/User/JavaScriptNext.sublime-syntax", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1516.0, + "zoom_level": 1.0 + }, + "stack_index": 20, + "type": "text" + }, + { + "buffer": 29, + "semi_transient": false, + "settings": + { + "buffer_size": 287, + "regions": + { + }, + "selection": + [ + [ + 287, + 287 + ] + ], + "settings": + { + "auto_name": "| Module | Bus | I2C Address |", + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 32, + "type": "text" + }, + { + "buffer": 30, + "semi_transient": false, + "settings": + { + "buffer_size": 202, + "regions": + { + }, + "selection": + [ + [ + 202, + 202 + ] + ], + "settings": + { + "auto_name": "/Users/rwaldron/clonez/moddable/modules/drivers/mc", + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 22, + "type": "text" + }, + { + "buffer": 31, + "semi_transient": false, + "settings": + { + "buffer_size": 2474, + "regions": + { + }, + "selection": + [ + [ + 2474, + 2474 + ] + ], + "settings": + { + "auto_name": "#include ", + "syntax": "Packages/Text/Plain text.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 1400.0, + "zoom_level": 1.0 + }, + "stack_index": 21, + "type": "text" + } + ] + }, + { + "selected": 0, + "sheets": + [ + { + "buffer": 32, + "semi_transient": false, + "settings": + { + "buffer_size": 110, + "regions": + { + }, + "selection": + [ + [ + 110, + 110 + ] + ], + "settings": + { + "auto_name": "http://www.web-platform.test:8000/html/browsers/br", + "syntax": "Packages/Text/Plain text.tmLanguage" + }, + "translation.x": 3.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 4, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 26.0 + }, + "input": + { + "height": 35.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ], + [ + 1, + 0, + 2, + 1 + ], + [ + 2, + 0, + 3, + 1 + ] + ], + "cols": + [ + 0.0, + 0.413341795168, + 0.87076094892, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "output.exec": + { + "height": 231.0 + }, + "output.find_results": + { + "height": 0.0 + }, + "output.git": + { + "height": 205.0 + }, + "pinned_build_system": "Packages/User/Node.sublime-build", + "project": "johnny-five.sublime-project", + "replace": + { + "height": 66.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + [ + "test/built-ins/string/prototype/indexof/position-tointeger.j", + "test/built-ins/String/prototype/indexOf/position-tointeger.js" + ], + [ + "decimaltohexstring", + "harness/decimalToHexString.js" + ], + [ + "test/built-ins/string/prototype/indexof/position-tointeger.js", + "test/built-ins/String/prototype/indexOf/position-tointeger.js" + ], + [ + "identifier-let-allowed-as-lefthandside-expression-strict", + "test/language/statements/let/syntax/identifier-let-allowed-as-lefthandside-expression-strict.js" + ], + [ + "src/dstr-assignment/obj-rest-computed-property.case", + "src/dstr-assignment/obj-rest-computed-property.case" + ], + [ + "test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-obj-own-property.js", + "test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-obj-own-property.js" + ], + [ + "test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-nested-obj.js", + "test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-nested-obj.js" + ], + [ + "test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-nested-obj-nested-rest.js", + "test/language/statements/for-await-of/async-gen-decl-dstr-obj-rest-nested-obj-nested-rest.js" + ], + [ + "test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-obj-own-property.js", + "test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-obj-own-property.js" + ], + [ + "test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-nested-obj-nested-rest.js", + "test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-nested-obj-nested-rest.js" + ], + [ + "src/dstr-assignment-for-await/obj-rest-nested-obj.case", + "src/dstr-assignment-for-await/obj-rest-nested-obj.case" + ], + [ + "test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-nested-obj.js", + "test/language/statements/for-await-of/async-func-decl-dstr-obj-rest-nested-obj.js" + ], + [ + "src/dstr-assignment/obj-id-identifier-yield-expr.case", + "src/dstr-assignment/obj-id-identifier-yield-expr.case" + ], + [ + "await", + "src/async-functions/await-as-binding-identifier.case" + ], + [ + "test/language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js", + "test/language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js" + ], + [ + "param-dflt-yield-id-non-strict.js", + "test/language/expressions/arrow-function/param-dflt-yield-id-non-strict.js" + ], + [ + "test/built-ins/date/s15.9.3.1_a5_t1.js", + "test/built-ins/Date/S15.9.3.1_A5_T1.js" + ], + [ + "language/module-code/namespace/internals/define-own-property", + "test/language/module-code/namespace/internals/define-own-property.js" + ], + [ + "array-elem-put-let.case", + "src/dstr-assignment/array-elem-put-let.case" + ], + [ + "async-func-decl-dstr-array-elem-init-let.js", + "test/language/statements/for-await-of/async-func-decl-dstr-array-elem-init-let.js" + ], + [ + "src/dstr-assignment-for-await/array-elem-init-let.case", + "src/dstr-assignment-for-await/array-elem-init-let.case" + ], + [ + "test/language/statements/for-of/dstr-obj-rest-computed-property.js", + "test/language/statements/for-of/dstr-obj-rest-computed-property.js" + ], + [ + "test/built-ins/proxy/apply/trap-is-undefined-no-property.js", + "test/built-ins/Proxy/apply/trap-is-undefined-no-property.js" + ], + [ + "array-elem-trlg-iter-rest-rtrn-close-null.case", + "src/dstr-assignment/array-elem-trlg-iter-rest-rtrn-close-null.case" + ], + [ + "ary-ptrn-elision-step-err", + "test/language/statements/class/dstr-async-gen-meth-static-dflt-ary-ptrn-elision-step-err.js" + ], + [ + "array-rest-nested-obj-yield-expr", + "src/dstr-assignment/array-rest-nested-obj-yield-expr.case" + ], + [ + "array-rest-nested-obj-yield-ex", + "src/dstr-assignment-async-iteration/array-rest-nested-obj-yield-expr.case" + ], + [ + "dstr-async-gen-meth-ary-ptrn-rest-obj-prop-id.js", + "test/language/expressions/class/dstr-async-gen-meth-ary-ptrn-rest-obj-prop-id.js" + ], + [ + "test/built-ins/array/prototype/splice/15.4.4.12-9-c-ii-1.js", + "test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js" + ], + [ + "ac", + "johnny-five/test/accelerometer.js" + ], + [ + "repl", + "johnny-five/lib/repl.js" + ], + [ + "acc", + "johnny-five/test/accelerometer.js" + ], + [ + "13", + "johnny-five/eg/1306.js" + ], + [ + "li", + "johnny-five/test/light.js" + ], + [ + "light", + "johnny-five/eg/light-ambient-TSL2561.js" + ], + [ + "ligh", + "johnny-five/lib/light.js" + ], + [ + "acce", + "johnny-five/test/accelerometer.js" + ], + [ + "", + "johnny-five/test/light.js" + ], + [ + "eg/led", + "johnny-five/eg/led-blink.js" + ], + [ + "blinkm", + "johnny-five/node_modules/particle-io/eg/i2c-blinkm.js" + ], + [ + "rele", + "johnny-five/lib/release" + ] + ], + "width": 0.0 + }, + "select_project": + { + "height": 500.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 380.0 + }, + "select_symbol": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "selected_group": 0, + "settings": + { + }, + "show_minimap": false, + "show_open_files": true, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 253.0, + "status_bar_visible": true, + "template_settings": + { + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/joystick.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/joystick.js new file mode 100644 index 00000000..db39b244 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/joystick.js @@ -0,0 +1,264 @@ +var Board = require("./board"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Fn = require("./fn"); +var priv = new Map(); +var axes = ["x", "y"]; + +function Multiplexer(options) { + this.pins = options.pins; + this.io = options.io; + + // Setup these "analog" pins as digital output. + this.io.pinMode(this.pins[0], this.io.MODES.OUTPUT); + this.io.pinMode(this.pins[1], this.io.MODES.OUTPUT); + this.io.pinMode(this.pins[2], this.io.MODES.OUTPUT); + this.io.pinMode(this.pins[3], this.io.MODES.OUTPUT); +} + +Multiplexer.prototype.select = function(channel) { + this.io.digitalWrite(this.pins[0], channel & 1 ? this.io.HIGH : this.io.LOW); + this.io.digitalWrite(this.pins[1], channel & 2 ? this.io.HIGH : this.io.LOW); + this.io.digitalWrite(this.pins[2], channel & 4 ? this.io.HIGH : this.io.LOW); + this.io.digitalWrite(this.pins[3], channel & 8 ? this.io.HIGH : this.io.LOW); +}; + +var Controllers = { + ANALOG: { + initialize: { + value: function(opts, dataHandler) { + var axisValues = { + x: null, + y: null + }; + + opts.pins.forEach(function(pin, index) { + this.io.pinMode(pin, this.io.MODES.ANALOG); + this.io.analogRead(pin, function(value) { + axisValues[axes[index]] = value; + + if (axisValues.x !== null && axisValues.y !== null) { + dataHandler({ + x: axisValues.x, + y: axisValues.y + }); + + axisValues.x = null; + axisValues.y = null; + } + }.bind(this)); + }, this); + } + }, + toAxis: { + value: function(raw, axis) { + var state = priv.get(this); + return Fn.constrain(Fn.fscale(raw - state[axis].zeroV, -511, 511, -1, 1), -1, 1); + } + } + }, + ESPLORA: { + initialize: { + value: function(opts, dataHandler) { + // References: + // + // https://github.com/arduino/Arduino/blob/master/libraries/Esplora/src/Esplora.h + // https://github.com/arduino/Arduino/blob/master/libraries/Esplora/src/Esplora.cpp + // + var multiplexer = new Multiplexer({ + // Since Multiplexer uses digitalWrite, + // we have to send the analog pin numbers + // in their "digital" pin order form. + pins: [18, 19, 20, 21], + io: this.io + }); + var channels = [11, 12]; + var index = 1; + var axisValues = { + x: null, + y: null + }; + + this.io.pinMode(4, this.io.MODES.ANALOG); + + var handler = function(value) { + axisValues[axes[index]] = value; + + if (axisValues.x !== null && axisValues.y !== null) { + dataHandler({ + x: axisValues.x, + y: axisValues.y + }); + + axisValues.x = null; + axisValues.y = null; + } + + // Remove this handler to all the multiplexer + // to setup the next pin for the next read. + this.io.removeListener("analog-read-4", handler); + + setTimeout(read, 10); + }.bind(this); + + var read = function() { + multiplexer.select(channels[index ^= 1]); + this.io.analogRead(4, handler); + }.bind(this); + + read(); + } + }, + toAxis: { + value: function(raw, axis) { + var state = priv.get(this); + return Fn.constrain(Fn.fscale(raw - state[axis].zeroV, -511, 511, -1, 1), -1, 1); + } + } + } +}; + + +/** + * Joystick + * @constructor + * + * five.Joystick([ x, y[, z] ]); + * + * five.Joystick({ + * pins: [ x, y[, z] ] + * freq: ms + * }); + * + * + * @param {Object} opts [description] + * + */ +function Joystick(opts) { + if (!(this instanceof Joystick)) { + return new Joystick(opts); + } + + var controller = null; + + var state = { + x: { + invert: false, + value: 0, + previous: 0, + zeroV: 0, + calibrated: false + }, + y: { + invert: false, + value: 0, + previous: 0, + zeroV: 0, + calibrated: false + } + }; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.ANALOG; + } + + Board.Controller.call(this, controller, opts); + + if (!this.toAxis) { + this.toAxis = opts.toAxis || function(raw) { + return raw; + }; + } + + state.x.zeroV = opts.zeroV === undefined ? 0 : (opts.zeroV.x || 0); + state.y.zeroV = opts.zeroV === undefined ? 0 : (opts.zeroV.y || 0); + + state.x.invert = opts.invertX || opts.invert || false; + state.y.invert = opts.invertY || opts.invert || false; + + priv.set(this, state); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + var isChange = false; + var computed = { + x: null, + y: null + }; + + Object.keys(data).forEach(function(axis) { + var value = data[axis]; + var sensor = state[axis]; + + // Set the internal ADC reading value... + sensor.value = value; + + if (!state[axis].calibrated) { + state[axis].calibrated = true; + state[axis].zeroV = value; + isChange = true; + } + + // ... Get the computed axis value. + computed[axis] = this[axis]; + + var absAxis = Math.abs(computed[axis]); + var absPAxis = Math.abs(sensor.previous); + + if ((absAxis < absPAxis) || + (absAxis > absPAxis)) { + isChange = true; + } + + sensor.previous = computed[axis]; + }, this); + + this.emit("data", { + x: computed.x, + y: computed.y + }); + + if (isChange) { + this.emit("change", { + x: computed.x, + y: computed.y + }); + } + }.bind(this)); + } + + Object.defineProperties(this, { + x: { + get: function() { + return this.toAxis(state.x.value, "x") * (state.x.invert ? -1 : 1); + } + }, + y: { + get: function() { + return this.toAxis(state.y.value, "y") * (state.y.invert ? -1 : 1); + } + } + }); +} + +util.inherits(Joystick, Emitter); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Joystick.Controllers = Controllers; + Joystick.purge = function() { + priv.clear(); + }; +} + +module.exports = Joystick; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/keypad.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/keypad.js new file mode 100644 index 00000000..e7b96e0c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/keypad.js @@ -0,0 +1,740 @@ +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Board = require("./board"); +var Fn = require("./fn"); + +var scale = Fn.scale; +var toFixed = Fn.toFixed; +var uint16 = Fn.uint16; + +var priv = new Map(); + +var aliases = { + down: ["down", "press", "tap", "impact", "hit", "touch"], + up: ["up", "release"], + hold: ["hold"] +}; + +function flatKeys(opts) { + var keys = []; + + if (opts.keys && Array.isArray(opts.keys)) { + keys = opts.keys.slice(); + + if (keys.every(Array.isArray)) { + keys = keys.reduce(function(accum, row) { + return accum.concat(row); + }, []); + } + } + + return keys; +} + +// TODO: +// +// Provide a mechanism for explicitly naming aliases for buttons +// +// +var Controllers = { + MPR121: { + ADDRESSES: { + value: [0x5A, 0x5B, 0x5C, 0x5D] + }, + REGISTER: { + value: require("./definitions/mpr121.js") + }, + initialize: { + value: function(opts, dataHandler) { + + var state = priv.get(this); + var address = opts.address || this.ADDRESSES[0]; + var keys = flatKeys(opts); + var keyMap = this.REGISTER.MAPS[opts.controller].KEYS; + var targets = this.REGISTER.MAPS[opts.controller].TARGETS; + var mapping = Object.keys(keyMap).reduce(function(accum, index) { + accum[index] = keyMap[index]; + return accum; + }, []); + + var length = mapping.length; + opts.address = address; + + this.io.i2cConfig(opts); + + this.io.i2cWrite(address, this.REGISTER.MPR121_SOFTRESET, 0x63); + + this.io.i2cWrite(address, this.REGISTER.MHD_RISING, 0x01); + this.io.i2cWrite(address, this.REGISTER.NHD_AMOUNT_RISING, 0x01); + this.io.i2cWrite(address, this.REGISTER.NCL_RISING, 0x00); + this.io.i2cWrite(address, this.REGISTER.FDL_RISING, 0x00); + + this.io.i2cWrite(address, this.REGISTER.MHD_FALLING, 0x01); + this.io.i2cWrite(address, this.REGISTER.NHD_AMOUNT_FALLING, 0x01); + this.io.i2cWrite(address, this.REGISTER.NCL_FALLING, 0xFF); + this.io.i2cWrite(address, this.REGISTER.FDL_FALLING, 0x02); + + // Page 12 + // 6. Touch and Release Threshold (0x41~0x5A) + // The threshold is defined as a deviation value from the baseline value, + // so it remains constant even baseline value changes. Typically the touch + // threshold is a little bigger than the release threshold to touch debounce + // and hysteresis. The range of the value is 0~255. For typical touch + // application, the value can be in range 0x05~0x30 for example. The setting + // of the threshold is depended on the actual application. For the operation + // details and how to set the threshold refer to application note AN3892 and + // MPR121 design guidelines. + + this.sensitivity = { + // Inverted map approximately to 8 bit values: + // + // press: 12 + // release: 6 + // + press: Array(12).fill(0.95), + release: Array(12).fill(0.975), + // These defaults as based on the defaults shown + // in examples published by Adafruit + // https://github.com/adafruit/Adafruit_MPR121/blob/master/Adafruit_MPR121.cpp#L43 + }; + + // If keys were specified for a MPR121_SHIELD (adafruit shield), + // then reverse the keys to align with the output of the. + if (opts.keys && opts.controller === "MPR121_SHIELD") { + keys = keys.reverse(); + } + + if (opts.sensitivity) { + if (Array.isArray(opts.sensitivity)) { + // Initialized as: + // + // new five.Keypad({ + // controller: "MPR121", + // sensitivity: [ + // { press: 0-1, release: 0-1, }, + // { press: 0-1, release: 0-1, }, + // { press: 0-1, release: 0-1, }, + // ... + // ], + // }); + // + opts.sensitivity.forEach(function(sensitivity, index) { + if (typeof sensitivity.press !== "undefined") { + this.sensitivity.press[index] = sensitivity.press; + } + + if (typeof sensitivity.release !== "undefined") { + this.sensitivity.release[index] = sensitivity.release; + } + }, this); + } else { + // Initialized as: + // + // new five.Keypad({ + // controller: "MPR121", + // sensitivity: { + // press: 0-1, + // release: 0-1, + // }, + // }); + // + if (typeof opts.sensitivity.press !== "undefined") { + this.sensitivity.press.fill(opts.sensitivity.press); + } + + if (typeof opts.sensitivity.release !== "undefined") { + this.sensitivity.release.fill(opts.sensitivity.release); + } + } + } + + // The chip expects a LOWER value for a HIGHER sensitivity. + // Most people don't think this way, so Johnny-Five aligns with + // user/developer intuition, which we assume for this case is: + // + // "Higher sensitivity value means greater touch sensitivity" + // + // This means that the value we received needs to be inverted + // before it's written to the chip threshold configuration. + // + for (var i = 0; i < 12; i++) { + this.io.i2cWrite( + address, + this.REGISTER.ELE0_TOUCH_THRESHOLD + (i << 1), + scale(toFixed(1 - this.sensitivity.press[i], 3), 0, 1, 0, 255) + ); + this.io.i2cWrite( + address, + this.REGISTER.ELE0_RELEASE_THRESHOLD + (i << 1), + scale(toFixed(1 - this.sensitivity.release[i], 3), 0, 1, 0, 255) + ); + } + + this.io.i2cWrite(address, this.REGISTER.FILTER_CONFIG, 0x13); + this.io.i2cWrite(address, this.REGISTER.AFE_CONFIGURATION, 0x80); + + this.io.i2cWrite(address, this.REGISTER.AUTO_CONFIG_CONTROL_0, 0x8F); + this.io.i2cWrite(address, this.REGISTER.AUTO_CONFIG_USL, 0xE4); + this.io.i2cWrite(address, this.REGISTER.AUTO_CONFIG_LSL, 0x94); + this.io.i2cWrite(address, this.REGISTER.AUTO_CONFIG_TARGET_LEVEL, 0xCD); + + this.io.i2cWrite(address, this.REGISTER.ELECTRODE_CONFIG, 0xCC); + + if (!keys.length) { + keys = Array.from(Object.assign({}, keyMap, { + length: length + })); + } + + state.length = length; + state.touches = touches(length); + state.keys = keys; + state.mapping = mapping; + state.targets = targets; + state.isMultitouch = true; + + this.io.i2cRead(address, 0x00, 2, function(bytes) { + dataHandler(uint16(bytes[1], bytes[0])); + }); + } + }, + toAlias: { + value: function(index) { + var state = priv.get(this); + return state.keys[index]; + } + }, + toIndices: { + value: function(raw) { + var state = priv.get(this); + var indices = []; + for (var i = 0; i < 12; i++) { + if (raw & (1 << i)) { + indices.push(state.targets[raw & (1 << i)]); + } + } + return indices; + } + }, + }, + + // https://learn.sparkfun.com/tutorials/vkey-voltage-keypad-hookup-guide + VKEY: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var aref = opts.aref || this.io.aref || 5; + var use5V = Fn.inRange(aref, 4.5, 5.5); + var keys = flatKeys(opts); + var mapping = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; + var length = 0; + + if (!keys.length) { + keys = mapping; + } + + state.scale = [ + use5V ? 17 : 26, + use5V ? 40 : 58, + use5V ? 496 : 721, + ]; + + length = mapping.length; + state.length = length; + state.touches = touches(length); + state.mapping = mapping; + state.keys = keys; + state.isMultitouch = false; + + this.io.pinMode(this.pin, this.io.MODES.ANALOG); + this.io.analogRead(this.pin, function(adc) { + dataHandler(adc); + }.bind(this)); + }, + }, + toAlias: { + value: function(index) { + var state = priv.get(this); + return state.keys[index]; + } + }, + toIndices: { + value: function(raw) { + var state = priv.get(this); + var length = state.length; + var low = state.scale[0]; + var step = state.scale[1]; + var high = state.scale[2]; + + if (raw < low || raw > high) { + return []; + } + + return [(length - ((raw - low) / step)) | 0]; + } + } + }, + + // WaveShare AD + // - http://www.amazon.com/WaveShare-Accessory-buttons-controlled-keyboard/dp/B00KM6UXVS + // - http://www.wvshare.com/product/A_D-Keypad.htm + // + // TODO: Create docs to show how to create a DIY keypad + // that works with this class. + // + ANALOG: { + initialize: { + value: function(opts, dataHandler) { + + var keys = flatKeys(opts); + var mapping = []; + var length = 0; + + if (opts.length && !keys.length) { + keys = Array.from({ + length: opts.length + }, function(_, key) { + return key; + }); + } + + if (!keys.length) { + throw new Error( + "Missing `keys`. Analog Keypad requires either a numeric `length` or a `keys` array." + ); + } + + mapping = keys; + length = mapping.length; + + var state = priv.get(this); + // keys + Idle state == length + 1 + var total = length + 1; + var vrange = Math.round(1023 / total); + var ranges = Array.from({ + length: total + }, function(_, index) { + var start = vrange * index; + return Array.from({ + length: vrange - 1 + }, function(_, index) { + return start + index; + }); + }); + + state.length = length; + state.ranges = ranges; + state.touches = touches(length); + state.mapping = mapping; + state.keys = keys; + state.isMultitouch = true; + + this.io.pinMode(this.pin, this.io.MODES.ANALOG); + this.io.analogRead(this.pin, function(adc) { + dataHandler(adc); + }); + } + }, + toAlias: { + value: function(index) { + var state = priv.get(this); + return state.keys[index]; + } + }, + toIndices: { + value: function(raw) { + var state = priv.get(this); + var ranges = state.ranges; + var index = ranges.findIndex(function(range) { + return range.includes(raw); + }); + + if (index === state.length) { + index--; + } + + if (index < 0) { + return []; + } + + return [index]; + } + } + }, + AT42QT1070: { + ADDRESSES: { + value: [0x1B] + }, + REGISTER: { + value: { + READ: 0x03 + } + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || this.ADDRESSES[0]; + var keys = flatKeys(opts); + var mapping = [0, 1, 2, 3, 4, 5, 6]; + var length = 0; + + if (!keys.length) { + keys = mapping; + } + + length = mapping.length; + + state.length = length; + state.touches = touches(length); + state.mapping = mapping; + state.keys = keys; + state.isMultitouch = true; + + this.io.i2cConfig(opts); + this.io.i2cRead(address, this.REGISTER.READ, 1, function(data) { + dataHandler(data[0]); + }); + } + }, + toAlias: { + value: function(index) { + var state = priv.get(this); + return state.keys[index]; + } + }, + toIndices: { + value: function(raw) { + var indices = []; + for (var i = 0; i < 7; i++) { + if (raw & (1 << i)) { + indices.push(i); + } + } + return indices; + } + } + }, + + "3X4_I2C_NANO_BACKPACK": { + ADDRESSES: { + value: [0x0A, 0x0B, 0x0C, 0x0D] + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || this.ADDRESSES[0]; + var keys = flatKeys(opts); + var mapping = [1, 2, 3, 4, 5, 6, 7, 8, 9, "*", 0, "#"]; + var length = 0; + + if (!keys.length) { + keys = mapping; + } + + length = mapping.length; + + state.length = length; + state.touches = touches(length); + state.mapping = mapping; + state.keys = keys; + state.isMultitouch = true; + + opts.address = address; + + this.io.i2cConfig(opts); + this.io.i2cRead(address, 2, function(bytes) { + dataHandler(uint16(bytes[0], bytes[1])); + }); + } + }, + toAlias: { + value: function(index) { + var state = priv.get(this); + return state.keys[index]; + } + }, + toIndices: { + value: function(raw) { + var state = priv.get(this); + var indices = []; + for (var i = 0; i < state.length; i++) { + if (raw & (1 << i)) { + indices.push(i); + } + } + return indices; + } + } + }, + "4X4_I2C_NANO_BACKPACK": { + ADDRESSES: { + value: [0x0A, 0x0B, 0x0C, 0x0D] + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || this.ADDRESSES[0]; + var keys = flatKeys(opts); + var mapping = [1, 2, 3, "A", 4, 5, 6, "B", 7, 8, 9, "C", "*", 0, "#", "D"]; + var length = 0; + + if (!keys.length) { + keys = mapping; + } + + length = mapping.length; + + state.length = length; + state.touches = touches(length); + state.mapping = mapping; + state.keys = keys; + state.isMultitouch = true; + + opts.address = address; + + this.io.i2cConfig(opts); + this.io.i2cRead(address, 2, function(bytes) { + dataHandler(uint16(bytes[0], bytes[1])); + }); + } + }, + toAlias: { + value: function(index) { + var state = priv.get(this); + return state.keys[index]; + } + }, + toIndices: { + value: function(raw) { + var state = priv.get(this); + var indices = []; + for (var i = 0; i < state.length; i++) { + if (raw & (1 << i)) { + indices.push(i); + } + } + return indices; + } + } + }, + SX1509: { + ADDRESSES: { + value: [0x0A, 0x0B, 0x0C, 0x0D] + }, + REGISTER: { + value: { + PULLUP: 0x03, + OPEN_DRAIN: 0x05, + DIR: 0x07, + DIR_B: 0x0E, + DIR_A: 0x0F, + // OPEN_DRAIN_B: 0x0E, + // OPEN_DRAIN_A: 0x0F, + }, + }, + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var address = opts.address || this.ADDRESSES[0]; + var keys = flatKeys(opts); + var mapping = [1, 2, 3, 4, 5, 6, 7, 8, 9, "*", 0, "#"]; + var length = 0; + + if (!keys.length) { + keys = mapping; + } + + length = mapping.length; + + state.length = length; + state.touches = touches(length); + state.mapping = mapping; + state.keys = keys; + state.isMultitouch = true; + + opts.address = address; + + this.io.i2cConfig(opts); + + this.io.i2cWriteReg(address, this.REGISTER.DIR, 0xF0); + this.io.i2cWriteReg(address, this.REGISTER.OPEN_DRAIN, 0x0F); + this.io.i2cWriteReg(address, this.REGISTER.PULLUP, 0xF0); + + this.io.i2cRead(address, 2, function(bytes) { + dataHandler(uint16(bytes[0], bytes[1])); + }); + } + }, + toAlias: { + value: function(index) { + var state = priv.get(this); + return state.keys[index]; + } + }, + toIndices: { + value: function(raw) { + var state = priv.get(this); + var indices = []; + for (var i = 0; i < state.length; i++) { + if (raw & (1 << i)) { + indices.push(i); + } + } + return indices; + } + } + }, +}; + + +// Otherwise known as... +Controllers.MPR121QR2 = Controllers.MPR121; +Controllers.MPR121QR2_SHIELD = Controllers.MPR121; +Controllers.MPR121_KEYPAD = Controllers.MPR121; +Controllers.MPR121_SHIELD = Controllers.MPR121; +Controllers.QTOUCH = Controllers.AT42QT1070; + +function touches(length) { + return Array.from({ + length: length + }, function() { + return { + timeout: null, + value: 0, + }; + }); +} + +function Keypad(opts) { + + if (!(this instanceof Keypad)) { + return new Keypad(opts); + } + + // Initialize a Device instance on a Board + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var raw = null; + var controller = null; + var state = { + touches: null, + timeout: null, + length: null, + keys: null, + mapping: null, + holdtime: null, + }; + + var trigger = Fn.debounce(function(type, value) { + var event = { + type: type, + which: value, + timestamp: Date.now() + }; + aliases[type].forEach(function(type) { + this.emit(type, event); + }, this); + + this.emit("change", Object.assign({}, event)); + }, 5); + + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.ANALOG; + } + + Board.Controller.call(this, controller, opts); + + state.holdtime = opts.holdtime ? opts.holdtime : 500; + + priv.set(this, state); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + + raw = data; + + var now = Date.now(); + var indices = this.toIndices(data); + var kLength = state.length; + + var lists = { + down: [], + hold: [], + up: [], + }; + + var target = null; + var alias = null; + + for (var k = 0; k < kLength; k++) { + alias = this.toAlias(k); + + if (indices.includes(k)) { + if (state.touches[k].value === 0) { + + state.touches[k].timeout = now + state.holdtime; + lists.down.push(alias); + + } else if (state.touches[k].value === 1) { + if (state.touches[k].timeout !== null && now > state.touches[k].timeout) { + state.touches[k].timeout = now + state.holdtime; + lists.hold.push(alias); + } + } + + state.touches[k].value = 1; + } else { + if (state.touches[k].value === 1) { + state.touches[k].timeout = null; + lists.up.push(alias); + } + state.touches[k].value = 0; + } + target = null; + alias = null; + } + + Object.keys(lists).forEach(function(key) { + var list = lists[key]; + + if (list.length) { + trigger.call(this, key, list); + } + }, this); + }.bind(this)); + } + + Object.defineProperties(this, { + isMultitouch: { + get: function() { + return state.isMultitouch; + } + }, + value: { + get: function() { + return raw; + } + }, + }); +} + +util.inherits(Keypad, Emitter); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Keypad.Controllers = Controllers; + Keypad.purge = function() { + priv.clear(); + }; +} + +module.exports = Keypad; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/lcd-chars.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/lcd-chars.js new file mode 100644 index 00000000..c01a4527 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/lcd-chars.js @@ -0,0 +1,120 @@ +// http://www.quinapalus.com/hd44780udg.html +// http://www.darreltaylor.com/files/CustChar.htm + +module.exports = { + DEFAULT: { + "0": [0xe, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0xe], + "1": [0x2, 0x6, 0xe, 0x6, 0x6, 0x6, 0x6], + "2": [0xe, 0x1b, 0x3, 0x6, 0xc, 0x18, 0x1f], + "3": [0xe, 0x1b, 0x3, 0xe, 0x3, 0x1b, 0xe], + "4": [0x3, 0x7, 0xf, 0x1b, 0x1f, 0x3, 0x3], + "5": [0x1f, 0x18, 0x1e, 0x3, 0x3, 0x1b, 0xe], + "6": [0xe, 0x1b, 0x18, 0x1e, 0x1b, 0x1b, 0xe], + "7": [0x1f, 0x3, 0x6, 0xc, 0xc, 0xc, 0xc], + "8": [0xe, 0x1b, 0x1b, 0xe, 0x1b, 0x1b, 0xe], + "9": [0xe, 0x1b, 0x1b, 0xf, 0x3, 0x1b, 0xe], + "10": [0x17, 0x15, 0x15, 0x15, 0x17, 0x0, 0x1f], + "11": [0xa, 0xa, 0xa, 0xa, 0xa, 0x0, 0x1f], + "12": [0x17, 0x11, 0x17, 0x14, 0x17, 0x0, 0x1f], + "13": [0x17, 0x11, 0x13, 0x11, 0x17, 0x0, 0x1f], + "14": [0x15, 0x15, 0x17, 0x11, 0x11, 0x0, 0x1f], + "15": [0x17, 0x14, 0x17, 0x11, 0x17, 0x0, 0x1f], + "16": [0x17, 0x14, 0x17, 0x15, 0x17, 0x0, 0x1f], + "17": [0x17, 0x11, 0x12, 0x12, 0x12, 0x0, 0x1f], + "18": [0x17, 0x15, 0x17, 0x15, 0x17, 0x0, 0x1f], + "19": [0x17, 0x15, 0x17, 0x11, 0x17, 0x0, 0x1f], + circle: [0x0, 0xe, 0x11, 0x11, 0x11, 0xe, 0x0], + cdot: [0x0, 0xe, 0x11, 0x15, 0x11, 0xe, 0x0], + donut: [0x0, 0xe, 0x1f, 0x1b, 0x1f, 0xe, 0x0], + ball: [0x0, 0xe, 0x1f, 0x1f, 0x1f, 0xe, 0x0], + + square: [0x0, 0x1f, 0x11, 0x11, 0x11, 0x1f, 0x0], + sdot: [0x0, 0x1f, 0x11, 0x15, 0x11, 0x1f, 0x0], + fbox: [0x0, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0], + sbox: [0x0, 0x0, 0xe, 0xa, 0xe, 0x0, 0x0], + sfbox: [0x0, 0x0, 0xe, 0xe, 0xe, 0x0, 0x0], + bigpointerright: [0x8, 0xc, 0xa, 0x9, 0xa, 0xc, 0x8], + bigpointerleft: [0x2, 0x6, 0xa, 0x12, 0xa, 0x6, 0x2], + arrowright: [0x8, 0xc, 0xa, 0x9, 0xa, 0xc, 0x8], + arrowleft: [0x2, 0x6, 0xa, 0x12, 0xa, 0x6, 0x2], + ascprogress1: [0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10], + ascprogress2: [0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18], + ascprogress3: [0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c], + ascprogress4: [0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e], + fullprogress: [0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f], + descprogress1: [1, 1, 1, 1, 1, 1, 1, 1], + descprogress2: [3, 3, 3, 3, 3, 3, 3, 3], + descprogress3: [7, 7, 7, 7, 7, 7, 7, 7], + descprogress4: [15, 15, 15, 15, 15, 15, 15, 15], + ascchart1: [31, 0, 0, 0, 0, 0, 0, 0], + ascchart2: [31, 31, 0, 0, 0, 0, 0, 0], + ascchart3: [31, 31, 31, 0, 0, 0, 0, 0], + ascchart4: [31, 31, 31, 31, 0, 0, 0, 0], + ascchart5: [31, 31, 31, 31, 31, 0, 0, 0], + ascchart6: [31, 31, 31, 31, 31, 31, 0, 0], + ascchart7: [31, 31, 31, 31, 31, 31, 31, 0], + descchart1: [0, 0, 0, 0, 0, 0, 0, 31], + descchart2: [0, 0, 0, 0, 0, 0, 31, 31], + descchart3: [0, 0, 0, 0, 0, 31, 31, 31], + descchart4: [0, 0, 0, 0, 31, 31, 31, 31], + descchart5: [0, 0, 0, 31, 31, 31, 31, 31], + descchart6: [0, 0, 31, 31, 31, 31, 31, 31], + descchart7: [0, 31, 31, 31, 31, 31, 31, 31], + borderleft1: [1, 1, 1, 1, 1, 1, 1, 1], + borderleft2: [3, 2, 2, 2, 2, 2, 2, 3], + borderleft3: [7, 4, 4, 4, 4, 4, 4, 7], + borderleft4: [15, 8, 8, 8, 8, 8, 8, 15], + borderleft5: [31, 16, 16, 16, 16, 16, 16, 31], + bordertopbottom5: [31, 0, 0, 0, 0, 0, 0, 31], + borderright1: [16, 16, 16, 16, 16, 16, 16, 16], + borderright2: [24, 8, 8, 8, 8, 8, 8, 24], + borderright3: [28, 4, 4, 4, 4, 4, 4, 28], + borderright4: [30, 2, 2, 2, 2, 2, 2, 30], + borderright5: [31, 1, 1, 1, 1, 1, 1, 31], + box1: [3, 3, 3, 0, 0, 0, 0], + box2: [24, 24, 24, 0, 0, 0, 0], + box3: [27, 27, 27, 0, 0, 0, 0], + box4: [0, 0, 0, 0, 3, 3, 3], + box5: [3, 3, 3, 0, 3, 3, 3], + box6: [24, 24, 24, 0, 3, 3, 3], + box7: [27, 27, 27, 0, 3, 3, 3], + box8: [0, 0, 0, 0, 24, 24, 24], + box9: [3, 3, 3, 0, 24, 24, 24], + box10: [24, 24, 24, 0, 24, 24, 24], + box11: [27, 27, 27, 0, 24, 24, 24], + box12: [0, 0, 0, 0, 27, 27, 27], + box13: [3, 3, 3, 0, 27, 27, 27], + box14: [24, 24, 24, 0, 27, 27, 27], + box15: [27, 27, 27, 0, 27, 27, 27], + euro: [3, 4, 30, 8, 30, 8, 7], + cent: [0, 0, 14, 17, 16, 21, 14, 8], + speaker: [1, 3, 15, 15, 15, 3, 1], + sound: [8, 16, 0, 24, 0, 16, 8], + x: [0, 27, 14, 4, 14, 27, 0], + target: [0, 10, 17, 21, 17, 10, 0], + pointerright: [0, 8, 12, 14, 12, 8, 0], + pointerup: [0, 0, 4, 14, 31, 0, 0], + pointerleft: [0, 2, 6, 14, 6, 2, 0], + pointerdown: [0, 0, 31, 14, 4, 0, 0], + arrowne: [0, 15, 3, 5, 9, 16, 0], + arrownw: [0, 30, 24, 20, 18, 1, 0], + arrowsw: [0, 1, 18, 20, 24, 30, 0], + arrowse: [0, 16, 9, 5, 3, 15, 0], + dice1: [0, 0, 0, 4, 0, 0, 0], + dice2: [0, 16, 0, 0, 0, 1, 0], + dice3: [0, 16, 0, 4, 0, 1, 0], + dice4: [0, 17, 0, 0, 0, 17, 0], + dice5: [0, 17, 0, 4, 0, 17, 0], + dice6: [0, 17, 0, 17, 0, 17, 0], + bell: [4, 14, 14, 14, 31, 0, 4], + smile: [0, 10, 0, 17, 14, 0, 0], + note: [2, 3, 2, 14, 30, 12, 0], + clock: [0, 14, 21, 23, 17, 14, 0], + heart: [0, 10, 31, 31, 31, 14, 4, 0], + duck: [0, 12, 29, 15, 15, 6, 0], + check: [0, 1, 3, 22, 28, 8, 0], + retarrow: [1, 1, 5, 9, 31, 8, 4], + runninga: [6, 6, 5, 14, 20, 4, 10, 17], + runningb: [6, 6, 4, 14, 14, 4, 10, 10] + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/lcd.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/lcd.js new file mode 100644 index 00000000..e481805e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/lcd.js @@ -0,0 +1,1126 @@ +var Board = require("./board"); +var Pin = require("./pin"); +var lcdCharacters = require("./lcd-chars"); +var RGB = require("./led/rgb"); + +var priv = new Map(); + +/** + * This atrocity is unfortunately necessary. + * If any other approach can be found, patches + * will gratefully be accepted. + */ +function sleepus(usDelay) { + var startTime = process.hrtime(); + var deltaTime; + var usWaited = 0; + + while (usDelay > usWaited) { + deltaTime = process.hrtime(startTime); + usWaited = (deltaTime[0] * 1E9 + deltaTime[1]) / 1000; + } +} + +/** + * This atrocity is unfortunately necessary. + * If any other approach can be found, patches + * will gratefully be accepted. + */ +function sleep(ms) { + sleepus(ms * 1000); +} + + +// TODO: Migrate this to the new codified Expander class. +// +// - add portMode to PCF8574 controller +// - add portWrite to PCF8574 controller +// +// +// TODO: Investigate adding the above methods to +// all expander controllers. +// +function Expander(address, io) { + this.address = address; + this.mask = 0xFF; + this.memory = 0x00; + this.io = io; +} + +Expander.prototype.pinMode = function(pin, dir) { + if (dir === 0x01) { + this.mask &= ~(1 << pin); + } else { + this.mask |= 1 << pin; + } +}; + +Expander.prototype.portMode = function(dir) { + this.mask = dir === 0x00 ? 0xFF : 0x00; +}; + +Expander.prototype.portWrite = function(value) { + this.memory = value & ~(this.mask); + this.io.i2cWrite(this.address, this.memory); +}; + + + + +// const-caps throughout serve to indicate the +// "const-ness" of the binding to the reader +// and nothing more. + +var REGISTER = { + DEFAULT: { + SHIFT_LEFT: 0x04, + + CLEAR: 0x01, + HOME: 0x02, + ENTRY: 0x04, + DISPLAY: 0x08, + DIMENSIONS: 0x20, + CURSORSHIFT: 0x10, + + SETCGRAMADDR: 0x40, + SETDDRAMADDR: 0x80, + + // Command And Control + + DATA: 0x40, + COMMAND: 0x80, + + // flags for display entry mode + ENTRYRIGHT: 0x00, + ENTRYLEFT: 0x02, + ENTRYSHIFTINCREMENT: 0x01, + ENTRYSHIFTDECREMENT: 0x00, + + // flags for display on/off control + DISPLAYON: 0x04, + DISPLAYOFF: 0x00, + CURSORON: 0x02, + CURSOROFF: 0x00, + BLINKON: 0x01, + BLINKOFF: 0x00, + + // flags for display/cursor shift + DISPLAYMOVE: 0x08, + CURSORMOVE: 0x00, + MOVERIGHT: 0x04, + MOVELEFT: 0x00, + + // flags for function set + BITMODE: { + 4: 0x00, + 8: 0x10, + }, + + LINE: { + 1: 0x00, + 2: 0x08 + }, + + DOTS: { + "5x10": 0x04, + "5x8": 0x00 + }, + + // flags for backlight control + BACKLIGHT_ON: 0x08, + BACKLIGHT_OFF: 0x00, + + MEMORYLIMIT: 0x08, + + // Control + // Enable + EN: 0x04, + // Read/Write + RW: 0x02, + // Register Select + RS: 0x01, + + // DATA + D4: 0x04, + D5: 0x05, + D6: 0x06, + D7: 0x07, + } +}; + +var Controllers = { + JHD1313M1: { + REGISTER: { + value: REGISTER.DEFAULT, + }, + CHARS: { + value: lcdCharacters.DEFAULT, + }, + initialize: { + value: function(opts) { + + // LCD: 0x3E + // RGB: 0x62 + this.address = { + lcd: opts.address || 0x3E, + rgb: 0x62 + }; + + opts.address = this.address; + + this.io.i2cConfig(opts); + + this.lines = opts.lines || 2; + this.rows = opts.rows || 2; + this.cols = opts.cols || 16; + this.dots = opts.dots || "5x8"; + + + var display = this.REGISTER.DISPLAY | this.REGISTER.DISPLAYON | this.REGISTER.CURSOROFF | this.REGISTER.BLINKOFF; + + var state = { + display: display, + characters: {}, + index: this.REGISTER.MEMORYLIMIT - 1, + backlight: { + polarity: 1, + pin: null, + value: null + } + }; + + priv.set(this, state); + + // Operations within the following labelled block are init-only, + // but _do_ block the process negligible number of milliseconds. + blocking: { + var lines = this.REGISTER.DIMENSIONS | this.REGISTER.LINE[2]; + // Copied from Grove Studio lib. + // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION! + // according to datasheet, we need at least 40ms after + // power rises above 2.7V before sending commands. + // Arduino can turn on way before 4.5V so we'll wait 50 + + + + sleep(50); + this.command(lines); + sleep(5); + this.command(lines); + this.command(lines); + this.command(lines); + sleep(5); + + this.command( + this.REGISTER.ENTRY | + this.REGISTER.ENTRYLEFT | + this.REGISTER.ENTRYSHIFTDECREMENT + ); + + this.on(); + this.clear(); + this.home(); + } + + // Backlight initialization + + + + this.bgOn(); + + if (opts.color) { + this.bgColor(opts.color); + } else { + this.bgColor("black"); + } + }, + }, + clear: { + value: function() { + return this.command(this.REGISTER.CLEAR); + } + }, + setCursor: { + value: function(col, row) { + return this.command(row === 0 ? col | 0x80 : col | 0xc0); + } + }, + autoscroll: { + value: function() { + var state = priv.get(this); + + state.display = this.REGISTER.ENTRYLEFT | this.REGISTER.ENTRYSHIFTINCREMENT; + this.command(this.REGISTER.ENTRY | state.display); + + return this; + } + }, + bgColor: { + value: function(red, green, blue) { + var rgb = RGB.ToRGB(red, green, blue); + var address = this.address.rgb; + + this.io.i2cWrite(address, [0x00, 0]); + this.io.i2cWrite(address, [0x01, 0]); + + // TRY THIS IN ONE CALL! + this.io.i2cWrite(address, [0x04, rgb.red]); + this.io.i2cWrite(address, [0x03, rgb.green]); + this.io.i2cWrite(address, [0x02, rgb.blue]); + + return this; + } + }, + bgOn: { + value: function() { + this.io.i2cWrite(this.address.rgb, [this.REGISTER.BACKLIGHT_ON, 0xAA]); + return this; + } + }, + bgOff: { + value: function() { + this.io.i2cWrite(this.address.rgb, [this.REGISTER.BACKLIGHT_ON, 0x00]); + return this; + } + }, + command: { + value: function(mode, value) { + if (arguments.length === 1) { + value = mode; + mode = this.REGISTER.COMMAND; + } + + if (mode === this.REGISTER.DATA) { + return this.send(value); + } + + return this.writeBits(this.REGISTER.COMMAND, value); + } + }, + send: { + value: function(value) { + return this.writeBits(this.REGISTER.DATA, value); + } + }, + writeBits: { + value: function(mode, value) { + this.io.i2cWrite(this.address.lcd, [mode, value]); + return this; + } + }, + hilo: { + value: function(callback) { + callback.call(this); + } + }, + }, + + + PCF8574: { + + REGISTER: { + value: Object.assign({}, REGISTER.DEFAULT, { + COMMAND: 0x00, + DATA: 0x01, + BACKLIGHT_ON: 0xFF, + BACKLIGHT_OFF: 0X00 + }), + }, + CHARS: { + value: lcdCharacters.DEFAULT, + }, + initialize: { + value: function(opts) { + + this.bitMode = opts.bitMode || 4; + this.lines = opts.lines || 2; + this.rows = opts.rows || 2; + this.cols = opts.cols || 16; + this.dots = opts.dots || "5x8"; + + if (!opts.address) { + opts.address = ["PCF8574A", "PCF8574AT"].includes(opts.controller) ? + 0x3F : 0x27; + + /* + | A2 | A1 | A0 | PCF8574(T) | PCF8574A(T) | + |----|----|----|---------|----------| + | L | L | L | 0x20 | 0x38 | + | L | L | H | 0x21 | 0x39 | + | L | H | L | 0x22 | 0x3A | + | L | H | H | 0x23 | 0x3B | + | H | L | L | 0x24 | 0x3C | + | H | L | H | 0x25 | 0x3D | + | H | H | L | 0x26 | 0x3E | + | H | H | H | 0x27 | 0x3F | + + TODO: move to API docs + */ + } + + this.io.i2cConfig(opts); + + this.address = { + lcd: opts.address + }; + + // Ported from https://bitbucket.org/fmalpartida/new-liquidcrystal + this.expander = new Expander(this.address.lcd, this.io); + this.expander.portMode(this.io.MODES.OUTPUT); + this.expander.portWrite(0); + + var backlight = opts.backlight || { + polarity: 0, + pin: 3 + }; + + backlight.pin = typeof backlight.pin === "undefined" ? 3 : backlight.pin; + backlight.polarity = typeof backlight.polarity === "undefined" ? 0 : backlight.polarity; + + var dimensions = this.REGISTER.BITMODE[this.bitMode] | + this.REGISTER.LINE[this.lines] | + this.REGISTER.DOTS[this.dots]; + + var display = this.REGISTER.DISPLAY | + this.REGISTER.DISPLAYON | + this.REGISTER.CURSOROFF | + this.REGISTER.BLINKOFF; + + var entry = this.REGISTER.ENTRYLEFT | + this.REGISTER.ENTRYSHIFTDECREMENT; + + + var state = { + display: display, + characters: {}, + index: this.REGISTER.MEMORYLIMIT - 1, + backlight: { + polarity: backlight.polarity, + pinMask: 1 << backlight.pin, + statusMask: 0x00 + }, + data: [ + 1 << this.REGISTER.D4, + 1 << this.REGISTER.D5, + 1 << this.REGISTER.D6, + 1 << this.REGISTER.D7 + ] + }; + + priv.set(this, state); + + var toggle = 0x03 << this.REGISTER.SHIFT_LEFT; + + // Operations within the following labelled block are init-only, + // but _do_ block the process for negligible number of milliseconds. + blocking: { + // + // Toggle write/pulse to reset the LCD component. + // + this.expander.portWrite(toggle); + this.pulse(toggle); + sleep(4); + + this.expander.portWrite(toggle); + this.pulse(toggle); + sleep(4); + + this.expander.portWrite(toggle); + this.pulse(toggle); + + toggle = 0x02 << this.REGISTER.SHIFT_LEFT; + + this.expander.portWrite(toggle); + this.pulse(toggle); + + // Initialize the reset component + this.command(this.REGISTER.DIMENSIONS | dimensions); + + // Set display details + this.command(state.display); + + // Now that the initial display is set, + // overwrite with the "entry" bits + state.display = entry; + + this.command(this.REGISTER.ENTRY | state.display); + + this.on(); + this.clear(); + this.backlight(); + } + }, + }, + clear: { + value: function() { + this.command(this.REGISTER.CLEAR); + sleep(2); + return this; + + } + }, + backlight: { + value: function(value) { + var state = priv.get(this); + var mask; + + value = typeof value === "undefined" ? 255 : value; + + if (state.backlight.pinMask !== 0x00) { + if ((state.backlight.polarity === 0 && value > 0) || + (state.backlight.polarity === 1 && value === 0)) { + + mask = 0xFF; + } else { + mask = 0x00; + } + + state.backlight.statusMask = state.backlight.pinMask & mask; + + this.expander.portWrite(state.backlight.statusMask); + } + + return this; + } + }, + + createChar: { + value: function(name, charMap) { + var state = priv.get(this); + var address; + + if (typeof name === "number") { + address = name & 0x07; + } else { + address = state.index; + state.index--; + if (state.index === -1) { + state.index = this.REGISTER.MEMORYLIMIT - 1; + } + } + + this.command(this.REGISTER.SETCGRAMADDR | (address << 3)); + + blocking: { + sleep(1); + + for (var i = 0; i < 8; i++) { + this.command(this.REGISTER.DATA, charMap[i]); + sleep(1); + } + } + + state.characters[name] = address; + + return address; + } + }, + noBacklight: { + value: function() { + this.backlight(0); + } + }, + on: { + value: function() { + var state = priv.get(this); + + state.display |= this.REGISTER.DISPLAYON; + this.command(this.REGISTER.DISPLAY | state.display); + + return this; + } + }, + off: { + value: function() { + var state = priv.get(this); + + state.display &= ~this.REGISTER.DISPLAYON; + this.command(this.REGISTER.DISPLAY | state.display); + + return this; + } + }, + hilo: { + value: function(callback) { + callback.call(this); + } + }, + command: { + value: function(mode, value) { + + if (arguments.length === 1) { + value = mode; + mode = this.REGISTER.COMMAND; + } + + this.send(mode, value); + + return this; + } + }, + send: { + writable: true, + value: function(mode, value) { + + this.writeBits(mode, value >> 4); + this.writeBits(mode, value & 0x0F); + + return this; + } + }, + writeBits: { + writable: true, + value: function(mode, value) { + var state = priv.get(this); + var pinMapValue = 0; + + for (var i = 0; i < 4; i++) { + if ((value & 0x01) === 1) { + pinMapValue |= state.data[i]; + } + value = (value >> 1); + } + + if (mode === this.REGISTER.DATA) { + mode = this.REGISTER.RS; + } + + pinMapValue |= mode | state.backlight.statusMask; + + this.pulse(pinMapValue); + return this; + } + }, + pulse: { + writable: true, + value: function(data) { + this.expander.portWrite(data | this.REGISTER.EN); // En HIGH + this.expander.portWrite(data & ~this.REGISTER.EN); // En LOW + } + } + }, + + + PARALLEL: { + REGISTER: { + value: REGISTER.DEFAULT, + }, + CHARS: { + value: lcdCharacters.DEFAULT, + }, + initialize: { + value: function(opts) { + + this.bitMode = opts.bitMode || 4; + this.lines = opts.lines || 2; + this.rows = opts.rows || 2; + this.cols = opts.cols || 16; + this.dots = opts.dots || "5x8"; + + if (Array.isArray(opts.pins)) { + this.pins = { + rs: opts.pins[0], + en: opts.pins[1], + // TODO: Move to device map profile + data: [ + opts.pins[5], + opts.pins[4], + opts.pins[3], + opts.pins[2] + ] + }; + } else { + this.pins = opts.pins; + } + + var display = this.REGISTER.DISPLAY | this.REGISTER.DISPLAYON; + var state = { + display: display, + characters: {}, + index: this.REGISTER.MEMORYLIMIT - 1, + backlight: { + polarity: 1, + pin: null, + value: null + } + }; + + priv.set(this, state); + + opts.pins.forEach(function(pin) { + this.io.pinMode(pin, 1); + }, this); + + this.io.digitalWrite(this.pins.rs, this.io.LOW); + this.io.digitalWrite(this.pins.en, this.io.LOW); + + if (opts.backlight) { + if (typeof opts.backlight === "number") { + var temp = opts.backlight; + opts.backlight = { + pin: temp + }; + } + + if (opts.backlight.pin) { + state.backlight.pin = new Pin({ + pin: opts.backlight.pin, + board: this.board + }); + + state.backlight.pin.high(); + } + } + + // Operations within the following labelled block are init-only, + // but _do_ block the process negligible number of milliseconds. + blocking: { + // Send 0b00000011 thrice to make sure LCD + // is initialized properly + this.command(0x03); + sleep(4); + this.command(0x03); + sleep(4); + this.command(0x03); + + // Switch to 4-bit mode + if (this.bitMode === 4) { + // this.REGISTER.DIMENSIONS | + this.command(0x02); + } + + // Set number of lines and dots + // TODO: Move to device map profile + this.command( + this.REGISTER.LINE[this.lines] | + this.REGISTER.DOTS[this.dots] + ); + + // Clear display and turn it on + this.command(display); + this.clear(); + this.home(); + } + } + } + } +}; + +// Alias controllers +Controllers.LCM1602 = Controllers.LCD1602 = Controllers.LCM1602IIC = Controllers.LCD2004 = Controllers.PCF8574A = Controllers.PCF8574AT = Controllers.PCF8574T = Controllers.PCF8574; + +Controllers.MJKDZ = Object.assign({}, Controllers.PCF8574, { + REGISTER: { + value: Object.assign({}, REGISTER.DEFAULT, { + SHIFT_LEFT: 0x00, + + COMMAND: 0x00, + DATA: 0x06, + + // Control + // Enable + EN: 0x10, + // Read/Write + RW: 0x05, + // Register Select + RS: 0x06, + + D4: 0x00, + D5: 0x01, + D6: 0x02, + D7: 0x03 + }) + }, + writeBits: { + writable: true, + value: function(mode, value) { + var state = priv.get(this); + var pinMapValue = 0; + + for (var i = 0; i < 4; i++) { + if ((value & 0x01) === 1) { + pinMapValue |= state.data[i]; + } + value = (value >> 1); + } + + if (mode === this.REGISTER.DATA) { + mode = (1 << this.REGISTER.RS); + } + + pinMapValue |= mode | state.backlight.statusMask; + + this.pulse(pinMapValue); + return this; + } + }, +}); + +/** + * LCD + * @param {[type]} opts [description] + */ + +function LCD(opts) { + + if (!(this instanceof LCD)) { + return new LCD(opts); + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var controller = null; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.PARALLEL; + } + + Board.Controller.call(this, controller, opts); + + this.ctype = opts.controller; + + if (this.initialize) { + this.initialize(opts); + } + + Object.defineProperties(this, { + characters: { + get: function() { + return Object.assign({}, priv.get(this).characters); + }, + }, + }); +} + +LCD.prototype.command = function(mode, value) { + if (typeof value === "undefined") { + value = mode; + mode = 0x80; + } + + if (this.bitMode === 4) { + this.send(value >> 4); + } + + this.send(value); + + return this; +}; + +LCD.prototype.send = function(value) { + var pin = 0; + var mask = { + 4: 8, + 8: 128 + }[this.bitMode]; + + for (; mask > 0; mask = mask >> 1) { + this.io.digitalWrite( + this.pins.data[pin], + this.io[value & mask ? "HIGH" : "LOW"] + ); + pin++; + } + + // At VCC = 3.3V, the minimum enable pulse width is specified as 450 + // nanoseconds on page 49 of the HD44780 datasheet. + // We therefore wait for 1 microsecond here to ensure that fast IO plugins + // like Pi-IO generate an enable pulse that's wide enough. + this.io.digitalWrite(this.pins.en, this.io.LOW); + this.io.digitalWrite(this.pins.en, this.io.HIGH); + sleepus(1); + this.io.digitalWrite(this.pins.en, this.io.LOW); + + // The execution time for the vast majority of instructions is at least + // 37 microseconds. See datasheet pages 24 and 25. + // It's important to wait 37 microseconds here to prevent fast IO plugins + // like Pi-IO from executing the next instruction before the current + // instruction has completed. + sleepus(37); + + return this; +}; + +LCD.prototype.hilo = function(callback) { + // RS High for write mode + this.io.digitalWrite(this.pins.rs, this.io.HIGH); + + callback.call(this); + + // RS Low for command mode + this.io.digitalWrite(this.pins.rs, this.io.LOW); +}; + + + +var RE_SPECIALS = /:(\w+):/g; + +LCD.prototype.print = function(message, opts) { + var state, dontProcessSpecials, hasCharacters, processed; + + message = message + ""; + opts = opts || {}; + + state = priv.get(this); + dontProcessSpecials = opts.dontProcessSpecials || false; + hasCharacters = !dontProcessSpecials && RE_SPECIALS.test(message); + + if (message.length === 1) { + this.hilo(function() { + this.command(this.REGISTER.DATA, message.charCodeAt(0)); + }); + } else { + + if (hasCharacters) { + processed = message.replace(RE_SPECIALS, function(match, name) { + var address = state.characters[name]; + + return typeof address === "number" ? String.fromCharCode(address) : match; + }); + + this.print(processed, { + dontProcessSpecials: true + }); + } else { + this.hilo(function() { + Array.from(message).forEach(function(character) { + this.command(this.REGISTER.DATA, character.charCodeAt(0)); + }, this); + }); + } + } + + return this; +}; + +LCD.prototype.write = function(charCode) { + this.hilo.call(this, function() { + this.command(this.REGISTER.DATA, charCode); + }); + + return this; +}; + +LCD.prototype.clear = function() { + this.command(this.REGISTER.CLEAR); + sleep(2); + return this; +}; + +LCD.prototype.home = function() { + this.command(this.REGISTER.HOME); + sleep(2); + return this; +}; + +LCD.prototype.setCursor = function(col, row) { + var rowOffsets = [0x00, 0x40, 0x14, 0x54]; + this.command(this.REGISTER.SETDDRAMADDR | (col + rowOffsets[row])); + return this; +}; + +LCD.prototype.backlight = function(highOrLow) { + var state = priv.get(this); + + highOrLow = typeof highOrLow === "undefined" ? true : false; + + if (state.backlight.pin instanceof Pin) { + if (highOrLow) { + state.backlight.pin.high(); + } else { + state.backlight.pin.low(); + } + } + + if (highOrLow) { + state.display |= this.REGISTER.DISPLAYON; + } else { + state.display &= ~this.REGISTER.DISPLAYON; + } + + this.command(state.display); + + return this; +}; + +LCD.prototype.noBacklight = function() { + var state = priv.get(this); + + if (state.backlight.pin instanceof Pin) { + state.backlight.pin.high(); + } + + // if (highOrLow) { + // state.display |= this.REGISTER.DISPLAYON; + // } else { + // state.display &= ~this.REGISTER.DISPLAYON; + // } + + // this.command(state.display); + + return this.backlight(false); +}; + +LCD.prototype.on = function() { + var state = priv.get(this); + + state.display |= this.REGISTER.DISPLAYON; + this.command(state.display); + + return this; +}; + +LCD.prototype.off = function() { + var state = priv.get(this); + + state.display &= ~this.REGISTER.DISPLAYON; + this.command(state.display); + + return this; +}; + +LCD.prototype.cursor = function(row, col) { + // When provided with col & row, cursor will behave like setCursor, + // except that it has row and col in the order that most people + // intuitively expect it to be in. + if (typeof col !== "undefined" && typeof row !== "undefined") { + return this.setCursor(col, row); + } + var state = priv.get(this); + + state.display |= this.REGISTER.CURSORON; + this.command(state.display); + + return this; +}; + +LCD.prototype.noCursor = function() { + var state = priv.get(this); + + state.display &= ~this.REGISTER.CURSORON; + this.command(state.display); + + return this; +}; + +LCD.prototype.blink = function() { + var state = priv.get(this); + + state.display |= this.REGISTER.BLINKON; + this.command(state.display); + + return this; +}; + +LCD.prototype.noBlink = function() { + var state = priv.get(this); + + state.display &= ~this.REGISTER.BLINKON; + this.command(state.display); + + return this; +}; + +LCD.prototype.autoscroll = function() { + var state = priv.get(this); + + state.display |= this.REGISTER.ENTRYSHIFTINCREMENT; + this.command(this.REGISTER.ENTRY | state.display); + + return this; +}; + +LCD.prototype.noAutoscroll = function() { + var state = priv.get(this); + + state.display &= ~this.REGISTER.ENTRYSHIFTINCREMENT; + this.command(this.REGISTER.ENTRY | state.display); + + return this; +}; + +LCD.prototype.createChar = function(name, charMap) { + // Ensure location is never above 7 + var state = priv.get(this); + var address; + + if (typeof name === "number") { + address = name & 0x07; + } else { + address = state.index; + state.index--; + if (state.index === -1) { + state.index = this.REGISTER.MEMORYLIMIT - 1; + } + } + + this.command(this.REGISTER.SETCGRAMADDR | (address << 3)); + + this.hilo(function() { + for (var i = 0; i < 8; i++) { + this.command(this.REGISTER.DATA, charMap[i]); + } + }); + + // Fill in address + state.characters[name] = address; + + return address; +}; + + +LCD.prototype.useChar = function(name) { + var state = priv.get(this); + + if (typeof state.characters[name] === "undefined") { + // Create the character in LCD memory and + var newCharIndex = this.createChar(name, this.CHARS[name]); + + // If character's index already used, remove this character in current LCD character map + // because it's not in LCD memory anymore. + for (var oldName in state.characters) { + if (name !== oldName && state.characters[oldName] === newCharIndex) { + delete state.characters[oldName]; + break; + } + } + + // Add character to current LCD character map + state.characters[name] = newCharIndex; + } + + return this; +}; + + +/** + * + +TODO: + + +burst() + +scrollDisplayLeft() +scrollDisplayRight() + +leftToRight() +rightToLeft() + + +*/ + +LCD.POSITIVE = 0; +LCD.NEGATIVE = 1; + +LCD.Characters = lcdCharacters; + +module.exports = LCD; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/callbacks.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/callbacks.js new file mode 100644 index 00000000..917db4b7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/callbacks.js @@ -0,0 +1,42 @@ +var noop = function() {}; + +module.exports = function(klass, methods) { + // Methods with callbacks need to have the callback called + // as a result of all entries reaching completion, not + // calling the callback once for each entry completion. + // Uses an array to match pattern in Led, and may be more + // in future. + methods.forEach(function(method) { + klass.prototype[method] = function(duration, callback) { + var length = this.length; + var signals = []; + var led; + + if (typeof duration === "function") { + callback = duration; + duration = 1000; + } + + if (typeof callback !== "function") { + callback = noop; + } + + for (var i = 0; i < length; i++) { + led = this[i]; + signals.push( + /* jshint ignore:start */ + new Promise(function(resolve) { + led[method](duration, function() { + resolve(); + }); + }) + /* jshint ignore:end */ + ); + } + + Promise.all(signals).then(callback); + + return this; + }; + }); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/digits.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/digits.js new file mode 100644 index 00000000..2d9cc086 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/digits.js @@ -0,0 +1,13 @@ +var LedControl = require("./ledcontrol"); + +// stub implementation; extract functionality from ledcontrol.js +function Digits(opts) { + opts.isMatrix = false; + return new LedControl(opts); +} + +Object.assign(Digits, LedControl, { + CHARS: LedControl.DIGIT_CHARS +}); + +module.exports = Digits; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/index.js new file mode 100644 index 00000000..bbc50fa9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/index.js @@ -0,0 +1,11 @@ +var Led = require("./led"); +Led.Collection = require("./leds"); +Led.RGB = require("./rgb"); +Led.RGB.Collection = require("./rgbs"); +Led.Matrix = require("./matrix"); +Led.Digits = require("./digits"); + +// TODO: Eliminate .Array for 1.0.0 +Led.Array = Led.Collection; + +module.exports = Led; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/led-chars.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/led-chars.js new file mode 100644 index 00000000..09c309a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/led-chars.js @@ -0,0 +1,364 @@ +// https://dl.dropboxusercontent.com/u/3531958/digits.html + +module.exports = { + MATRIX_CHARS: { + //symbols & punctuation + " ": [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + "!": [0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x04, 0x00], + "\"": [0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00], + "#": [0x0A, 0x0A, 0x1F, 0x0A, 0x1F, 0x0A, 0x0A, 0x00], + "$": [0x04, 0x0F, 0x14, 0x0E, 0x05, 0x1E, 0x04, 0x00], + "%": [0x18, 0x19, 0x02, 0x04, 0x08, 0x13, 0x03, 0x00], + "&": [0x0C, 0x12, 0x14, 0x08, 0x15, 0x12, 0x0D, 0x00], + "'": [0x0C, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00], + "(": [0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02, 0x00], + ")": [0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08, 0x00], + "*": [0x00, 0x04, 0x15, 0x0E, 0x15, 0x04, 0x00, 0x00], + "+": [0x00, 0x04, 0x04, 0x1F, 0x04, 0x04, 0x00, 0x00], + ",": [0x00, 0x00, 0x00, 0x00, 0x0C, 0x04, 0x08, 0x00], + "-": [0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00], + ".": [0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00], + "/": [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x00, 0x00], + "[": [0x0E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0E, 0x00], + "\\": [0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00], + "]": [0x0E, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0E, 0x00], + "^": [0x04, 0x0A, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00], + "_": [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00], + "`": [0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00], + ":": [0x00, 0x0C, 0x0C, 0x00, 0x0C, 0x0C, 0x00, 0x00], + ";": [0x00, 0x0C, 0x0C, 0x00, 0x0C, 0x04, 0x08, 0x00], + "<": [0x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02, 0x00], + "=": [0x00, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0x00, 0x00], + ">": [0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08, 0x00], + "?": [0x0E, 0x11, 0x01, 0x02, 0x04, 0x00, 0x04, 0x00], + "@": [0x0E, 0x11, 0x01, 0x0D, 0x15, 0x15, 0x0E, 0x00], + "{": [0x02, 0x04, 0x04, 0x08, 0x04, 0x04, 0x02, 0x00], + "|": [0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 0x04, 0x00], + "}": [0x08, 0x04, 0x04, 0x02, 0x04, 0x04, 0x08, 0x00], + "~": [0x08, 0x15, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00], + + //standard numbers + "0": [0x0E, 0x11, 0x13, 0x15, 0x19, 0x11, 0x0E, 0x00], + "1": [0x04, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00], + "2": [0x0E, 0x11, 0x01, 0x02, 0x04, 0x08, 0x1F, 0x00], + "3": [0x1F, 0x02, 0x04, 0x02, 0x01, 0x11, 0x0E, 0x00], + "4": [0x02, 0x06, 0x0A, 0x12, 0x1F, 0x02, 0x02, 0x00], + "5": [0x1F, 0x10, 0x1E, 0x01, 0x01, 0x11, 0x0E, 0x00], + "6": [0x06, 0x08, 0x10, 0x1E, 0x11, 0x11, 0x0E, 0x00], + "7": [0x1F, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00], + "8": [0x1E, 0x11, 0x11, 0x0E, 0x11, 0x11, 0x0E, 0x00], + "9": [0x0E, 0x11, 0x11, 0x0F, 0x01, 0x02, 0x0C, 0x00], + + //capital letters + "A": [0x08, 0x14, 0x22, 0x3E, 0x22, 0x22, 0x22, 0x22], + "B": [0x3C, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x3C, 0x00], + "C": [0x3C, 0x40, 0x40, 0x40, 0x40, 0x40, 0x3C, 0x00], + "D": [0x7C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7C, 0x00], + "E": [0x7C, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x7C], + "F": [0x7C, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x40], + "G": [0x3C, 0x40, 0x40, 0x40, 0x40, 0x44, 0x44, 0x3C], + "H": [0x44, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x44, 0x44], + "I": [0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7C], + "J": [0x3C, 0x08, 0x08, 0x08, 0x08, 0x08, 0x48, 0x30], + "K": [0x00, 0x24, 0x28, 0x30, 0x20, 0x30, 0x28, 0x24], + "L": [0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7C], + "M": [0x81, 0xC3, 0xA5, 0x99, 0x81, 0x81, 0x81, 0x81], + "N": [0x00, 0x42, 0x62, 0x52, 0x4A, 0x46, 0x42, 0x00], + "O": [0x3C, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C], + "P": [0x3C, 0x22, 0x22, 0x22, 0x3C, 0x20, 0x20, 0x20], + "Q": [0x1C, 0x22, 0x22, 0x22, 0x22, 0x26, 0x22, 0x1D], + "R": [0x3C, 0x22, 0x22, 0x22, 0x3C, 0x24, 0x22, 0x21], + "S": [0x00, 0x1E, 0x20, 0x20, 0x3E, 0x02, 0x02, 0x3C], + "T": [0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08], + "U": [0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x22, 0x1C], + "V": [0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18], + "W": [0x00, 0x49, 0x49, 0x49, 0x49, 0x2A, 0x1C, 0x00], + "X": [0x00, 0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41], + "Y": [0x41, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x08], + "Z": [0x00, 0x7F, 0x02, 0x04, 0x08, 0x10, 0x20, 0x7F], + + //question: do these need to stay or what? + // "A": [0x0E, 0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x00], + // "B": [0x1E, 0x09, 0x09, 0x0E, 0x09, 0x09, 0x1E, 0x00], + // "C": [0x0E, 0x11, 0x10, 0x10, 0x10, 0x11, 0x0E, 0x00], + // "D": [0x1E, 0x09, 0x09, 0x09, 0x09, 0x09, 0x1E, 0x00], + // "E": [0x1F, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x1F, 0x00], + // "F": [0x1F, 0x10, 0x10, 0x1E, 0x10, 0x10, 0x10, 0x00], + // "G": [0x0E, 0x11, 0x10, 0x13, 0x11, 0x11, 0x0F, 0x00], + // "H": [0x11, 0x11, 0x11, 0x1F, 0x11, 0x11, 0x11, 0x00], + // "I": [0x0E, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00], + // "J": [0x07, 0x02, 0x02, 0x02, 0x02, 0x12, 0x0C, 0x00], + // "K": [0x11, 0x12, 0x14, 0x18, 0x14, 0x12, 0x11, 0x00], + // "L": [0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00], + // "M": [0x11, 0x1B, 0x15, 0x15, 0x11, 0x11, 0x11, 0x00], + // "N": [0x11, 0x19, 0x19, 0x15, 0x13, 0x13, 0x11, 0x00], + // "O": [0x0E, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00], + // "P": [0x1E, 0x11, 0x11, 0x1E, 0x10, 0x10, 0x10, 0x00], + // "Q": [0x0E, 0x11, 0x11, 0x11, 0x15, 0x12, 0x1D, 0x00], + // "R": [0x1E, 0x11, 0x11, 0x1E, 0x14, 0x12, 0x11, 0x00], + // "S": [0x0E, 0x11, 0x10, 0x0E, 0x01, 0x11, 0x0E, 0x00], + // "T": [0x1F, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00], + // "U": [0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0E, 0x00], + // "V": [0x11, 0x11, 0x11, 0x11, 0x11, 0x0A, 0x04, 0x00], + // "W": [0x11, 0x11, 0x11, 0x15, 0x15, 0x1B, 0x11, 0x00], + // "X": [0x11, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x11, 0x00], + // "Y": [0x11, 0x11, 0x11, 0x0A, 0x04, 0x04, 0x04, 0x00], + // "Z": [0x1F, 0x01, 0x02, 0x04, 0x08, 0x10, 0x1F, 0x00], + + //lowercase letters + "a": [0x00, 0x00, 0x0E, 0x01, 0x0F, 0x11, 0x0F, 0x00], + "b": [0x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1E, 0x00], + "c": [0x00, 0x00, 0x0E, 0x11, 0x10, 0x11, 0x0E, 0x00], + "d": [0x01, 0x01, 0x0D, 0x13, 0x11, 0x11, 0x0F, 0x00], + "e": [0x00, 0x00, 0x0E, 0x11, 0x1F, 0x10, 0x0E, 0x00], + "f": [0x02, 0x05, 0x04, 0x0E, 0x04, 0x04, 0x04, 0x00], + "g": [0x00, 0x0D, 0x13, 0x13, 0x0D, 0x01, 0x0E, 0x00], + "h": [0x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x11, 0x00], + "i": [0x04, 0x00, 0x0C, 0x04, 0x04, 0x04, 0x0E, 0x00], + "j": [0x02, 0x00, 0x06, 0x02, 0x02, 0x12, 0x0C, 0x00], + "k": [0x08, 0x08, 0x09, 0x0A, 0x0C, 0x0A, 0x09, 0x00], + "l": [0x0C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0E, 0x00], + "m": [0x00, 0x00, 0x1A, 0x15, 0x15, 0x15, 0x15, 0x00], + "n": [0x00, 0x00, 0x16, 0x19, 0x11, 0x11, 0x11, 0x00], + "o": [0x00, 0x00, 0x0E, 0x11, 0x11, 0x11, 0x0E, 0x00], + "p": [0x00, 0x16, 0x19, 0x19, 0x16, 0x10, 0x10, 0x00], + "q": [0x00, 0x0D, 0x13, 0x13, 0x0D, 0x01, 0x01, 0x00], + "r": [0x00, 0x00, 0x16, 0x19, 0x10, 0x10, 0x10, 0x00], + "s": [0x00, 0x00, 0x0F, 0x10, 0x1E, 0x01, 0x1F, 0x00], + "t": [0x08, 0x08, 0x1C, 0x08, 0x08, 0x09, 0x06, 0x00], + "u": [0x00, 0x00, 0x12, 0x12, 0x12, 0x12, 0x0D, 0x00], + "v": [0x00, 0x00, 0x11, 0x11, 0x11, 0x0A, 0x04, 0x00], + "w": [0x00, 0x00, 0x11, 0x11, 0x15, 0x15, 0x0A, 0x00], + "x": [0x00, 0x00, 0x11, 0x0A, 0x04, 0x0A, 0x11, 0x00], + "y": [0x00, 0x00, 0x11, 0x11, 0x13, 0x0D, 0x01, 0x0E], + "z": [0x00, 0x00, 0x1F, 0x02, 0x04, 0x08, 0x1F, 0x00], + + //misc. + euro: [0x0e, 0x10, 0x7c, 0x20, 0x7c, 0x20, 0x10, 0x0e], + cent: [0x00, 0x3c, 0x42, 0x40, 0x40, 0x52, 0x3c, 0x20], + + //emojis + objects + angryface: [0x00, 0x66, 0x66, 0x00, 0x18, 0x24, 0x42, 0x81], + circle: [0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c], + cdot: [0x3c, 0x42, 0x81, 0x99, 0x99, 0x81, 0x42, 0x3c], + donut: [0x3c, 0x7e, 0xff, 0xe7, 0xe7, 0xff, 0x7e, 0x3c], + equality: [0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00], + ball: [0x3c, 0x7e, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x3c], + thinsquare: [0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xff], + thicksquare: [0xff, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xff], + centeredsquare1: [0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00], + centeredsquare2: [0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00], + arrowright: [0x00, 0x04, 0x06, 0xff, 0xff, 0x06, 0x04, 0x00], + arrowleft: [0x00, 0x20, 0x60, 0xff, 0xff, 0x60, 0x20, 0x00], + note: [0x04, 0x06, 0x07, 0x04, 0x3c, 0x7c, 0x7c, 0x38], + clock: [0x3c, 0x52, 0x91, 0x91, 0x8f, 0x81, 0x42, 0x3c], + heartoutline: [0x66, 0x99, 0x81, 0x81, 0x42, 0x24, 0x18, 0x00], + heartfull: [0x66, 0xff, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x00], + thincheck: [0x00, 0x00, 0x01, 0x02, 0x04, 0x88, 0x50, 0x20], + thickcheck: [0x00, 0x01, 0x03, 0x06, 0x8c, 0xd8, 0x70, 0x20], + speaker: [0x03, 0x07, 0x3f, 0x3f, 0x3f, 0x3f, 0x07, 0x03], + sound: [0x00, 0x40, 0x80, 0x00, 0xc0, 0x00, 0x80, 0x40], + xbig: [0xc3, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0xc3], + target: [0x3c, 0x7e, 0xc3, 0xdb, 0xdb, 0xc3, 0x7e, 0x3c], + bell: [0x18, 0x3c, 0x3c, 0x3c, 0x3c, 0x7e, 0x00, 0x18], + smile: [0x00, 0x66, 0x66, 0x00, 0x00, 0x81, 0x42, 0x3c], + frown: [0x00, 0x66, 0x66, 0x00, 0x00, 0x3c, 0x42, 0x81], + winkright: [0x00, 0x60, 0x66, 0x00, 0x00, 0x81, 0x42, 0x3c], + winkleft: [0x00, 0x06, 0x66, 0x00, 0x00, 0x81, 0x42, 0x3c], + blink: [0x00, 0x00, 0x66, 0x00, 0x00, 0x81, 0x42, 0x3c], + laughing: [0x00, 0x66, 0x66, 0x00, 0xff, 0x81, 0x42, 0x3c], + tongueout: [0x00, 0x66, 0x66, 0x00, 0x00, 0x7e, 0x0a, 0x04], + expressionless: [0x00, 0x66, 0x66, 0x00, 0x00, 0xff, 0x00, 0x00], + + //patterns + ascprogress1: [0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80], + ascprogress2: [0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0], + ascprogress3: [0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0], + ascprogress4: [0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0], + ascprogress5: [0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8], + ascprogress6: [0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc], + ascprogress7: [0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe], + fullprogress: [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], + descprogress1: [0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f], + descprogress2: [0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f], + descprogress3: [0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f], + descprogress4: [0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f], + descprogress5: [0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07], + descprogress6: [0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03], + descprogress7: [0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01], + ascchart1: [0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + ascchart2: [0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + ascchart3: [0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00], + ascchart4: [0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00], + ascchart5: [0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00], + ascchart6: [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00], + ascchart7: [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00], + ascchart8: [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], + descchart1: [0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], + descchart2: [0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], + descchart3: [0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff], + descchart4: [0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff], + descchart5: [0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff], + descchart6: [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff], + descchart7: [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff], + descchart8: [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + borderleft1: [0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01], + borderleft2: [0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03], + borderleft3: [0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07], + borderleft4: [0x0f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0f], + borderleft5: [0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1f], + borderleft6: [0x3f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3f], + borderleft7: [0x7f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7f], + borderleft8: [0xff, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xff], + bordertopbottom5: [0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff], + borderright1: [0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80], + borderright2: [0xc0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0], + borderright3: [0xe0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xe0], + borderright4: [0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf0], + borderright5: [0xf8, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xf8], + borderright6: [0xfc, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0xfc], + borderright7: [0xfe, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0xfe], + borderright8: [0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff], + box1: [0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00], + box2: [0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00], + box3: [0xe7, 0xe7, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00], + box4: [0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07], + box5: [0x07, 0x07, 0x07, 0x00, 0x00, 0x07, 0x07, 0x07], + box6: [0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x07, 0x07, 0x07], + box7: [0xe7, 0xe7, 0xe7, 0x00, 0x00, 0x07, 0x07, 0x07], + box8: [0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0xe0], + box9: [0x07, 0x07, 0x07, 0x00, 0x00, 0xe0, 0xe0, 0xe0], + box10: [0xe0, 0xe0, 0xe0, 0x00, 0x00, 0xe0, 0xe0, 0xe0], + box11: [0xe7, 0xe7, 0xe7, 0x00, 0x00, 0xe0, 0xe0, 0xe0], + box12: [0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xe7, 0xe7], + box13: [0x07, 0x07, 0x07, 0x00, 0x00, 0xe7, 0xe7, 0xe7], + box14: [0xe0, 0xe0, 0xe0, 0x00, 0x00, 0xe7, 0xe7, 0xe7], + box15: [0xe7, 0xe7, 0xe7, 0x00, 0x00, 0xe7, 0xe7, 0xe7], + checkerboard1: [0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55], + checkerboard2: [0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa], + checkerboard3: [0x5d, 0xea, 0x57, 0xba, 0x55, 0xee, 0x55, 0xbb], + checkerboard4: [0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33, 0xcc], + checkerboard5: [0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33], + checkerboard6: [0x33, 0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc, 0x33], + checkerboard7: [0x33, 0x33, 0xcc, 0xcc, 0x33, 0x33, 0xcc, 0xcc], + pointerright: [0x20, 0x30, 0x38, 0x3c, 0x3c, 0x38, 0x30, 0x20], + pointerup: [0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0x00, 0x00], + pointerleft: [0x04, 0x0c, 0x1c, 0x3c, 0x3c, 0x1c, 0x0c, 0x04], + pointerdown: [0x00, 0x00, 0xff, 0x7e, 0x3c, 0x18, 0x00, 0x00], + arrowne: [0x00, 0x3e, 0x06, 0x0a, 0x12, 0x22, 0x40, 0x80], + arrownw: [0x00, 0x7c, 0x60, 0x50, 0x48, 0x44, 0x02, 0x01], + arrowsw: [0x01, 0x02, 0x44, 0x48, 0x50, 0x60, 0x7c, 0x00], + arrowse: [0x80, 0x40, 0x22, 0x12, 0x0a, 0x06, 0x3e, 0x00], + dice1: [0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00], + dice2: [0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03], + dice3: [0xc0, 0xc0, 0x00, 0x18, 0x18, 0x00, 0x03, 0x03], + dice4: [0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3], + dice5: [0xc3, 0xc3, 0x00, 0x18, 0x18, 0x00, 0xc3, 0xc3], + dice6: [0xc3, 0xc3, 0x00, 0xc3, 0xc3, 0x00, 0xc3, 0xc3], + outlinedplus1: [0x3c, 0x24, 0xe7, 0x81, 0x81, 0xe7, 0x24, 0x3c], + outlinedplus2: [0xff, 0xe7, 0xe7, 0x81, 0x81, 0xe7, 0xe7, 0xff], + twoboxes1: [0xf0, 0x90, 0x90, 0xf0, 0x0f, 0x09, 0x09, 0x0f], + twoboxes2: [0xf0, 0x90, 0x90, 0xfe, 0x12, 0x12, 0x1e, 0x00], + twoboxes3: [0xf0, 0x90, 0xbc, 0xf4, 0x24, 0x3c, 0x00, 0x00], + twoboxes4: [0xf0, 0xf8, 0xd8, 0xf8, 0x78, 0x00, 0x00, 0x00], + twoboxes5: [0x0f, 0x09, 0x09, 0x0f, 0xf0, 0x90, 0x90, 0xf0], + fourboxes: [0xff, 0x99, 0x99, 0xff, 0xff, 0x99, 0x99, 0xff], + chain1: [0xf0, 0xf8, 0xd8, 0xf8, 0x78, 0x00, 0x00, 0x00], + chain2: [0xf0, 0x90, 0xbc, 0xf4, 0x2f, 0x3d, 0x09, 0x0f], + }, + + SPECIAL_CHARS: { + //thicker numbers + "0": [0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c], + "1": [0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18], + "2": [0x3c, 0x66, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x7e], + "3": [0x3c, 0x66, 0x06, 0x1c, 0x06, 0x06, 0x66, 0x3c], + "4": [0x0e, 0x1e, 0x36, 0x66, 0x66, 0x7e, 0x06, 0x06], + "5": [0x7e, 0x60, 0x60, 0x7c, 0x06, 0x06, 0x66, 0x3c], + "6": [0x3c, 0x66, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x3c], + "7": [0x7e, 0x7e, 0x06, 0x0c, 0x18, 0x18, 0x18, 0x18], + "8": [0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x66, 0x3c], + "9": [0x3c, 0x66, 0x66, 0x3e, 0x06, 0x06, 0x66, 0x3c], + + //Jory's double digits + "10": [0x5e, 0x52, 0x52, 0x52, 0x52, 0x5e, 0x00, 0xff], + "11": [0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00, 0xff], + "12": [0x5e, 0x42, 0x44, 0x48, 0x50, 0x5e, 0x00, 0xff], + "13": [0x5e, 0x42, 0x4e, 0x42, 0x42, 0x5e, 0x00, 0xff], + "14": [0x52, 0x52, 0x5e, 0x42, 0x42, 0x42, 0x00, 0xff], + "15": [0x5e, 0x50, 0x5e, 0x42, 0x42, 0x5e, 0x00, 0xff], + "16": [0x5e, 0x50, 0x5e, 0x52, 0x52, 0x5e, 0x00, 0xff], + "17": [0x5e, 0x42, 0x44, 0x48, 0x48, 0x48, 0x00, 0xff], + "18": [0x5e, 0x52, 0x5e, 0x52, 0x52, 0x5e, 0x00, 0xff], + "19": [0x5e, 0x52, 0x5e, 0x42, 0x42, 0x5e, 0x00, 0xff], + }, + + DIGIT_CHARS: { + "0": 0x7E, + "1": 0x30, + "2": 0x6D, + "3": 0x79, + "4": 0x33, + "5": 0x5B, + "6": 0x5F, + "7": 0x70, + "8": 0x7F, + "9": 0x7B, + " ": 0x00, + ".": 0x80, + ":": 0xFF, + "!": 0xB0, + "A": 0x77, + "a": 0x7D, + "B": 0x7F, + "b": 0x1F, + "C": 0x4E, + "c": 0x0D, + "D": 0x7E, + "d": 0x3D, + "E": 0x4F, + "e": 0x6f, + "F": 0x47, + "f": 0x47, + "G": 0x5E, + "g": 0x7B, + "H": 0x37, + "h": 0x17, + "I": 0x30, + "i": 0x10, + "J": 0x3C, + "j": 0x38, + "K": 0x37, + "k": 0x17, + "L": 0x0E, + "l": 0x06, + "M": 0x55, + "m": 0x55, + "N": 0x15, + "n": 0x15, + "O": 0x7E, + "o": 0x1D, + "P": 0x67, + "p": 0x67, + "Q": 0x73, + "q": 0x73, + "R": 0x77, + "r": 0x05, + "S": 0x5B, + "s": 0x5B, + "T": 0x46, + "t": 0x0F, + "U": 0x3E, + "u": 0x1C, + "V": 0x27, + "v": 0x23, + "W": 0x3F, + "w": 0x2B, + "X": 0x25, + "x": 0x25, + "Y": 0x3B, + "y": 0x33, + "Z": 0x6D, + "z": 0x6D, + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/led.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/led.js new file mode 100644 index 00000000..f3f92f4d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/led.js @@ -0,0 +1,517 @@ +var Board = require("../board"); +var Animation = require("../animation"); +var Expander = require("../expander"); +var Fn = require("../fn"); +var Pins = Board.Pins; + +var priv = new Map(); + +var Controllers = { + PCA9685: { + initialize: { + value: function(opts) { + + var state = priv.get(this); + + this.address = opts.address || 0x40; + this.pwmRange = opts.pwmRange || [0, 4095]; + this.frequency = opts.frequency || 200; + + state.expander = Expander.get({ + address: this.address, + controller: this.controller, + bus: this.bus, + pwmRange: this.pwmRange, + frequency: this.frequency, + }); + + this.pin = state.expander.normalize(opts.pin); + + state.mode = this.io.MODES.PWM; + } + }, + update: { + writable: true, + value: function(input) { + var state = priv.get(this); + var output = typeof input !== "undefined" ? input : state.value; + var value = state.isAnode ? 255 - Board.constrain(output, 0, 255) : output; + this.write(value); + } + }, + write: { + writable: true, + value: function(value) { + var state = priv.get(this); + state.expander.analogWrite(this.pin, value); + } + } + }, + DEFAULT: { + initialize: { + value: function(opts, pinValue) { + + var state = priv.get(this); + var isFirmata = Pins.isFirmata(this); + var defaultLed; + + if (isFirmata && typeof pinValue === "string" && pinValue[0] === "A") { + pinValue = this.io.analogPins[+pinValue.slice(1)]; + } + + defaultLed = this.io.defaultLed || 13; + pinValue = +pinValue; + + if (isFirmata && this.io.analogPins.includes(pinValue)) { + this.pin = pinValue; + state.mode = this.io.MODES.OUTPUT; + } else { + this.pin = typeof opts.pin === "undefined" ? defaultLed : opts.pin; + state.mode = this.io.MODES[ + (this.board.pins.isPwm(this.pin) ? "PWM" : "OUTPUT") + ]; + } + + this.io.pinMode(this.pin, state.mode); + } + }, + update: { + writable: true, + value: function(input) { + var state = priv.get(this); + var output = typeof input !== "undefined" ? input : state.value; + var value = state.isAnode ? 255 - Board.constrain(output, 0, 255) : output; + value = Fn.map(value, 0, 255, 0, this.board.RESOLUTION.PWM); + + // If pin is not a PWM pin and brightness is not HIGH or LOW, emit an error + if (value !== this.io.LOW && value !== this.io.HIGH && this.mode !== this.io.MODES.PWM) { + Board.Pins.Error({ + pin: this.pin, + type: "PWM", + via: "Led" + }); + } + + if (state.mode === this.io.MODES.OUTPUT) { + value = output; + } + + this.write(value); + } + }, + write: { + writable: true, + value: function(value) { + var state = priv.get(this); + + if (state.mode === this.io.MODES.OUTPUT) { + this.io.digitalWrite(this.pin, value); + } + + if (state.mode === this.io.MODES.PWM) { + this.io.analogWrite(this.pin, value); + } + } + } + } +}; + +/** + * Led + * @constructor + * + * five.Led(pin); + * + * five.Led({ + * pin: number + * }); + * + * + * @param {Object} opts [description] + * + */ + +function Led(opts) { + if (!(this instanceof Led)) { + return new Led(opts); + } + + var pinValue = typeof opts === "object" ? opts.pin : opts; + var controller = null; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.DEFAULT; + } + + Object.defineProperties(this, controller); + + var state = { + isAnode: opts.isAnode, + isOn: false, + isRunning: false, + value: null, + direction: 1, + mode: null, + intensity: 0, + interval: null + }; + + priv.set(this, state); + + Object.defineProperties(this, { + value: { + get: function() { + return state.value; + } + }, + mode: { + get: function() { + return state.mode; + } + }, + isOn: { + get: function() { + return !!state.value; + } + }, + isRunning: { + get: function() { + return state.isRunning; + } + }, + animation: { + get: function() { + return state.animation; + } + } + }); + + /* istanbul ignore else */ + if (typeof this.initialize === "function") { + this.initialize(opts, pinValue); + } +} + +/** + * on Turn the led on + * @return {Led} + */ +Led.prototype.on = function() { + var state = priv.get(this); + + if (state.mode === this.io.MODES.OUTPUT) { + state.value = this.io.HIGH; + } + + if (state.mode === this.io.MODES.PWM) { + // Assume we need to simply turn this all the way on, when: + + // ...state.value is null + if (state.value === null) { + state.value = 255; + } + + // ...there is no active interval + if (!state.interval) { + state.value = 255; + } + + // ...the last value was 0 + if (state.value === 0) { + state.value = 255; + } + } + + this.update(); + + return this; +}; + +/** + * off Turn the led off + * @return {Led} + */ +Led.prototype.off = function() { + var state = priv.get(this); + + state.value = 0; + + this.update(); + + return this; +}; + +/** + * toggle Toggle the on/off state of an led + * @return {Led} + */ +Led.prototype.toggle = function() { + return this[this.isOn ? "off" : "on"](); +}; + +/** + * brightness + * @param {Number} value analog brightness value 0-255 + * @return {Led} + */ +Led.prototype.brightness = function(brightness) { + var state = priv.get(this); + state.value = brightness; + + this.update(); + + return this; +}; + +/** + * intensity + * @param {Number} value Light intensity 0-100 + * @return {Led} + */ +Led.prototype.intensity = function(intensity) { + var state = priv.get(this); + + if (arguments.length === 0) { + return state.intensity; + } + + state.intensity = Fn.constrain(intensity, 0, 100); + + return this.brightness(Fn.scale(state.intensity, 0, 100, 0, 255)); +}; + +/** + * Animation.normalize + * + * @param [number || object] keyFrames An array of step values or a keyFrame objects + */ + +Led.prototype[Animation.normalize] = function(keyFrames) { + var state = priv.get(this); + + // If user passes null as the first element in keyFrames use current value + /* istanbul ignore else */ + if (keyFrames[0] === null) { + keyFrames[0] = { + value: state.value || 0 + }; + } + + return keyFrames.map(function(frame) { + var value = frame; + /* istanbul ignore else */ + if (frame !== null) { + // frames that are just numbers represent values + if (typeof frame === "number") { + frame = { + value: value, + }; + } else { + if (typeof frame.brightness === "number") { + frame.value = frame.brightness; + delete frame.brightness; + } + if (typeof frame.intensity === "number") { + frame.value = Fn.scale(frame.intensity, 0, 100, 0, 255); + delete frame.intensity; + } + } + + /* istanbul ignore else */ + if (!frame.easing) { + frame.easing = "linear"; + } + } + return frame; + }); +}; + +/** + * Animation.render + * + * @position [number] value to set the led to + */ + +Led.prototype[Animation.render] = function(position) { + var state = priv.get(this); + state.value = position[0]; + return this.update(); +}; + +/** + * pulse Fade the Led in and out in a loop with specified time + * @param {number} duration Time in ms that a fade in/out will elapse + * @return {Led} + * + * - or - + * + * @param {Object} val An Animation() segment config object + */ + +Led.prototype.pulse = function(duration, callback) { + var state = priv.get(this); + + this.stop(); + + var options = { + duration: typeof duration === "number" ? duration : 1000, + keyFrames: [0, 0xff], + metronomic: true, + loop: true, + easing: "inOutSine", + onloop: function() { + /* istanbul ignore else */ + if (typeof callback === "function") { + callback(); + } + } + }; + + if (typeof duration === "object") { + Object.assign(options, duration); + } + + if (typeof duration === "function") { + callback = duration; + } + + state.isRunning = true; + + state.animation = state.animation || new Animation(this); + state.animation.enqueue(options); + return this; +}; + +/** + * fade Fade an led in and out + * @param {Number} val Analog brightness value 0-255 + * @param {Number} duration Time in ms that a fade in/out will elapse + * @return {Led} + * + * - or - + * + * @param {Object} val An Animation() segment config object + */ + +Led.prototype.fade = function(val, duration, callback) { + + var state = priv.get(this); + + this.stop(); + + var options = { + duration: typeof duration === "number" ? duration : 1000, + keyFrames: [null, typeof val === "number" ? val : 0xff], + easing: "outSine", + oncomplete: function() { + state.isRunning = false; + /* istanbul ignore else */ + if (typeof callback === "function") { + callback(); + } + } + }; + + if (typeof val === "object") { + Object.assign(options, val); + } + + if (typeof val === "function") { + callback = val; + } + + if (typeof duration === "object") { + Object.assign(options, duration); + } + + if (typeof duration === "function") { + callback = duration; + } + + state.isRunning = true; + + state.animation = state.animation || new Animation(this); + state.animation.enqueue(options); + + return this; +}; + +Led.prototype.fadeIn = function(duration, callback) { + return this.fade(255, duration || 1000, callback); +}; + +Led.prototype.fadeOut = function(duration, callback) { + return this.fade(0, duration || 1000, callback); +}; + +/** + * blink + * @param {Number} duration Time in ms on, time in ms off + * @return {Led} + */ +Led.prototype.blink = function(duration, callback) { + var state = priv.get(this); + + // Avoid traffic jams + this.stop(); + + if (typeof duration === "function") { + callback = duration; + duration = null; + } + + state.isRunning = true; + + state.interval = setInterval(function() { + this.toggle(); + if (typeof callback === "function") { + callback(); + } + }.bind(this), duration || 100); + + return this; +}; + +Led.prototype.strobe = Led.prototype.blink; + +/** + * stop Stop the led from strobing, pulsing or fading + * @return {Led} + */ +Led.prototype.stop = function() { + var state = priv.get(this); + + if (state.interval) { + clearInterval(state.interval); + } + + if (state.animation) { + state.animation.stop(); + } + + state.interval = null; + state.isRunning = false; + + return this; +}; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Led.Controllers = Controllers; + Led.purge = function() { + priv.clear(); + }; +} + + +module.exports = Led; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/ledcontrol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/ledcontrol.js new file mode 100644 index 00000000..ef5c61f4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/ledcontrol.js @@ -0,0 +1,1117 @@ +/* + About the original version of ledcontrol.js: + + This was originally a port by Rebecca Murphey of the LedControl library + and also includes a port of the AdaFruit LEDBackpack library + (MIT License, Copyright (c) 2012 Adafruit Industries) + + The license of the original LedControl library is as follows: + + LedControl.cpp - A library for controling Leds with a MAX7219/MAX7221 + Copyright (c) 2007 Eberhard Fahle + + 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: + + This permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + */ +var util = require("util"); +var Board = require("../board"); +var ledCharacters = require("./led-chars"); + +// Led instance private data +var priv = new Map(), + Controllers; + +/** + * Create an LED control. + * @mixes Board.Component + * @param {Object} opts An options hash. + * @param {String} [opts.controller] The controller to use. Either default ("MAX 7219") or "HT16K33". + * @param {Boolean} [opts.colon] Whether the device has a built in colon. + * @param {Number} [opts.devices] The number of connected LED devices. + * @param {Array} [opts.addresses] I2C addresses. + * @param {*} opts.pins The digital pin numbers that connect to + * data, clock, and cs connections on the controller device. + * Only for use with the default controller. + * Accepts either an object ({data, clock, cs}) + * or an array ([data, clock, cs]). + * @param {*} [opts.dims] Dimensions of the LED screen. + * Only for use with the HT16K33 controller. + * @param {Boolean} [opts.isBicolor] Whether the LED screen is bicolor. + * Only for use with the HT16K33 controller. + */ +function LedControl(opts) { + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + /* + device instance uses an interface from Controllers: + either MAX 7219 (default) or HT16K33 + */ + var controller = null; + + if (typeof opts.controller === "string") { + controller = Controllers[opts.controller]; + } else { + controller = opts.controller; + } + + if (typeof controller === "undefined") { + controller = Controllers.DEFAULT; + } + + // functions from Controller interface + + this.clear = controller.clear; + this.led = controller.led; + this.row = controller.row; + this.scanLimit = controller.scanLimit; + this.send = controller.send; + this.sendDigit = controller.sendDigit; + this.initialize = controller.initialize; + + // controller specific op codes + this.OP = controller.OP; + + // digit indexes may be ordered left to right (1) or reversed (-1) + this.digitOrder = 1; + + // Does the device have a built-in colon? + /* istanbul ignore else */ + if (!this.isMatrix) { + this.colon = opts.colon || false; + } + + // extra functions for HT16K33 devices only + if (controller.writeDisplay) { + this.writeDisplay = controller.writeDisplay; + } + if (controller.blink) { + this.blink = controller.blink; + } + /* + devices variable indicates number of connected LED devices + Here's an example of multiple devices: + http://tronixstuff.com/2013/10/11/tutorial-arduino-max7219-led-display-driver-ic/ + */ + var devices = opts.devices || (opts.addresses ? opts.addresses.length : 1); + + this.memory = Array(64).fill(0); + + opts.dims = opts.dims || LedControl.MATRIX_DIMENSIONS["8x8"]; + if (typeof opts.dims === "string") { + opts.dims = LedControl.MATRIX_DIMENSIONS[opts.dims]; + } + if (Array.isArray(opts.dims)) { + opts.dims = { + rows: opts.dims[0], + columns: opts.dims[1], + }; + } + var state = { + devices: devices, + digits: opts.digits || 8, + isMatrix: !!opts.isMatrix, + isBicolor: !!opts.isBicolor, + rows: opts.dims.rows, + columns: opts.dims.columns + }; + + if (!(state.columns === 8 || state.columns === 16) || !(state.rows === 8 || state.rows === 16) || (state.columns + state.rows === 32)) { + throw new Error("Invalid matrix dimensions specified: must be 8x8, 16x8 or 8x16"); + } + + Object.defineProperties(this, { + devices: { + get: function() { + return state.devices; + } + }, + digits: { + get: function() { + return state.digits; + } + }, + isMatrix: { + get: function() { + return state.isMatrix; + } + }, + isBicolor: { + get: function() { + return state.isBicolor; + } + }, + rows: { + get: function() { + return state.rows; + } + }, + columns: { + get: function() { + return state.columns; + } + } + }); + + priv.set(this, state); + controller.initialize.call(this, opts); +} + +/** + * Iterate over the index of each connected device and invoke a callback function + * for each. + * @param {Function} callbackfn The function to callback for each device index. + */ +LedControl.prototype.each = function(callbackfn) { + for (var i = 0; i < this.devices; i++) { + callbackfn.call(this, i); + } +}; + +/** + * Turn the LED device(s) on. + * @param {Number} addr The index of the device to turn on. + * If undefined, all devices are turned on. + * @return {LEDControl} Returns this to allow for chaining. + */ +LedControl.prototype.on = function(addr) { + if (typeof addr === "undefined") { + this.each(function(device) { + this.on(device); + }); + } else { + this.send(addr, this.OP.SHUTDOWN || LedControl.OP.SHUTDOWN, 1); + } + return this; +}; + +/** + * Turn the LED device(s) off. + * @param {Number} addr The index of the device to turn off. + * If undefined, all devices are turned off. + * @return {LEDControl} Returns this to allow for chaining. + */ +LedControl.prototype.off = function(addr) { + if (typeof addr === "undefined") { + this.each(function(device) { + this.off(device); + }); + } else { + this.send(addr, this.OP.SHUTDOWN || LedControl.OP.SHUTDOWN, 0); + } + return this; +}; + +/* istanbul ignore next */ +LedControl.prototype.setLed = util.deprecate(function(addr, chr, val, dp) { + /* istanbul ignore next */ + return this.led(addr, chr, val, dp); +}, "LedControl.prototype.setLed: Use `led`instead"); + +/** + * digit Display a digit and optional decimal point. + * @param {Number} addr Device address + * @param {Number} position 0-7 + * @param {String} val 0-9[.] + * @return {LedControl} + */ +LedControl.prototype.digit = function(addr, position, chr) { + var args, offset, index, character, value; + var hasDecimal = false; + + if (arguments.length < 3) { + args = Array.from(arguments); + this.each(function(device) { + this.digit.apply(this, (args.unshift(device), args)); + }); + return this; + } + + if (this.isMatrix) { + // Not sure this is the best path, will check when segment + // devices are available. + this.draw.apply(this, arguments); + return this; + } + + offset = addr * this.digits; + + character = String(chr); + position = Number(position); + + // If controller's indexes are ordered right to left, flip + // the index around. + index = position; + if (this.digitOrder === -1) { + index = this.digits - index - 1; + } + + if (character.length === 2 && character[1] === ".") { + hasDecimal = true; + character = character[0]; + } + + value = LedControl.DIGIT_CHARS[character]; + + if (!value) { + value = Math.abs(Number(character)); + } + + if (hasDecimal) { + value = value | LedControl.DIGIT_CHARS["."]; + } + + this.memory[offset + index] = value; + this.sendDigit(addr, index, value); + return this; +}; + +/** + * print Print series of characters to the display. + * @param {String} message One or more characters to be displayed. + * @param {Object} opts (Optional) Options specifying: + * - device: {Number} Device address + * @return {LedControl} + */ +LedControl.prototype.print = function(message, opts) { + var rdigchars = /([0-9A-Za-z][.]|[0-9A-Za-z:]|[\s])/g; + var characters; + + opts = opts || { + device: 0 + }; + + if (this.isMatrix) { + // figure out what to do with Matrix displays + throw new Error("Led.Matrix does not yet support the print method"); + } + + if (typeof message !== "string") { + message = String(message); + } + + characters = message.match(rdigchars); + + // When a device has a built-in colon, ie. "00:00", + // then attempt to make it less awkward to print words across + // the display by splicing in a " " placeholder, but only + // when necessary. + if (this.colon) { + if (characters.length > 2 && + (characters[2] !== ":" && characters[2] !== " ")) { + characters.splice(2, 0, " "); + } + } + + /* istanbul ignore next */ + (characters || []).forEach(function(character, position) { + this.digit(opts.device, position, character); + }, this); + return this; +}; + +/* + * brightness + * @param {Number} addr Address of Led device + * @param {Number} val Brightness value + */ +LedControl.prototype.brightness = function(addr, val) { + if (arguments.length === 1) { + val = addr; + this.each(function(device) { + this.brightness(device, val); + }); + } else { + this.send(addr, this.OP.BRIGHTNESS || LedControl.OP.BRIGHTNESS, Board.map(val, 0, 100, 0, 15)); + } + return this; +}; +/** + * column Update an entire column with an 8 or 16 bit value + * @param {Number} addr Device address + * @param {Number} col 0 indexed col number 0-7 + * @param {Number} val 8-bit 0-0xFF (for 8x8 or 16x8 matrix) or 16-bit 0-0xFFFF (for 8x16) value + * @return {LedControl} + */ +LedControl.prototype.column = function(addr, col, value) { + var state; + if (!this.isMatrix) { + throw new Error("The `column` method is only supported for Matrix devices"); + } + if (arguments.length === 2) { + value = col; + col = addr; + this.each(function(device) { + this.column(device, col, value); + }); + } else { + for (var row = 0; row < this.rows; row++) { + state = value >> ((this.rows - 1) - row); + state = state & 0x01; + this.led(addr, row, col, state); + } + } + + return this; +}; + +/** + * draw Draw a character + * @param {Number} addr Device address + * @param {Number} chr Character to draw + * + * Used as pass-through to .digit + * + * @param {Number} val 8-bit value 0-255 + * @param {Number} dp ugly + * @return {LedControl} + */ +LedControl.prototype.draw = function(addr, chr) { + // in matrix mode, this takes two arguments: + // addr and the character to display + var character; + + if (arguments.length === 1) { + chr = addr; + this.each(function(device) { + this.draw(device, chr); + }); + } else { + + if (this.isMatrix) { + if (Array.isArray(chr)) { + character = chr; + } else { + character = ledCharacters.MATRIX_CHARS[chr]; + } + + /* istanbul ignore else */ + if (character !== undefined) { + if (character.length !== this.rows && character.length !== this.columns) { + throw new Error("Invalid character: " + character); + } + // pad character to match number of rows suppported by device + var charLength = character.length; + + for (var i = 0; i < (this.rows - charLength); i++) { + /* istanbul ignore next */ + character.push(0); + } + + character.forEach(function(rowData, idx) { + this.row(addr, idx, rowData); + }, this); + } + } else { + + // in seven-segment mode, this takes four arguments, which + // are just passed through to digit + this.digit.apply(this, arguments); + } + } + + return this; +}; + +// LedControl.prototype.shift = function(addr, direction, distance) { + +// if (arguments.length === 2) { +// distance = direction; +// direction = addr; +// this.each(function() { +// this.shift(addr, direction, distance); +// }); +// } else { + +// } + +// return this; +// }; + +/* istanbul ignore next */ +LedControl.prototype.char = util.deprecate(function(addr, chr, val, dp) { + /* istanbul ignore next */ + return this.draw(addr, chr, val, dp); +}, "LedControl.prototype.setLed: Use `draw`instead"); + +LedControl.prototype.device = function(addr) { + var bound = {}; + + /* keys from prototype */ + Object.keys(LedControl.prototype).forEach(function(key) { + bound[key] = this[key].bind(this, addr); + }, this); + + /* functions from interface */ + Object.getOwnPropertyNames(this).forEach(function(key) { + if (this[key] && typeof this[key] === "function") { + bound[key] = this[key].bind(this, addr); + } + }, this); + return bound; +}; + +var addresses = new Set([0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77]); + +Controllers = { + HT16K33: { + OP: { + SHUTDOWN: 0x20, + BRIGHTNESS: 0xE0, + BLINK: 0x80 + }, + initialize: function(opts) { + var state = priv.get(this); + var available = Array.from(addresses); + + if (available.length === 0) { + throw new Error("There are no available HT16K33 controller addresses"); + } + + this.addresses = opts.addresses || (opts.address ? [opts.address] : null); + + // use default range of addresses if addresses aren't specified + if (this.addresses === null) { + this.addresses = available.slice(0, state.devices); + } + + this.addresses.forEach(function(address) { + if (!addresses.has(address)) { + throw new Error("Invalid HT16K33 controller address: " + address); + } + addresses.delete(address); + }); + + this.rotation = opts.rotation || 1; + // set a default rotation that works with AdaFruit 16x8 matrix if using 16 columns + /* istanbul ignore next */ + if (this.columns === 16 && !opts.rotation) { + this.rotation = 0; + } + this.buffer = Array(this.rows).fill([]); + + if (!this.isMatrix) { + this.colon = true; + } + + opts.addresses = this.addresses; + + // Set up I2C data connection + this.io.i2cConfig(opts); + // TODO allow setup to be configured through opts + this.each(function(device) { + this.on(device); + // Turn off blinking during initialization, in case it was left on. + this.blink(device, false); + this.brightness(device, 100); + this.clear(device); + }); + }, + + /** + * Blink the screen. + * + * @param {*} addr Either the index of the device to blink, + * or the blink value to apply to all devices. + * @param {String} val The blink value. Either 'slow' (once every 2 seconds), + * 'normal' (once every second), 'fast' (once every 500ms), + * or false to turn off blinking. + * @return {LedControl} Returns this to allow for chaining. + */ + blink: function(addr, val) { + if (arguments.length === 1) { + val = addr; + this.each(function(device) { + this.blink(device, val); + }); + } else { + var _val = null; + // Translate human-readable value to value expected by HT16K33, see datasheet. + switch (val) { + case false: + _val = 0; + break; + case "slow": + _val = 6; + break; + case "normal": + _val = 4; + break; + case "fast": + _val = 2; + break; + } + /* istanbul ignore if */ + if (_val == null) { + return; + } + // Add 1 to the opcode to turn blinking functionality on, see datasheet. + this.send(addr, this.OP.BLINK | 1, _val); + } + return this; + }, + + /* + * clear + * @param {Number} addr Address of Led device + */ + clear: function(addr) { + var offset; + if (typeof addr === "undefined") { + this.each(function(device) { + this.clear(device); + }); + } else { + offset = addr * this.columns; + + for (var i = 0; i < this.rows; i++) { + this.memory[offset + i] = 0; + this.buffer[addr][i] = 0; + } + this.writeDisplay(addr); + } + return this; + }, + /** + * led or setLed Set the memory of a single Led. + * + * @param {Number} addr Address of Led + * @param {Number} row Row number of Led (0-7) + * @param {Number} column Column number of Led (0-7) + * @param {Boolean} state [ true: on, false: off ] [ 1, 0 ] or an LedControl color code + * + */ + led: function(addr, row, col, state) { + + if (arguments.length === 3) { + state = col; + col = row; + row = addr; + this.each(function(device) { + this.led(device, row, col, state); + }); + return this; + } else { + var x = col; + var y = row; + var tmp, rows = this.rows, + columns = this.columns; + if ((y < 0) || (y >= rows)) { + return this; + } + if ((x < 0) || (x >= columns)) { + return this; + } + switch (this.rotation) { + case 1: + columns = this.rows; + rows = this.columns; + tmp = x; + x = y; + y = tmp; + x = columns - x - 1; + break; + case 2: + x = columns - x - 1; + y = rows - y - 1; + break; + case 3: + columns = this.rows; + rows = this.columns; + tmp = x; + x = y; + y = tmp; + y = rows - y - 1; + break; + } + if (!this.isBicolor) { + // x needs to be wrapped around for single color 8x8 AdaFruit matrix + /* istanbul ignore else */ + if (columns === 8 && rows === 8) { + x += columns - 1; + x %= columns; + } + if (state) { + this.buffer[addr][y] |= 1 << x; + } else { + this.buffer[addr][y] &= ~(1 << x); + } + } else { + // 8x8 bi-color matrixes only + if (state === LedControl.COLORS.GREEN) { + // Turn on green LED. + this.buffer[addr][y] |= 1 << x; + // Turn off red LED. + this.buffer[addr][y] &= ~(1 << (x + 8)); + } else if (state === LedControl.COLORS.YELLOW) { + // Turn on green and red LED. + this.buffer[addr][y] |= (1 << (x + 8)) | (1 << x); + } else if (state === LedControl.COLORS.RED) { + // Turn on red LED. + this.buffer[addr][y] |= 1 << (x + 8); + // Turn off green LED. + this.buffer[addr][y] &= ~(1 << x); + } else { + // Turn off green and red LED. + this.buffer[addr][y] &= ~(1 << x) & ~(1 << (x + 8)); + } + } + this.writeDisplay(addr); + } + return this; + }, + writeDisplay: function(addr) { + var bytes = [0x00]; + // always writes 8 rows (for 8x16, the values have already been rotated) + for (var i = 0; i < 8; i++) { + bytes.push(this.buffer[addr][i] & 0xFF); + bytes.push(this.buffer[addr][i] >> 8); + } + this.io.i2cWrite(this.addresses[addr], bytes); + }, + + /** + * row Update an entire row with an 8 bit value + * @param {Number} addr Device address + * @param {Number} row 0 indexed row number 0-7 + * @param {Number} val 8-bit value 0-255 + * @return {LedControl} + */ + row: function(addr, row, val /* 0 - 0xFFFF or string */ ) { + if (!this.isMatrix) { + throw new Error("The `row` method is only supported for Matrix devices"); + } + if (typeof val === "number") { + val = ("0000000000000000" + parseInt(val, 10).toString(2)).substr(0 - (this.columns), this.columns); + } + if (arguments.length === 2) { + val = row; + row = addr; + this.each(function(device) { + this.row(device, row, val); + }); + } else { + + // call the led function because the handling of rotation + // and wrapping for monochrome matrixes is done there + for (var i = 0; i < this.columns; i++) { + this.led(addr, row, i, parseInt(val[i], 10)); + } + } + + return this; + }, + + scanLimit: function() { + throw new Error("The `scanLimit` method is not implemented for HT16K33 devices"); + }, + + /* + * Send data to the LED controller. + * @param {Number} addr Index of the device to address. + * @param {Number} opcode Operation code. + * @param {Number} data Data. + */ + send: function(addr, opcode, data) { + if (arguments.length !== 3) { + throw new Error("The `send` method expects three arguments: device, opcode, data"); + } + this.io.i2cWrite(this.addresses[addr], [opcode | data]); + return this; + }, + + /** + * sendDigit + * @param {Number} addr Device address. + * @param {Number} index 0-7 + * @param {Number} code 8-bit value 0-255 + * @return {LedControl} + */ + sendDigit: function(addr, index, code) { + // Given: + // + // 0 === 0b00000000 + // 255 === 0b11111111 + // + // ...0 & 255 can be skipped. + // + if (code > 0 && code < 255) { + // Convert from hex to binary, padded to 8 bits. + code = ("00000000" + code.toString(2)).slice(-8).split(""); + // Reverse bits for each display segment except the decimal, + // to match the HT16K33 controller's segment ordering. + code = code.shift() + code.reverse().join(""); + code = parseInt(code, 2); + } + + // Convert to decimal and write to the display. + this.buffer[addr][index] = code; + this.writeDisplay(addr); + return this; + }, + }, + + DEFAULT: { + OP: {}, + initialize: function(opts) { + + this.pins = { + data: opts.pins.data, + clock: opts.pins.clock, + cs: opts.pins.cs || opts.pins.latch + }; + ["data", "clock", "cs"].forEach(function(pin) { + this.io.pinMode(this.pins[pin], this.io.MODES.OUTPUT); + }, this); + // NOTE: Currently unused, these will form + // the basis for the `setup` constructor option + // var setup = Object.assign({}, LedControl.DEFAULTS, opts.setup || {}); + // var keys = Object.keys(setup); + + // digit indexes ordered right to left. + this.digitOrder = -1; + this.digitOrder = -1; + + for (var device = 0; device < this.devices; device++) { + /* + TODO: Add support for custom initialization + + An example of initialization, added to the constructor options: + + setup: { + // OPCODE: VALUE + DECODING: 0, + BRIGHTNESS: 3, + SCANLIMIT: 7, + SHUTDOWN: 1, + DISPLAYTEST: 1 + }, + + + In context: + + var lc = new five.LedControl({ + pins: { + data: 2, + clock: 3, + cs: 4 + }, + setup: { + DECODING: 0, + BRIGHTNESS: 3, + SCANLIMIT: 7, + SHUTDOWN: 1, + DISPLAYTEST: 1 + }, + isMatrix: true + }); + + + The custom initializers are invoked as: + + keys.forEach(function(key) { + this.send(device, LedControl.OP[key], setup[key]); + }, this); + + + I might be missing something obvious, but this isn't working. + Using the same options shown below, the above should behave exactly the + same way that the code below does, but that's not the case. The result is + all leds in the matrix are lit and none can be cleared. + */ + if (this.isMatrix) { + this.send(device, LedControl.OP.DECODING, 0); + } + + this.send(device, LedControl.OP.BRIGHTNESS, 3); + this.send(device, LedControl.OP.SCANLIMIT, 7); + this.send(device, LedControl.OP.SHUTDOWN, 1); + this.send(device, LedControl.OP.DISPLAYTEST, 0); + + this.clear(device); + this.on(device); + } + return this; + + }, + clear: function(addr) { + var offset; + + if (typeof addr === "undefined") { + this.each(function(device) { + this.clear(device); + }); + } else { + offset = addr * 8; + + for (var i = 0; i < 8; i++) { + this.memory[offset + i] = 0; + this.send(addr, i + 1, 0); + } + } + return this; + }, + + /** + * sendDigit + * @param {Number} addr Device address. + * @param {Number} index 0-7 + * @param {Number} code 8-bit value 0-255 + * @return {LedControl} + */ + sendDigit: function(addr, index, code) { + this.send(addr, index + 1, code); + return this; + }, + + /** + * led or setLed Set the memory of a single Led. + * + * @param {Number} addr Address of Led + * @param {Number} row Row number of Led (0-7) + * @param {Number} column Column number of Led (0-7) + * @param {Boolean} state [ true: on, false: off ] [ 1, 0 ] + * + */ + led: function(addr, row, col, state) { + var offset, val; + + if (arguments.length === 3) { + state = col; + col = row; + row = addr; + this.each(function(device) { + this.led(device, row, col, state); + }); + } else { + offset = addr * this.columns; + val = 0x80 >> col; + + if (state) { + this.memory[offset + row] = this.memory[offset + row] | val; + } else { + val = ~val; + this.memory[offset + row] = this.memory[offset + row] & val; + } + this.send(addr, row + 1, this.memory[offset + row]); + } + + return this; + }, + + /** + * row Update an entire row with an 8 bit value + * @param {Number} addr Device address + * @param {Number} row 0 indexed row number 0-7 + * @param {Number} val 8-bit value 0-255 + * @return {LedControl} + */ + row: function(addr, row, val /* 0 - 255 or string */ ) { + if (!this.isMatrix) { + throw new Error("The `row` method is only supported for Matrix devices"); + } + var offset; + if (typeof val === "string") { + val = parseInt(val, 2); + } + if (arguments.length === 2) { + val = row; + row = addr; + this.each(function(device) { + this.row(device, row, val); + }); + } else { + offset = addr * this.columns; + this.memory[offset + row] = val; + this.send(addr, row + 1, this.memory[offset + row]); + } + + return this; + }, + /* + * scanLimit (function from interface) + * @param {Number} addr Address of Led device + * @param {Number} limit + */ + scanLimit: function(addr, limit) { + if (arguments.length === 1) { + limit = addr; + this.each(function(device) { + this.scanLimit(device, limit); + }); + } else { + this.send(addr, LedControl.OP.SCANLIMIT, limit); + } + return this; + }, + send: function(addr, opcode, data) { + if (arguments.length !== 3) { + throw new Error("`send` expects three arguments: device, opcode, data"); + } + var offset = addr * 2; + var maxBytes = this.devices * 2; + var spiData = []; + + if (addr < this.devices) { + for (var i = 0; i < maxBytes; i++) { + spiData[i] = 0; + } + + spiData[offset + 1] = opcode; + spiData[offset] = data; + + this.io.digitalWrite(this.pins.cs, this.io.LOW); + + for (var j = maxBytes; j > 0; j--) { + this.board.shiftOut(this.pins.data, this.pins.clock, spiData[j - 1]); + } + + this.io.digitalWrite(this.pins.cs, this.io.HIGH); + } + + return this; + } + } +}; + +// NOTE: Currently unused, these will form +// the basis for the `setup` constructor option +LedControl.DEFAULTS = { + DECODING: 0x00, + BRIGHTNESS: 0x03, + SCANLIMIT: 0x07, + SHUTDOWN: 0x01, + DISPLAYTEST: 0x00 +}; + +Object.freeze(LedControl.DEFAULTS); + +LedControl.OP = {}; + +LedControl.OP.NOOP = 0x00; + +LedControl.OP.DIGIT0 = 0x01; +LedControl.OP.DIGIT1 = 0x02; +LedControl.OP.DIGIT2 = 0x03; +LedControl.OP.DIGIT3 = 0x04; +LedControl.OP.DIGIT4 = 0x05; +LedControl.OP.DIGIT5 = 0x06; +LedControl.OP.DIGIT6 = 0x07; +LedControl.OP.DIGIT7 = 0x08; + +LedControl.OP.DECODEMODE = 0x09; +LedControl.OP.INTENSITY = 0x0a; +LedControl.OP.SCANLIMIT = 0x0b; +LedControl.OP.SHUTDOWN = 0x0c; +LedControl.OP.DISPLAYTEST = 0x0f; + +// Aliases +LedControl.OP.BRIGHTNESS = LedControl.OP.INTENSITY; +LedControl.OP.DECODING = LedControl.OP.DECODEMODE; +LedControl.OP.DISPLAY = LedControl.OP.DISPLAYTEST; +LedControl.OP.POWERDOWN = LedControl.OP.SHUTDOWN; + +Object.freeze(LedControl.OP); + +LedControl.COLORS = { + RED: 1, + YELLOW: 2, + GREEN: 3 +}; + +LedControl.DIRECTIONS = { + UP: 1, + RIGHT: 2, + DOWN: 3, + LEFT: 4, + 1: "UP", + 2: "RIGHT", + 3: "DOWN", + 4: "LEFT", +}; + +Object.freeze(LedControl.DIRECTIONS); + +// Double Digit Numbers +// +// Each digit: +// +// - is drawn as far to the left as possible. +// - uses 3 bits +// +var digits = [ + [0xe0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xe0, 0x00], + [0x40, 0xc0, 0x40, 0x40, 0x40, 0x40, 0xe0, 0x00], + [0xe0, 0x20, 0x20, 0xe0, 0x80, 0x80, 0xe0, 0x00], + [0xe0, 0x20, 0x20, 0x60, 0x20, 0x20, 0xe0, 0x00], + [0x20, 0x60, 0xa0, 0xe0, 0x20, 0x20, 0x20, 0x00], + [0xe0, 0x80, 0x80, 0xe0, 0x20, 0x20, 0xe0, 0x00], + [0xe0, 0x80, 0x80, 0xe0, 0xa0, 0xa0, 0xe0, 0x00], + [0xe0, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00], + [0xe0, 0xa0, 0xa0, 0x40, 0xa0, 0xa0, 0xe0, 0x00], + [0xe0, 0xa0, 0xa0, 0xe0, 0x20, 0x20, 0xe0, 0x00], +]; + +var charName = ""; + +for (var i = 0; i < 10; i++) { + for (var k = 0; k < 10; k++) { + charName = i + "" + k; + ledCharacters.MATRIX_CHARS[charName] = []; + + for (var j = 0; j < 8; j++) { + // Left digit takes 3 bits, plus 1 to between digits = 4 bits to the right. + ledCharacters.MATRIX_CHARS[charName][j] = digits[i][j] | (digits[k][j] >>> 4); + } + } +} + +LedControl.MATRIX_DIMENSIONS = { + "16x8": { + rows: 16, + columns: 8 + }, + "8x16": { + rows: 8, + columns: 16 + }, + "8x8": { + rows: 8, + columns: 8 + } +}; + +LedControl.MATRIX_CHARS = ledCharacters.MATRIX_CHARS; +LedControl.DIGIT_CHARS = ledCharacters.DIGIT_CHARS; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + LedControl.Controllers = Controllers; + LedControl.purge = function() { + addresses = new Set([0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77]); + priv.clear(); + }; +} + +module.exports = LedControl; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/leds.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/leds.js new file mode 100644 index 00000000..d753f0fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/leds.js @@ -0,0 +1,64 @@ +var Animation = require("../animation"); +var Led = require("./led"); +var callbacks = require("./callbacks"); +var Collection = require("../mixins/collection"); +var util = require("util"); + +/** + * Leds() + * new Leds() + * + * Create an Array-like object instance of Leds + * @alias Led.Array + * @constructor + * @return {Leds} + */ +function Leds(numsOrObjects) { + if (!(this instanceof Leds)) { + return new Leds(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Led + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(Leds, Collection); + +Collection.installMethodForwarding( + Leds.prototype, Led.prototype +); + +callbacks(Leds, ["pulse", "fade", "fadeIn", "fadeOut", "blink"]); + +/** + * Animation.normalize + * + * @param [number || object] keyFrames An array of step values or a keyFrame objects + */ + +Leds.prototype[Animation.normalize] = function(keyFrameSet) { + return keyFrameSet.map(function(keyFrames, index) { + if (keyFrames !== null) { + return this[index][Animation.normalize](keyFrames); + } + return keyFrames; + }, this); +}; + +/** + * Animation.render + * + * @position [number] array of values to set the leds to + */ + +Leds.prototype[Animation.render] = function(frames) { + return this.each(function(led, i) { + led[Animation.render]([frames[i]]); + }); +}; + + +module.exports = Leds; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/matrix.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/matrix.js new file mode 100644 index 00000000..4bd4f74c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/matrix.js @@ -0,0 +1,13 @@ +var LedControl = require("./ledcontrol"); + +// stub implementation; extract functionality from ledcontrol.js +function Matrix(opts) { + opts.isMatrix = true; + return new LedControl(opts); +} + +Object.assign(Matrix, LedControl, { + CHARS: LedControl.MATRIX_CHARS +}); + +module.exports = Matrix; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/rgb.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/rgb.js new file mode 100644 index 00000000..090f2bf9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/rgb.js @@ -0,0 +1,594 @@ +var Board = require("../board"); +var Animation = require("../animation"); +var Expander = require("../expander"); +var Fn = require("../fn"); +var converter = require("color-convert"); + +var priv = new Map(); + +var Controllers = { + DEFAULT: { + initialize: { + value: function(opts) { + RGB.colors.forEach(function(color, index) { + var pin = opts.pins[index]; + + if (opts.debug && !this.board.pins.isPwm(pin)) { + Board.Pins.Error({ + pin: pin, + type: "PWM", + via: "Led.RGB" + }); + } + + this.io.pinMode(pin, this.io.MODES.PWM); + this.pins[index] = pin; + }, this); + } + }, + write: { + writable: true, + value: function(colors) { + var state = priv.get(this); + + RGB.colors.forEach(function(color, index) { + var pin = this.pins[index]; + var value = colors[color]; + + if (state.isAnode) { + value = 255 - Board.constrain(value, 0, 255); + } + value = Fn.map(value, 0, 255, 0, this.board.RESOLUTION.PWM); + + this.io.analogWrite(pin, value); + }, this); + } + } + }, + PCA9685: { + initialize: { + value: function(opts) { + + var state = priv.get(this); + + this.address = opts.address || 0x40; + this.pwmRange = opts.pwmRange || [0, 4095]; + this.frequency = opts.frequency || 200; + + state.expander = Expander.get({ + address: this.address, + controller: this.controller, + bus: this.bus, + pwmRange: this.pwmRange, + frequency: this.frequency, + }); + + RGB.colors.forEach(function(color, index) { + this.pins[index] = state.expander.normalize(opts.pins[index]); + state.expander.analogWrite(this.pins[index], 0); + }, this); + } + }, + write: { + writable: true, + value: function(colors) { + var state = priv.get(this); + + RGB.colors.forEach(function(color, index) { + var pin = this.pins[index]; + var value = colors[color]; + + if (state.isAnode) { + value = 255 - Board.constrain(value, 0, 255); + } + + state.expander.analogWrite(pin, value); + + }, this); + } + } + }, + BLINKM: { + REGISTER: { + value: { + GO_TO_RGB_COLOR_NOW: 0x6e, + STOP_SCRIPT: 0x6f + } + }, + initialize: { + value: function(opts) { + this.address = opts.address || 0x09; + + // Ensure that this is passed on to i2cConfig + opts.address = this.address; + + /* istanbul ignore else */ + if (!this.board.Drivers[this.address]) { + this.io.i2cConfig(opts); + this.board.Drivers[this.address] = { + initialized: false + }; + + // Stop the current script + this.io.i2cWrite(this.address, [this.REGISTER.STOP_SCRIPT]); + + this.board.Drivers[this.address].initialized = true; + } + } + }, + write: { + writable: true, + value: function(colors) { + this.io.i2cWrite(this.address, [this.REGISTER.GO_TO_RGB_COLOR_NOW, colors.red, colors.green, colors.blue]); + } + } + } +}; + +Controllers.ESPLORA = { + initialize: { + value: function(opts) { + opts.pins = [5, 10, 9]; + this.pins = []; + Controllers.DEFAULT.initialize.value.call(this, opts); + } + }, + write: Controllers.DEFAULT.write +}; + +/** + * RGB + * @constructor + * + * @param {Object} opts [description] + * @alias Led.RGB + */ +function RGB(opts) { + if (!(this instanceof RGB)) { + return new RGB(opts); + } + + var controller = null; + + if (Array.isArray(opts)) { + // RGB([Byte, Byte, Byte]) shorthand + // Convert to opts.pins array definition + opts = { + pins: opts + }; + // If opts.pins is an object, convert to array + } else if (typeof opts.pins === "object" && !Array.isArray(opts.pins)) { + opts.pins = [opts.pins.red, opts.pins.green, opts.pins.blue]; + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.DEFAULT; + } + + + // The default color is #ffffff, but the light will be off + var state = { + red: 255, + green: 255, + blue: 255, + intensity: 100, + isAnode: opts.isAnode || false, + interval: null + }; + + // red, green, and blue store the raw color set via .color() + // values takes state into account, such as on/off and intensity + state.values = { + red: state.red, + green: state.green, + blue: state.blue + }; + + priv.set(this, state); + + Board.Controller.call(this, controller, opts); + + Object.defineProperties(this, { + isOn: { + get: function() { + return RGB.colors.some(function(color) { + return state[color] > 0; + }); + } + }, + isRunning: { + get: function() { + return !!state.interval; + } + }, + isAnode: { + get: function() { + return state.isAnode; + } + }, + values: { + get: function() { + return Object.assign({}, state.values); + } + }, + update: { + value: function(colors) { + var state = priv.get(this); + + colors = colors || this.color(); + + state.values = RGB.ToScaledRGB(state.intensity, colors); + + this.write(state.values); + + Object.assign(state, colors); + } + } + }); + + this.initialize(opts); + this.off(); +} + +RGB.colors = ["red", "green", "blue"]; + + +RGB.ToScaledRGB = function(intensity, colors) { + var scale = intensity / 100; + + return RGB.colors.reduce(function(current, color) { + return (current[color] = Math.round(colors[color] * scale), current); + }, {}); +}; + +RGB.ToRGB = function(red, green, blue) { + var update = {}; + var flags = 0; + var input; + + if (typeof red !== "undefined") { + // 0b100 + flags |= 1 << 2; + } + + if (typeof green !== "undefined") { + // 0b010 + flags |= 1 << 1; + } + + if (typeof blue !== "undefined") { + // 0b001 + flags |= 1 << 0; + } + + if ((flags | 0x04) === 0x04) { + input = red; + + if (input == null) { + throw new Error("Invalid color (" + input + ")"); + } + + /* istanbul ignore else */ + if (Array.isArray(input)) { + // color([Byte, Byte, Byte]) + update = { + red: input[0], + green: input[1], + blue: input[2] + }; + } else if (typeof input === "object") { + // color({ + // red: Byte, + // green: Byte, + // blue: Byte + // }); + update = { + red: input.red, + green: input.green, + blue: input.blue + }; + } else if (typeof input === "string") { + + // color("#ffffff") or color("ffffff") + if (/^#?[0-9A-Fa-f]{6}$/.test(input)) { + + // remove the leading # if there is one + if (input.length === 7 && input[0] === "#") { + input = input.slice(1); + } + + update = { + red: parseInt(input.slice(0, 2), 16), + green: parseInt(input.slice(2, 4), 16), + blue: parseInt(input.slice(4, 6), 16) + }; + } else { + // color("rgba(r, g, b, a)") or color("rgb(r, g, b)") + // color("rgba(r g b a)") or color("rgb(r g b)") + if (/^rgb/.test(input)) { + var args = input.match(/^rgba?\(([^)]+)\)$/)[1].split(/[\s,]+/); + + // If the values were %... + if (isPercentString(args[0])) { + args.forEach(function(value, index) { + // Only convert the first 3 values + if (index <= 2) { + args[index] = Math.round((parseInt(value, 10) / 100) * 255); + } + }); + } + + update = { + red: parseInt(args[0], 10), + green: parseInt(args[1], 10), + blue: parseInt(args[2], 10) + }; + + // If rgba(...) + if (args.length > 3) { + if (isPercentString(args[3])) { + args[3] = parseInt(args[3], 10) / 100; + } + update = RGB.ToScaledRGB(100 * parseFloat(args[3]), update); + } + } else { + // color name + return RGB.ToRGB(converter.keyword.rgb(input.toLowerCase())); + } + } + } + } else { + // color(red, green, blue) + update = { + red: red, + green: green, + blue: blue + }; + } + + return update; +}; + +function isPercentString(input) { + return typeof input === "string" && input.endsWith("%"); +} +/** + * color + * + * @param {String} color Hexadecimal color string or CSS color name + * @param {Array} color Array of color values + * @param {Object} color object {red, green, blue} + * + * @return {RGB} + */ +RGB.prototype.color = function(red, green, blue) { + var state = priv.get(this); + var colors; + + if (arguments.length === 0) { + // Return a copy of the state values, + // not a reference to the state object itself. + colors = this.isOn ? state : state.prev; + return RGB.colors.reduce(function(current, color) { + return (current[color] = Math.round(colors[color]), current); + }, {}); + } + + var update = RGB.ToRGB(red, green, blue); + + // Validate all color values before writing any values + RGB.colors.forEach(function(color) { + var value = update[color]; + + if (value == null) { + throw new Error("Led.RGB.color: invalid color ([" + [update.red, update.green, update.blue].join(",") + "])"); + } + + value = Fn.constrain(value, 0, 255); + update[color] = value; + }, this); + + this.update(update); + + return this; +}; + +RGB.prototype.on = function() { + var state = priv.get(this); + var colors; + + // If it's not already on, we set them to the previous color + if (!this.isOn) { + /* istanbul ignore next */ + colors = state.prev || { + red: 255, + green: 255, + blue: 255 + }; + + state.prev = null; + + this.update(colors); + } + + return this; +}; + +RGB.prototype.off = function() { + var state = priv.get(this); + + // If it's already off, do nothing so the pervious state stays intact + /* istanbul ignore else */ + if (this.isOn) { + state.prev = RGB.colors.reduce(function(current, color) { + return (current[color] = state[color], current); + }.bind(this), {}); + + this.update({ + red: 0, + green: 0, + blue: 0 + }); + } + + return this; +}; + +/** + * blink + * @param {Number} duration Time in ms on, time in ms off + * @return {RGB} + */ +RGB.prototype.blink = function(duration, callback) { + var state = priv.get(this); + + // Avoid traffic jams + this.stop(); + + if (typeof duration === "function") { + callback = duration; + duration = null; + } + + state.interval = setInterval(function() { + this.toggle(); + if (typeof callback === "function") { + callback(); + } + }.bind(this), duration || 100); + + return this; +}; + +RGB.prototype.strobe = RGB.prototype.blink; + +RGB.prototype.toggle = function() { + return this[this.isOn ? "off" : "on"](); +}; + +RGB.prototype.stop = function() { + var state = priv.get(this); + + if (state.interval) { + clearInterval(state.interval); + } + + /* istanbul ignore if */ + if (state.animation) { + state.animation.stop(); + } + + state.interval = null; + + return this; +}; + +RGB.prototype.intensity = function(intensity) { + var state = priv.get(this); + + if (arguments.length === 0) { + return state.intensity; + } + + state.intensity = Fn.constrain(intensity, 0, 100); + + this.update(); + + return this; +}; + +/** + * Animation.normalize + * + * @param [number || object] keyFrames An array of step values or a keyFrame objects + */ + +RGB.prototype[Animation.normalize] = function(keyFrames) { + var state = priv.get(this); + + // If user passes null as the first element in keyFrames use current value + if (keyFrames[0] === null) { + keyFrames[0] = state.values; + } + + return keyFrames.reduce(function(accum, frame) { + var normalized = {}; + var value = frame; + var color = null; + var intensity = state.intensity; + + if (frame !== null) { + // Frames that are just numbers are not allowed + // because it is ambiguous. + if (typeof value === "number") { + throw new Error("RGB LEDs expect a complete keyFrame object or hexadecimal string value"); + } + + if (typeof value === "string") { + color = value; + } + + if (Array.isArray(value)) { + color = value; + } else { + if (typeof value === "object") { + if (typeof value.color !== "undefined") { + color = value.color; + } else { + color = value; + } + } + } + + if (typeof frame.intensity === "number") { + intensity = frame.intensity; + delete frame.intensity; + } + + normalized.easing = frame.easing || "linear"; + normalized.value = RGB.ToScaledRGB(intensity, RGB.ToRGB(color)); + } else { + normalized = frame; + } + + accum.push(normalized); + + return accum; + }, []); +}; + +/** + * Animation.render + * + * @color [object] color object + */ + +RGB.prototype[Animation.render] = function(frames) { + return this.color(frames[0]); +}; + +/** + * For multi-property animation, must define + * the keys to use for tween calculation. + */ +RGB.prototype[Animation.keys] = RGB.colors; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + RGB.Controllers = Controllers; + RGB.purge = function() { + priv.clear(); + }; +} + +module.exports = RGB; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/rgbs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/rgbs.js new file mode 100644 index 00000000..86512ba5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/led/rgbs.js @@ -0,0 +1,71 @@ +var Animation = require("../animation"); +var callbacks = require("./callbacks"); +var Collection = require("../mixins/collection"); +var RGB = require("./rgb"); +var util = require("util"); + +/** + * RGBs() + * new RGBs() + * + * Create an Array-like object instance of RGBs + * @alias Led.RGB.Collection + * @constructor + * @return {RGBs} + */ +function RGBs(numsOrObjects) { + if (!(this instanceof RGBs)) { + return new RGBs(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: RGB + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(RGBs, Collection); + +Collection.installMethodForwarding( + RGBs.prototype, RGB.prototype +); + +callbacks(RGBs, ["blink"]); + + +/** + * Animation.normalize + * + * @param [number || object] keyFrames An array of step values or a keyFrame objects + */ + +RGBs.prototype[Animation.normalize] = function(keyFrameSet) { + return keyFrameSet.map(function(keyFrames, index) { + if (keyFrames !== null) { + return this[index][Animation.normalize](keyFrames); + } + return keyFrames; + }, this); +}; + +/** + * Animation.render + * + * @position [number] array of values to set the leds to + */ + +RGBs.prototype[Animation.render] = function(frames) { + return this.each(function(rgb, i) { + rgb[Animation.render]([frames[i]]); + }); +}; + +/** + * For multi-property animation, must define + * the keys to use for tween calculation. + */ +RGBs.prototype[Animation.keys] = RGB.colors; + + +module.exports = RGBs; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/light.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/light.js new file mode 100644 index 00000000..659afcde --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/light.js @@ -0,0 +1,546 @@ +var Board = require("./board"); +var EVS = require("./evshield"); +var within = require("./mixins/within"); +var Fn = require("./fn"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var priv = new Map(); +// var int16 = Fn.int16; +var uint16 = Fn.uint16; +var toFixed = Fn.toFixed; + +var Controllers = { + DEFAULT: { + initialize: { + value: function(opts, dataHandler) { + this.io.pinMode(this.pin, this.io.MODES.ANALOG); + this.io.analogRead(this.pin, dataHandler); + }, + }, + toIntensityLevel: { + value: function(raw) { + return toFixed(Fn.scale(raw, 0, 1023, 0, 100) / 100, 2); + } + } + }, + EVS_EV3: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + if (opts.mode) { + opts.mode = opts.mode.toUpperCase(); + } + + state.mode = opts.mode === "REFLECTED" ? EVS.Type_EV3_LIGHT_REFLECTED : EVS.Type_EV3_LIGHT; + + state.shield = EVS.shieldPort(opts.pin); + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + state.ev3.setup(state.shield, EVS.Type_EV3); + state.ev3.write(state.shield, 0x81 + state.shield.offset, state.mode); + state.ev3.read(state.shield, EVS.Light, EVS.Light_Bytes, function(data) { + var value = data[0] | (data[1] << 8); + dataHandler(value); + }); + } + }, + toIntensityLevel: { + value: function(raw) { + return toFixed(raw / 100, 2); + } + } + }, + EVS_NXT: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + if (opts.mode) { + opts.mode = opts.mode.toUpperCase(); + } + + state.mode = opts.mode === "REFLECTED" ? EVS.Type_NXT_LIGHT_REFLECTED : EVS.Type_NXT_LIGHT; + + state.shield = EVS.shieldPort(opts.pin); + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + state.ev3.setup(state.shield, state.mode); + state.ev3.read(state.shield, state.shield.analog, EVS.Analog_Bytes, function(data) { + var value = data[0] | (data[1] << 8); + dataHandler(value); + }); + } + }, + toIntensityLevel: { + value: function(raw) { + return toFixed(Fn.scale(raw, 0, 1023, 100, 0) / 100, 2); + } + } + }, + + TSL2561: { + ADDRESSES: { + value: [0x29, 0x39, 0x49] + }, + REGISTER: { + value: { + CONTROL: 0x00, + TIMING: 0x01, + READ: 0x2C, + }, + }, + + initialize: { + value: function(opts, dataHandler) { + var address = opts.address || 0x39; + var command = function(byte) { + // byte | 0b10000000; + return byte | 0x80; + }; + + opts.address = address; + + this.io.i2cConfig(opts); + + // Page 15 + // Control Register (0h) + // RESV 7:2 + // POWER 1:0 + // + // Power up/power down. + // By writing a 03h to this register, the device is powered up. + // By writing a 00h to this register, the device is powered down. + // + // 0b00000011 = 0x03 + // 0b00000000 = 0x00 + this.io.i2cWriteReg(address, command(this.REGISTER.CONTROL), 0x03); + + // Gain & Integration + // var isAutoGain = false; + + // Page 24 + // Integration time scaling factors + var LUX_SCALE = 14; // scale by (2 ** 14) + var RATIO_SCALE = 9; // scale ratio by (2 ** 9) + + // Page 24 + // T, FN, and CL Package coefficients + var K1T = 0x0040; // 0.125 * (2 ** RATIO_SCALE) + var B1T = 0x01F2; // 0.0304 * (2 ** LUX_SCALE) + var M1T = 0x01BE; // 0.0272 * (2 ** LUX_SCALE) + var K2T = 0x0080; // 0.250 * (2 ** RATIO_SCALE) + var B2T = 0x0214; // 0.0325 * (2 ** LUX_SCALE) + var M2T = 0x02D1; // 0.0440 * (2 ** LUX_SCALE) + var K3T = 0x00C0; // 0.375 * (2 ** RATIO_SCALE) + var B3T = 0x023F; // 0.0351 * (2 ** LUX_SCALE) + var M3T = 0x037B; // 0.0544 * (2 ** LUX_SCALE) + var K4T = 0x0100; // 0.50 * (2 ** RATIO_SCALE) + var B4T = 0x0270; // 0.0381 * (2 ** LUX_SCALE) + var M4T = 0x03FE; // 0.0624 * (2 ** LUX_SCALE) + var K5T = 0x0138; // 0.61 * (2 ** RATIO_SCALE) + var B5T = 0x016F; // 0.0224 * (2 ** LUX_SCALE) + var M5T = 0x01FC; // 0.0310 * (2 ** LUX_SCALE) + var K6T = 0x019A; // 0.80 * (2 ** RATIO_SCALE) + var B6T = 0x00D2; // 0.0128 * (2 ** LUX_SCALE) + var M6T = 0x00FB; // 0.0153 * (2 ** LUX_SCALE) + var K7T = 0x029A; // 1.3 * (2 ** RATIO_SCALE) + var B7T = 0x0018; // 0.00146 * (2 ** LUX_SCALE) + var M7T = 0x0012; // 0.00112 * (2 ** LUX_SCALE) + var K8T = 0x029A; // 1.3 * (2 ** RATIO_SCALE) + var B8T = 0x0000; // 0.000 * (2 ** LUX_SCALE) + var M8T = 0x0000; // 0.000 * (2 ** LUX_SCALE) + + // Auto-gain thresholds + // Max value at Ti 13ms = 5047 + // var AGT_LO_13MS = 100; + // var AGT_HI_13MS = 4850; + + // // Max value at Ti 101ms = 37177 + // var AGT_LO_101MS = 200; + // var AGT_HI_101MS = 36000; + + // // Max value at Ti 402ms = 65535 + // var AGT_LO_402MS = 500; + // var AGT_HI_402MS = 63000; + + // var agtRanges = [ + // // 0, TI_13MS + // [100, 4850], + // // 1, TI_101MS + // [200, 36000], + // // 2, TI_402MS + // [500, 63000], + // ]; + + // var CLIPPING_13MS = 4900; + // var CLIPPING_101MS = 37000; + // var CLIPPING_402MS = 65000; + + // var clipping = [ + // // 0, TI_13MS + // 4900, + // // 1, TI_101MS + // 37000, + // // 2, TI_402MS + // 65000, + // ]; + + + var GAIN_1X = 0x00; + var GAIN_16X = 0x10; + + // var TI_13MS = 0x00; + // var TI_101MS = 0x01; + // var TI_402MS = 0x02; + + var TintMs = [ + // 0, TI_13MS + 13, + // 1, TI_101MS + 101, + // 2, TI_402MS + 402, + ]; + + var TintDelayMs = [ + // 0, TI_13MS + 15, + // 1, TI_101MS + 120, + // 2, TI_402MS + 450, + ]; + + // Page 23 - 28 + // Simplified Lux Calculation + // var CH_SCALE_D = 0x0010; + // var CH_SCALE_0 = 0x7517; + // var CH_SCALE_1 = 0x0FE7; + + var chScales = [ + // 0, TI_13MS + 0x07517, + // 1, TI_101MS + 0x00FE7, + // 2, TI_402MS + 0x10000, + ]; + + // Gain and Tint defaults; + var gain = GAIN_16X; + var TintIndex = 0; + var Tint = TintMs[TintIndex]; + var lux = 0; + + // if (typeof opts.gain !== "undefined") { + // isAutoGain = false; + // gain = opts.gain; + // } + + // if (typeof opts.integration !== "undefined") { + // isAutoGain = false; + // Tint = opts.integration; + // } + + + // TODO: reduce duplication here + Object.defineProperties(this, { + gain: { + get: function() { + return gain; + }, + set: function(value) { + if (value !== GAIN_1X && value !== GAIN_16X) { + throw new RangeError("Invalid gain. Expected one of: 0, 16"); + } + gain = value; + + this.io.i2cWriteReg(address, command(this.REGISTER.TIMING), TintIndex | gain); + } + }, + integration: { + get: function() { + return Tint; + }, + set: function(value) { + TintIndex = TintMs.indexOf(value); + + if (TintIndex === -1) { + throw new RangeError("Invalid integration. Expected one of: 13, 101, 402"); + } + + Tint = value; + + this.io.i2cWriteReg(address, command(this.REGISTER.TIMING), TintIndex | gain); + } + }, + lux: { + get: function() { + return lux; + } + } + }); + + // Assign the default gain and integration values + // These are validated and written to the device. + // These will invoke the accessors above. + this.gain = gain; + this.integration = Tint; + + // Page 1 + // Description + // Page 2 + // Functional Block Diagram + // var data = { + // broadband: null, + // infrared: null, + // }; + + var read = function() { + setTimeout(function() { + // Page 19 + // Read ADC Channels Using Read Word Protocol − RECOMMENDED + this.io.i2cReadOnce(address, command(this.REGISTER.READ), 4, function(data) { + // Page 23 - 28 + // Simplified Lux Calculation + var ch0 = uint16(data[1], data[0]); + var ch1 = uint16(data[3], data[2]); + var b = 0; + var m = 0; + + // Page 26 + // CalculateLux(...) + var chScale = chScales[TintIndex]; + + + if (!gain) { + chScale = chScale << 4; + } + + // Page 27 + // CalculateLux(...) + ch0 = (ch0 * chScale) >> 10; + ch1 = (ch1 * chScale) >> 10; + + var ratio1 = 0; + + if (ch0) { + ratio1 = (ch1 << (RATIO_SCALE + 1)) / ch0; + } + + ratio1 = Math.round(ratio1); + + var ratio = (ratio1 + 1) >> 1; + + if (ratio >= 0 && ratio <= K1T) { + b = B1T; + m = M1T; + } else if (ratio <= K2T) { + b = B2T; + m = M2T; + } else if (ratio <= K3T) { + b = B3T; + m = M3T; + } else if (ratio <= K4T) { + b = B4T; + m = M4T; + } else if (ratio <= K5T) { + b = B5T; + m = M5T; + } else if (ratio <= K6T) { + b = B6T; + m = M6T; + } else if (ratio <= K7T) { + b = B7T; + m = M7T; + } else if (ratio > K8T) { + b = B8T; + m = M8T; + } + // I followed the datasheet and it had no else clause here. + + var temp = (ch0 * b) - (ch1 * m); + + if (temp < 0) { + temp = 0; + } + + temp += 1 << (LUX_SCALE - 1); + + // Updating the `lux` binding + // in the outer scope. + lux = temp >>> LUX_SCALE; + + dataHandler(lux); + read(); + }); + }.bind(this), TintDelayMs[TintIndex]); + }.bind(this); + + read(); + } + }, + toLux: { + value: function(raw) { + return raw; + }, + }, + toIntensityLevel: { + value: function(raw) { + return toFixed(Fn.scale(raw, 0, 17000, 0, 100) / 100, 2); + }, + }, + }, + BH1750: { + // code based on Arduino library https://github.com/claws/BH1750 + // currently only "continuous H-resolution" mode supported + ADDRESSES: { + value: [0x23, 0x5C] + }, + initialize: { + value: function(opts, dataHandler) { + var address = opts.address || 0x23; + var mode = opts.mode || 0x10; + opts.address = address; + this.io.i2cConfig(opts); + this.io.i2cWrite(address, mode); + var read = function() { + setTimeout(function() { + this.io.i2cReadOnce(address, 2, function(data) { + var raw = data[0]; + raw <<= 8; + raw |= data[1]; + dataHandler(raw); + read(); + }); + }.bind(this), 120); + }.bind(this); + read(); + }, + }, + toLux: { + value: function(raw) { + // Page 2 + // H-Resolution Mode Resolution rHR - 1 - lx + return Math.round(raw / 1.2); + }, + }, + toIntensityLevel: { + value: function(raw) { + return toFixed(Fn.scale(raw / 1.2, 0, 65535, 0, 100) / 100, 2); + }, + }, + }, +}; + +Controllers.ALSPT19 = Controllers["ALS-PT19"] = Controllers.DEFAULT; + + +/** + * Light + * @constructor + * + */ + +function Light(opts) { + + if (!(this instanceof Light)) { + return new Light(opts); + } + + var controller = null; + var state = {}; + var raw = 0; + var last = 0; + var freq = opts.freq || 25; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (typeof opts.controller === "string") { + controller = Controllers[opts.controller]; + } else { + controller = opts.controller || Controllers.DEFAULT; + } + + Board.Controller.call(this, controller, opts); + + if (!this.toIntensityLevel) { + this.toIntensityLevel = opts.toIntensityLevel || function(x) { + return x; + }; + } + + if (!this.toLux) { + this.toLux = opts.toLux || function(x) { + return x; + }; + } + + Object.defineProperties(this, { + value: { + get: function() { + return raw; + }, + }, + level: { + get: function() { + return this.toIntensityLevel(raw); + }, + }, + }); + + priv.set(this, state); + + /* istanbul ignore else */ + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + if (typeof this.lux === "undefined") { + Object.defineProperty(this, "lux", { + get: function() { + return this.toLux(raw); + }, + }); + } + + var data = { + level: 0, + lux: 0, + }; + + setInterval(function() { + data.level = this.level; + data.lux = this.lux; + + this.emit("data", data); + + if (raw !== last) { + last = raw; + this.emit("change", data); + } + }.bind(this), freq); +} + +util.inherits(Light, Emitter); + +Object.assign(Light.prototype, within); + + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Light.Controllers = Controllers; + Light.purge = function() { + priv.clear(); + }; +} + +module.exports = Light; + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/mixins/collection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/mixins/collection.js new file mode 100644 index 00000000..5be6098d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/mixins/collection.js @@ -0,0 +1,267 @@ +var IS_TEST_MODE = !!process.env.IS_TEST_MODE; +var Emitter = require("events").EventEmitter; +var util = require("util"); +var priv = new Map(); + +/** + * Collection + * + * Make Collections for output classes + * + * @param {[type]} numsOrObjects + */ +function Collection(numsOrObjects) { + var Type = this.type; + var initObjects = []; + + this.length = 0; + + if (Array.isArray(numsOrObjects)) { + initObjects = numsOrObjects; + } else { + // Initialize with a Shared Properties object + /* istanbul ignore else */ + if (Array.isArray(numsOrObjects.pins)) { + var keys = Object.keys(numsOrObjects).filter(function(key) { + return key !== "pins"; + }); + initObjects = numsOrObjects.pins.map(function(pin) { + var obj = {}; + + if (Array.isArray(pin)) { + obj.pins = pin; + } else { + obj.pin = pin; + } + + return keys.reduce(function(accum, key) { + accum[key] = numsOrObjects[key]; + return accum; + }, obj); + }); + } + } + + /* istanbul ignore else */ + if (initObjects.length) { + while (initObjects.length) { + var numOrObject = initObjects.shift(); + + // When a Type exists, respect it! + if (typeof Type === "function") { + if (!(numOrObject instanceof Type || numOrObject instanceof this.constructor)) { + numOrObject = new Type(numOrObject); + } + } + + this.add(numOrObject); + } + } +} + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + Collection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; +} + +Collection.prototype.add = function() { + var length = this.length; + var aLen = arguments.length; + + for (var i = 0; i < aLen; i++) { + // When a Type exists, respect it! + if (this.type) { + if (arguments[i] instanceof this.type || + arguments[i] instanceof this.constructor) { + this[length++] = arguments[i]; + } + } else { + // Otherwise allow user to directly instantiate + // Collection or Collection.Emitter to create + // a mixed collection + this[length++] = arguments[i]; + } + } + + return (this.length = length); +}; + +Collection.prototype.each = function(callbackFn) { + var length = this.length; + + for (var i = 0; i < length; i++) { + callbackFn.call(this[i], this[i], i); + } + + return this; +}; + +Collection.prototype.forEach = function() { + [].forEach.apply(this, arguments); +}; + +Collection.prototype.includes = function() { + return [].includes.apply(this, arguments); +}; + +Collection.prototype.indexOf = function() { + return [].indexOf.apply(this, arguments); +}; + +Collection.prototype.map = function() { + return [].map.apply(this, arguments); +}; + +Collection.prototype.slice = function() { + return new this.constructor([].slice.apply(this, arguments)); +}; + +Collection.prototype.byId = function(id) { + return [].find.call(this, function(entry) { + return entry.id !== undefined && entry.id === id; + }); +}; + +/** + * Collection.installMethodForwarding + * + * Copy single method to collection class + * + * @param {Object} target Target prototype + * @param {Object} source Source prototype + * @return {Object} target Modified Target prototype + */ +Collection.installMethodForwarding = function(target, source) { + return Object.keys(source).reduce(function(accum, method) { + // Create Inputs wrappers for each method listed. + // This will allow us control over all Input instances + // simultaneously. + accum[method] = function() { + var length = this.length; + + for (var i = 0; i < length; i++) { + this[i][method].apply(this[i], arguments); + } + return this; + }; + + return accum; + }, target); +}; + + + +/** + * Collection.Emitter + * + * Make Collections for input classes + * + * @param {[type]} numsOrObjects + * + */ +Collection.Emitter = function(numsOrObjects) { + + // Create private state ahead of super call + priv.set(this, { + timing: { + last: Date.now() + } + }); + + Collection.call(this, numsOrObjects); + + // If the Collection.Emitter was created + // with a Shared Properties object, then + // we should abide by the freq or period + // properties... + var interval = null; + var period = 5; + + if (!Array.isArray(numsOrObjects) && + (typeof numsOrObjects === "object" && numsOrObjects !== null)) { + + period = numsOrObjects.freq || numsOrObjects.period || period; + + // _However_, looking to the future, we + // need to start thinking about replacing + // the garbage named _freq_ (the value is + // actually a period), with real _frequency_ + // in Hz. + + // If provided, convert frequency to period + /* istanbul ignore else */ + if (numsOrObjects.frequency) { + period = (1 / numsOrObjects.frequency) * 1000; + } + } + + Object.defineProperties(this, { + period: { + get: function() { + return period; + }, + set: function(value) { + if (period !== value) { + period = value; + } + + if (interval) { + clearInterval(interval); + } + + interval = setInterval(function() { + this.emit("data", this); + }.bind(this), period); + } + }, + }); + + this.period = period; + + this.on("newListener", function(event) { + if (event === "change" || event === "data") { + return; + } + + this.forEach(function(input) { + input.on(event, function(data) { + this.emit(event, input, data); + }.bind(this)); + }, this); + }); +}; + +util.inherits(Collection.Emitter, Collection); + +Object.assign(Collection.Emitter.prototype, Emitter.prototype); + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + Collection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; +} + +Collection.Emitter.prototype.add = function() { + var inputs = Array.from(arguments); + + /* istanbul ignore else */ + if (inputs.length) { + Collection.prototype.add.apply(this, inputs); + + inputs.forEach(function(input) { + if (input) { + input.on("change", function() { + this.emit("change", input); + }.bind(this)); + } + }, this); + } + return this.length; + // return (this.length = length); +}; + +/* istanbul ignore else */ +if (IS_TEST_MODE) { + Collection.purge = function() { + priv.clear(); + }; +} + +module.exports = Collection; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/mixins/within.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/mixins/within.js new file mode 100644 index 00000000..db564166 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/mixins/within.js @@ -0,0 +1,36 @@ +var mixins = { + + within: function(range, unit, callback) { + var upper; + + if (typeof range === "number") { + upper = range; + range = [0, upper]; + } + + if (!Array.isArray(range)) { + throw new Error("within expected a range array"); + } + + if (typeof unit === "function") { + callback = unit; + unit = "value"; + } + + if (typeof this[unit] === "undefined") { + return this; + } + + // Use the continuous read event for high resolution + this.on("data", function() { + var value = this[unit]; + if (value >= range[0] && value <= range[1]) { + callback.call(this, null, value); + } + }.bind(this)); + + return this; + } +}; + +module.exports = mixins; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/motion.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/motion.js new file mode 100644 index 00000000..9c9aae80 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/motion.js @@ -0,0 +1,258 @@ +var Collection = require("./mixins/collection"); +var Board = require("./board"); +var events = require("events"); +var util = require("util"); +var priv = new Map(); + + +function analogInitializer(opts, dataHandler) { + var state = priv.get(this); + + this.io.pinMode(opts.pin, this.io.MODES.ANALOG); + + setTimeout(function() { + state.isCalibrated = true; + this.emit("calibrated"); + }.bind(this), 10); + + this.io.analogRead(opts.pin, dataHandler); +} + +var Controllers = { + PIR: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + var calibrationDelay = typeof opts.calibrationDelay !== "undefined" ? + opts.calibrationDelay : 2000; + + this.io.pinMode(opts.pin, this.io.MODES.INPUT); + + setTimeout(function() { + state.isCalibrated = true; + this.emit("calibrated"); + }.bind(this), calibrationDelay); + + this.io.digitalRead(opts.pin, dataHandler); + } + }, + toBoolean: { + value: function(raw) { + return !!raw; + } + } + }, + GP2Y0D805Z0F: { + initialize: { + value: function(opts, dataHandler) { + var address = opts.address || 0x26; + var state = priv.get(this); + + opts.address = address; + + // This is meaningless for GP2Y0D805Z0F. + // The event is implemented for consistency + // with the digital passive infrared sensor + setTimeout(function() { + state.isCalibrated = true; + this.emit("calibrated"); + }.bind(this), 10); + + + // Set up I2C data connection + this.io.i2cConfig(opts); + + this.io.i2cWriteReg(address, 0x03, 0xFE); + this.io.i2cWrite(address, [0x00]); + this.io.i2cRead(address, 1, function(data) { + dataHandler(data[0] & 0x02); + }); + } + }, + toBoolean: { + value: function(raw) { + return raw === 0; + } + } + }, + GP2Y0D810Z0F: { + initialize: { + value: analogInitializer + }, + toBoolean: { + value: function(raw) { + return raw >> 9 === 0; + } + } + }, + GP2Y0A60SZLF: { + initialize: { + value: analogInitializer + }, + toBoolean: { + value: function(raw) { + return raw >> 9 === 1; + } + } + } +}; + +Controllers.GP2Y0D815Z0F = Controllers.GP2Y0D810Z0F; + +Controllers["HC-SR501"] = Controllers.PIR; +Controllers["HCSR501"] = Controllers.PIR; +Controllers["0D805"] = Controllers.GP2Y0D805Z0F; +Controllers["805"] = Controllers.GP2Y0D805Z0F; +Controllers["0D810"] = Controllers.GP2Y0D810Z0F; +Controllers["810"] = Controllers.GP2Y0D810Z0F; +Controllers["0D815"] = Controllers.GP2Y0D815Z0F; +Controllers["815"] = Controllers.GP2Y0D815Z0F; +Controllers["0A60SZLF"] = Controllers.GP2Y0A60SZLF; +Controllers["60SZLF"] = Controllers.GP2Y0A60SZLF; + +/** + * Motion + * @constructor + * + * five.Motion(7); + * + * five.Motion({ + * controller: "PIR", + * pin: 7, + * freq: 100, + * calibrationDelay: 1000 + * }); + * + * + * @param {Object} opts [description] + * + */ + +function Motion(opts) { + + if (!(this instanceof Motion)) { + return new Motion(opts); + } + + var freq = opts.freq || 25; + var last = false; + var controller; + var state; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (typeof opts.controller === "string") { + controller = Controllers[opts.controller]; + } else { + controller = opts.controller || Controllers["PIR"]; + } + + Board.Controller.call(this, controller, opts); + + state = { + value: false, + isCalibrated: false + }; + + priv.set(this, state); + + Object.defineProperties(this, { + /** + * [read-only] Current sensor state + * @property detectedMotion + * @type Boolean + */ + detectedMotion: { + get: function() { + return this.toBoolean(state.value); + } + }, + /** + * [read-only] Sensor calibration status + * @property isCalibrated + * @type Boolean + */ + isCalibrated: { + get: function() { + return state.isCalibrated; + } + }, + }); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + state.value = data; + }); + } + + setInterval(function() { + var isChange = false; + var eventData = { + timestamp: Date.now(), + detectedMotion: this.detectedMotion, + isCalibrated: state.isCalibrated + }; + + if (state.isCalibrated && this.detectedMotion && !last) { + this.emit("motionstart", eventData); + } + + if (state.isCalibrated && !this.detectedMotion && last) { + this.emit("motionend", eventData); + } + + if (last !== this.detectedMotion) { + isChange = true; + } + + this.emit("data", eventData); + + if (isChange) { + this.emit("change", eventData); + } + + last = this.detectedMotion; + }.bind(this), freq); +} + +util.inherits(Motion, events.EventEmitter); + + + +/** + * Motion.Collection() + * new Motion.Collection() + * + * Constructs an Array-like instance + */ + +Motion.Collection = function(numsOrObjects) { + if (!(this instanceof Motion.Collection)) { + return new Motion.Collection(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Motion + }); + + Collection.Emitter.call(this, numsOrObjects); +}; + +util.inherits(Motion.Collection, Collection.Emitter); + +Collection.installMethodForwarding( + Motion.Collection.prototype, Motion.prototype +); + + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Motion.Controllers = Controllers; + Motion.purge = function() { + priv.clear(); + }; +} + +module.exports = Motion; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/motor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/motor.js new file mode 100644 index 00000000..e3715956 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/motor.js @@ -0,0 +1,1222 @@ +var Board = require("./board"); +var Expander = require("./expander.js"); +var EVS = require("./evshield"); +var __ = require("./fn"); +var events = require("events"); +var util = require("util"); +var Collection = require("./mixins/collection"); +var Sensor = require("./sensor"); +var ShiftRegister = require("./shiftregister"); + +var priv = new Map(); +var registers = new Map(); + +function registerKey(registerOpts) { + return ["clock", "data", "latch"].reduce(function(accum, key) { + return accum + "." + registerOpts[key]; + }, ""); +} + +function latch(state, bit, on) { + return on ? state |= (1 << bit) : state &= ~(1 << bit); +} + +function updateShiftRegister(motor, dir) { + var rKey = registerKey(motor.opts.register), + register = registers.get(motor.board)[rKey], + latchState = register.value, + bits = priv.get(motor).bits, + forward = dir !== "reverse"; + + // There are two ShiftRegister bits which we need to change based on the + // direction of the motor. These will be the pins that control the HBridge + // on the board. They will get flipped high/low based on the current flow + // in the HBridge. + latchState = latch(latchState, bits.a, forward); + latchState = latch(latchState, bits.b, !forward); + + if (register.value !== latchState) { + register.send(latchState); + } +} + +var Controllers = { + ShiftRegister: { + initialize: { + value: function(opts) { + var rKey = registerKey(opts.register); + + if (!opts.bits || opts.bits.a === undefined || opts.bits.b === undefined) { + throw new Error("ShiftRegister Motors MUST contain HBRIDGE bits {a, b}"); + } + + priv.get(this).bits = opts.bits; + + if (!registers.has(this.board)) { + registers.set(this.board, {}); + } + + if (!registers.get(this.board)[rKey]) { + registers.get(this.board)[rKey] = new ShiftRegister({ + board: this.board, + pins: opts.register + }); + } + + this.io.pinMode(this.pins.pwm, this.io.MODES.PWM); + } + }, + dir: { + value: function(dir) { + this.stop(); + + updateShiftRegister(this, dir.name); + + this.direction = dir; + + process.nextTick(this.emit.bind(this, dir.name)); + + return this; + } + } + }, + PCA9685: { + setPWM: { + writable: true, + value: function(pin, speed) { + var state = priv.get(this); + state.expander.analogWrite(pin, speed); + } + }, + setPin: { + writable: true, + value: function(pin, value) { + var state = priv.get(this); + state.expander.digitalWrite(pin, value); + } + }, + initialize: { + value: function(opts) { + + var state = priv.get(this); + + this.address = opts.address || 0x40; + this.pwmRange = opts.pwmRange || [0, 4080]; + this.frequency = opts.frequency || 50; + + state.expander = Expander.get({ + address: this.address, + controller: this.controller, + bus: this.bus, + pwmRange: this.pwmRange, + frequency: this.frequency, + }); + + Object.keys(this.pins).forEach(function(pinName) { + this.pins[pinName] = state.expander.normalize(this.pins[pinName]); + }, this); + + } + } + }, + EVS_EV3: { + initialize: { + value: function(opts) { + var state = priv.get(this); + + state.shield = EVS.shieldPort(opts.pin); + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + + this.opts.pins = { + pwm: opts.pin, + dir: opts.pin, + }; + } + }, + setPWM: { + value: function(pin, value) { + var state = priv.get(this); + + var register = state.shield.motor === EVS.M1 ? EVS.SPEED_M1 : EVS.SPEED_M2; + var speed = __.scale(value, 0, 255, 0, 100) | 0; + + if (value === 0) { + state.ev3.write(state.shield, EVS.COMMAND, EVS.Motor_Reset); + } else { + if (!this.direction.value) { + speed = -speed; + } + + var data = [ + // 0-100 + speed, + // Duration (0 is forever) + 0, + // Command B + 0, + // Command A + EVS.CONTROL_SPEED | EVS.CONTROL_GO + ]; + + state.ev3.write(state.shield, register, data); + } + } + }, + setPin: { + value: function(pin, value) { + this.setPWM(this.pin, value); + } + }, + validatePins: { + value: function() { + // Check for required pins + if (typeof this.opts.pin === "undefined") { + throw new Error("Pin must be defined"); + } + } + } + }, + + GROVE_I2C_MOTOR_DRIVER: { + REGISTER: { + value: { + ADDRESS: 0x0F, + } + }, + COMMANDS: { + value: { + SET_SPEED: 0x82, + SET_PWM_FREQUENCY: 0x84, + SET_DIRECTION: 0xAA, + NOOP: 0x01, + } + }, + + initialize: { + value: function(opts) { + var state = priv.get(this); + var shared = priv.get("GROVE_I2C_MOTOR_DRIVER"); + + if (!shared) { + shared = { + direction: { + A: 0x01, + B: 0x01, + }, + speed: { + A: 0, + B: 0, + } + }; + + priv.set("GROVE_I2C_MOTOR_DRIVER", shared); + } + + state.shared = shared; + state.pin = opts.pin.toUpperCase(); + + this.opts.pins = { + pwm: opts.pin, + dir: opts.pin, + }; + + this.address = opts.address || this.REGISTER.ADDRESS; + + opts.address = this.address; + + this.io.i2cConfig(opts); + } + }, + setPWM: { + value: function(pin, value) { + var state = priv.get(this); + var speed = Board.constrain(value, 0, 255) | 0; + + state.shared.speed[state.pin] = speed; + + this.io.i2cWrite(this.address, [ + this.COMMANDS.SET_SPEED, + state.shared.speed.A, + state.shared.speed.B, + ]); + } + }, + setPin: { + value: function(pin, value) { + var state = priv.get(this); + + // DIR_CCW = 0x02 + // DIR_CW = 0x01 + state.shared.direction[state.pin] = value ? 0x01 : 0x02; + + var a = state.shared.direction.A & 0x03; + var b = state.shared.direction.B & 0x03; + var direction = (b << 2) | a; + + this.io.i2cWrite(this.address, [ + this.COMMANDS.SET_DIRECTION, + direction, + this.COMMANDS.NOOP, + ]); + } + }, + validatePins: { + value: function() { + // Check for required pins + if (typeof this.opts.pin === "undefined") { + throw new Error("Pin must be defined"); + } + } + } + } +}; + +// Aliases +// +// NXT motors have the exact same control commands as EV3 motors +Controllers.EVS_NXT = Controllers.EVS_EV3; + +var Devices = { + NONDIRECTIONAL: { + pins: { + get: function() { + if (this.opts.pin) { + return { + pwm: this.opts.pin + }; + } else { + return this.opts.pins || {}; + } + } + }, + dir: { + writable: true, + configurable: true, + value: function(speed) { + speed = speed || this.speed(); + return this; + } + }, + resume: { + value: function() { + var speed = this.speed(); + this.speed({ + speed: speed + }); + return this; + } + } + }, + DIRECTIONAL: { + pins: { + get: function() { + if (Array.isArray(this.opts.pins)) { + return { + pwm: this.opts.pins[0], + dir: this.opts.pins[1] + }; + } else { + return this.opts.pins; + } + } + }, + dir: { + writable: true, + configurable: true, + value: function(dir) { + + this.stop(); + + this.setPin(this.pins.dir, dir.value); + this.direction = dir; + + process.nextTick(this.emit.bind(this, dir.name)); + + return this; + } + } + }, + CDIR: { + pins: { + get: function() { + if (Array.isArray(this.opts.pins)) { + return { + pwm: this.opts.pins[0], + dir: this.opts.pins[1], + cdir: this.opts.pins[2] + }; + } else { + return this.opts.pins; + } + } + }, + dir: { + value: function(dir) { + + this.stop(); + this.direction = dir; + + this.setPin(this.pins.cdir, 1 ^ dir.value); + this.setPin(this.pins.dir, dir.value); + + process.nextTick(this.emit.bind(this, dir.name)); + + return this; + } + }, + brake: { + value: function(duration) { + + this.speed({ + speed: 0, + saveSpeed: false + }); + this.setPin(this.pins.dir, 1, 127); + this.setPin(this.pins.cdir, 1, 128, 127); + this.speed({ + speed: 255, + saveSpeed: false, + braking: true + }); + + process.nextTick(this.emit.bind(this, "brake")); + + if (duration) { + var motor = this; + this.board.wait(duration, function() { + motor.stop(); + }); + } + + return this; + } + } + } +}; + +/** + * Motor + * @constructor + * + * @param {Object} opts Options: pin|pins{pwm, dir[, cdir]}, device, controller, current + * @param {Number} pin A single pin for basic + * @param {Array} pins A two or three digit array of pins [pwm, dir]|[pwm, dir, cdir] + * + * + * Initializing "Hobby Motors" + * + * new five.Motor(9); + * + * ...is the same as... + * + * new five.Motor({ + * pin: 9 + * }); + * + * + * Initializing 2 pin, Bi-Directional DC Motors: + * + * new five.Motor([ 3, 12 ]); + * + * ...is the same as... + * + * new five.Motor({ + * pins: [ 3, 12 ] + * }); + * + * ...is the same as... + * + * new five.Motor({ + * pins: { + * pwm: 3, + * dir: 12 + * } + * }); + * + * + * Initializing 3 pin, I2C PCA9685 Motor Controllers: + * i.e. The Adafruit Motor Shield V2 + * + * new five.Motor({ + * pins: [ 8, 9, 10 ], + * controller: "PCA9685", + * address: 0x60 + * }); + * + * + * Initializing 3 pin, Bi-Directional DC Motors: + * + * new five.Motor([ 3, 12, 11 ]); + * + * ...is the same as... + * + * new five.Motor({ + * pins: [ 3, 12, 11 ] + * }); + * + * ...is the same as... + * + * new five.Motor({ + * pins: { + * pwm: 3, + * dir: 12, + * cdir: 11 + * } + * }); + * + * + * Initializing Bi-Directional DC Motors with brake: + * + * new five.Motor({ + * pins: { + * pwm: 3, + * dir: 12, + * brake: 11 + * } + * }); + * + * + * Initializing Bi-Directional DC Motors with current sensing pins: + * See Sensor.js for details on options + * + * new five.Motor({ + * pins: [3, 12], + * current: { + * pin: "A0", + * freq: 250, + * range: [0, 2000] + * } + * }); + * + * + * Initializing Bi-Directional DC Motors with inverted speed for reverse: + * Most likely used for non-commercial H-Bridge controllers + * + * new five.Motor({ + * pins: [3, 12], + * invertPWM: true + * }); + * + */ + +function Motor(opts) { + + var device, controller, state; + + if (!(this instanceof Motor)) { + return new Motor(opts); + } + + Board.Component.call( + this, this.opts = Board.Options(opts) + ); + + controller = opts.controller || null; + + // Derive device based on pins passed + if (typeof this.opts.device === "undefined") { + this.opts.device = "DIRECTIONAL"; + + if (typeof this.opts.pins === "undefined" && typeof this.opts.register !== "object") { + this.opts.device = "NONDIRECTIONAL"; + } + + if (this.opts.pins) { + if (Array.isArray(this.opts.pins)) { + this.opts.device = ["NONDIRECTIONAL", "DIRECTIONAL", "CDIR"][this.opts.pins.length - 1]; + } else { + if (typeof this.opts.pins.dir === "undefined") { + this.opts.device = "NONDIRECTIONAL"; + } else { + this.opts.device = "DIRECTIONAL"; + } + if (typeof this.opts.pins.cdir !== "undefined") { + this.opts.device = "CDIR"; + } + } + } + } + + if (typeof controller === "string" && + (controller.startsWith("EVS") || controller.startsWith("GROVE_I2C"))) { + this.opts.device = "DIRECTIONAL"; + } + + // Allow users to pass in custom device types + device = typeof this.opts.device === "string" ? + Devices[this.opts.device] : this.opts.device; + + this.threshold = typeof this.opts.threshold !== "undefined" ? + this.opts.threshold : 30; + + this.invertPWM = typeof this.opts.invertPWM !== "undefined" ? + this.opts.invertPWM : false; + + Object.defineProperties(this, device); + + if (this.opts.register) { + this.opts.controller = "ShiftRegister"; + } + + /** + * Note: Controller decorates the device. Used for adding + * special controllers (i.e. PCA9685) + **/ + if (this.opts.controller) { + controller = typeof this.opts.controller === "string" ? + Controllers[this.opts.controller] : this.opts.controller; + + Board.Controller.call(this, controller, opts); + } + + // current just wraps a Sensor + if (this.opts.current) { + this.opts.current.board = this.board; + this.current = new Sensor(this.opts.current); + } + + // Create a "state" entry for privately + // storing the state of the motor + state = { + isOn: false, + currentSpeed: typeof this.opts.speed !== "undefined" ? + this.opts.speed : 128, + braking: false, + enabled: false + }; + + priv.set(this, state); + + Object.defineProperties(this, { + // Calculated, read-only motor on/off state + // true|false + isOn: { + get: function() { + return state.isOn; + } + }, + currentSpeed: { + get: function() { + return state.currentSpeed; + } + }, + braking: { + get: function() { + return state.braking; + } + }, + enabled: { + get: function() { + return state.enabled; + } + } + }); + + // We need to store and initialize the state of the dir pin(s) + this.direction = { + value: 1 + }; + + if (this.initialize) { + this.initialize(opts); + } + + this.validatePins(); + this.enable(); + this.dir(this.direction); +} + +util.inherits(Motor, events.EventEmitter); + +Motor.prototype.initialize = function() { + this.io.pinMode(this.pins.pwm, this.io.MODES.PWM); + + ["dir", "cdir", "brake", "enable"].forEach(function(pin) { + if (typeof this.pins[pin] !== "undefined") { + this.io.pinMode(this.pins[pin], this.io.MODES.OUTPUT); + } + }, this); + +}; + +Motor.prototype.setPin = function(pin, value) { + this.io.digitalWrite(pin, value); +}; + +Motor.prototype.setPWM = function(pin, value) { + this.io.analogWrite(pin, __.map(value, 0, 255, 0, this.board.RESOLUTION.PWM)); +}; + +Motor.prototype.speed = function(opts) { + var state = priv.get(this); + + if (typeof opts === "undefined") { + return state.currentSpeed; + } else { + + if (typeof opts === "number") { + opts = { + speed: opts + }; + } + + opts.speed = Board.constrain(opts.speed, 0, 255); + + opts.saveSpeed = typeof opts.saveSpeed !== "undefined" ? + opts.saveSpeed : true; + + if (opts.speed < this.threshold) { + opts.speed = 0; + } + + state.isOn = opts.speed === 0 ? false : true; + + if (opts.saveSpeed) { + state.currentSpeed = opts.speed; + } + + if (opts.braking) { + state.braking = true; + } + + if (this.invertPWM && this.direction.value === 1) { + opts.speed ^= 0xff; + } + + this.setPWM(this.pins.pwm, opts.speed); + + return this; + } + +}; + +// start a motor - essentially just switch it on like a normal motor +Motor.prototype.start = function(speed) { + // Send a signal to turn on the motor and run at given speed in whatever + // direction is currently set. + if (this.pins.brake && this.braking) { + this.setPin(this.pins.brake, 0); + } + + // get current speed if nothing provided. + speed = typeof speed !== "undefined" ? + speed : this.speed(); + + this.speed({ + speed: speed, + braking: false + }); + + // "start" event is fired when the motor is started + if (speed > 0) { + process.nextTick(this.emit.bind(this, "start")); + } + + return this; +}; + +Motor.prototype.stop = function() { + this.speed({ + speed: 0, + saveSpeed: false + }); + process.nextTick(this.emit.bind(this, "stop")); + + return this; +}; + +Motor.prototype.brake = function(duration) { + if (typeof this.pins.brake === "undefined") { + if (this.board.io.name !== "Mock") { + console.log("Non-braking motor type"); + } + this.stop(); + } else { + this.setPin(this.pins.brake, 1); + this.setPin(this.pins.dir, 1); + this.speed({ + speed: 255, + saveSpeed: false, + braking: true + }); + process.nextTick(this.emit.bind(this, "brake")); + + if (duration) { + var motor = this; + this.board.wait(duration, function() { + motor.resume(); + }); + } + } + + return this; +}; + +Motor.prototype.release = function() { + this.resume(); + process.nextTick(this.emit.bind(this, "release")); + + return this; +}; + +Motor.prototype.resume = function() { + var speed = this.speed(); + this.dir(this.direction); + this.start(speed); + + return this; +}; + +Motor.prototype.enable = function() { + var state = priv.get(this); + if (typeof this.pins.enable !== "undefined" && !state.enabled) { + this.setPin(this.pins.enable, 1); + state.enabled = true; + } +}; + +Motor.prototype.disable = function() { + var state = priv.get(this); + if (typeof this.pins.enable !== "undefined" && state.enabled) { + this.setPin(this.pins.enable, 0); + state.enabled = false; + } +}; + +// Check for required pins +Motor.prototype.validatePins = function() { + + if (typeof this.pins.pwm === "undefined") { + throw new Error("PWM pin must be defined"); + } + + if (typeof this.pins.dir === "undefined" && this.opts.device !== "NONDIRECTIONAL") { + throw new Error("DIR pin must be defined"); + } + + if (this.opts.device === "CDIR" && typeof this.pins.cdir === "undefined") { + throw new Error("CDIR pin must be defined for three wire motors"); + } +}; + +[ + /** + * forward Turn the Motor in its forward direction + * fwd Turn the Motor in its forward direction + * + * @param {Number} 0-255, 0 is stopped, 255 is fastest + * @return {Object} this + */ + { + name: "forward", + abbr: "fwd", + value: 1 + }, + /** + * reverse Turn the Motor in its reverse direction + * rev Turn the Motor in its reverse direction + * + * @param {Number} 0-255, 0 is stopped, 255 is fastest + * @return {Object} this + */ + { + name: "reverse", + abbr: "rev", + value: 0 + } +].forEach(function(dir) { + var method = function(speed) { + this.dir(dir); + this.start(speed); + return this; + }; + + Motor.prototype[dir.name] = Motor.prototype[dir.abbr] = method; +}); + +Motor.SHIELD_CONFIGS = { + ADAFRUIT_V1: { + M1: { + pins: { + pwm: 11 + }, + register: { + data: 8, + clock: 4, + latch: 12 + }, + bits: { + a: 2, + b: 3 + } + }, + M2: { + pins: { + pwm: 3 + }, + register: { + data: 8, + clock: 4, + latch: 12 + }, + bits: { + a: 1, + b: 4 + } + }, + M3: { + pins: { + pwm: 6 + }, + register: { + data: 8, + clock: 4, + latch: 12 + }, + bits: { + a: 5, + b: 7 + } + }, + M4: { + pins: { + pwm: 5 + }, + register: { + data: 8, + clock: 4, + latch: 12 + }, + bits: { + a: 0, + b: 6 + } + } + }, + ADAFRUIT_V2: { + M1: { + pins: { + pwm: 8, + dir: 9, + cdir: 10 + }, + address: 0x60, + controller: "PCA9685" + }, + M2: { + pins: { + pwm: 13, + dir: 12, + cdir: 11 + }, + address: 0x60, + controller: "PCA9685" + }, + M3: { + pins: { + pwm: 2, + dir: 3, + cdir: 4 + }, + address: 0x60, + controller: "PCA9685" + }, + M4: { + pins: { + pwm: 7, + dir: 6, + cdir: 5 + }, + address: 0x60, + controller: "PCA9685" + } + }, + SEEED_STUDIO: { + A: { + pins: { + pwm: 9, + dir: 8, + cdir: 11 + } + }, + B: { + pins: { + pwm: 10, + dir: 12, + cdir: 13 + } + } + }, + FREETRONICS_HBRIDGE: { + A: { + pins: { + pwm: 6, + dir: 4, + cdir: 7 + } + }, + B: { + pins: { + pwm: 5, + dir: 3, + cdir: 2 + } + } + }, + ARDUINO_MOTOR_SHIELD_R3_1: { + A: { + pins: { + pwm: 3, + dir: 12 + } + }, + B: { + pins: { + pwm: 11, + dir: 13 + } + } + }, + ARDUINO_MOTOR_SHIELD_R3_2: { + A: { + pins: { + pwm: 3, + dir: 12, + brake: 9 + } + }, + B: { + pins: { + pwm: 11, + dir: 13, + brake: 8 + } + } + }, + ARDUINO_MOTOR_SHIELD_R3_3: { + A: { + pins: { + pwm: 3, + dir: 12, + brake: 9, + current: "A0" + } + }, + B: { + pins: { + pwm: 11, + dir: 13, + brake: 8, + current: "A1" + } + } + }, + DF_ROBOT: { + A: { + pins: { + pwm: 6, + dir: 7 + } + }, + B: { + pins: { + pwm: 5, + dir: 4 + } + } + }, + NKC_ELECTRONICS_KIT: { + A: { + pins: { + pwm: 9, + dir: 12 + } + }, + B: { + pins: { + pwm: 10, + dir: 13 + } + } + }, + RUGGED_CIRCUITS: { + A: { + pins: { + pwm: 3, + dir: 12 + } + }, + B: { + pins: { + pwm: 11, + dir: 13 + } + } + }, + SPARKFUN_ARDUMOTO: { + A: { + pins: { + pwm: 3, + dir: 12 + } + }, + B: { + pins: { + pwm: 11, + dir: 13 + } + } + }, + POLOLU_DRV8835_SHIELD: { + M1: { + pins: { + pwm: 9, + dir: 7 + } + }, + M2: { + pins: { + pwm: 10, + dir: 8 + } + } + }, + POLOLU_VNH5019_SHIELD: { + M1: { + pins: { + pwm: 9, + dir: 2, + cdir: 4, + enable: 6 + } + }, + M2: { + pins: { + pwm: 10, + dir: 7, + cdir: 8, + enable: 12 + } + } + }, + MICRO_MAGICIAN_V2: { + A: { + pins: { + pwm: 6, + dir: 8 + }, + invertPWM: true + }, + B: { + pins: { + pwm: 5, + dir: 7 + }, + invertPWM: true + } + }, + SPARKFUN_LUDUS: { + A: { + pins: { + pwm: 3, + dir: 4, + cdir: 5 + } + }, + B: { + pins: { + pwm: 6, + dir: 7, + cdir: 8 + } + } + }, + SPARKFUN_DUAL_HBRIDGE_EDISON_BLOCK: { + A: { + pins: { + pwm: 20, + dir: 33, + cdir: 46, + enable: 47 + } + }, + B: { + pins: { + pwm: 14, + dir: 48, + cdir: 36, + enable: 47 + } + } + }, + +}; + + +/** + * Motors() + * new Motors() + */ +function Motors(numsOrObjects) { + if (!(this instanceof Motors)) { + return new Motors(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Motor + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(Motors, Collection); + + +/* + * Motors, forward(speed)/fwd(speed) + * + * eg. array.forward(speed); + + * Motors, reverse(speed)/rev(speed) + * + * eg. array.reverse(speed); + + * Motors, start(speed) + * + * eg. array.start(speed); + + * Motors, stop() + * + * eg. array.stop(); + + * Motors, brake() + * + * eg. array.brake(); + + * Motors, release() + * + * eg. array.release(); + */ + +Collection.installMethodForwarding( + Motors.prototype, Motor.prototype +); + + +// Assign Motors Collection class as static "method" of Motor. +// TODO: Eliminate .Array for 1.0.0 +Motor.Array = Motors; +Motor.Collection = Motors; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Motor.Controllers = Controllers; + Motor.purge = function() { + priv.clear(); + registers.clear(); + }; +} + +module.exports = Motor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/orientation.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/orientation.js new file mode 100644 index 00000000..67feef35 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/orientation.js @@ -0,0 +1,219 @@ +var Emitter = require("events").EventEmitter; +var util = require("util"); + +var Board = require("./board"); + +var priv = new Map(); + +var Controllers = { + + BNO055: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"), + driver = IMU.Drivers.get(this.board, "BNO055", opts); + + driver.on("data", function(data) { + dataHandler(data); + }); + } + }, + toScaledEuler: { + value: function(raw) { + + return { + heading: raw.euler.heading / 16, + roll: raw.euler.roll / 16, + pitch: raw.euler.pitch / 16, + }; + } + }, + toScaledQuarternion: { + value: function(raw) { + return { + w: raw.quarternion.w * (1 / (1 << 14)), + x: raw.quarternion.x * (1 / (1 << 14)), + y: raw.quarternion.y * (1 / (1 << 14)), + z: raw.quarternion.z * (1 / (1 << 14)), + }; + } + }, + calibration: { + get: function() { + return priv.get(this).calibration; + } + }, + isCalibrated: { + get: function() { + //only returns true if the calibration of the NDOF/Fusion algo is calibrated + return ((this.calibration >> 6) & 0x03) === 0x03; //are we fully calibrated + } + } + }, +}; + + +/** + * Orientation + * @constructor + * + * five.Orientation(); + * + * five.Orientation({ + * controller: "BNO055", + * freq: 50, + * }); + * + * + * Device Shorthands: + * + * "BNO055": new five.Orientation() + * + * + * @param {Object} opts [description] + * + */ + +function Orientation(opts) { + /* istanbul ignore if */ + if (!(this instanceof Orientation)) { + return new Orientation(opts); + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var freq = opts.freq || 25; + var controller = null; + var raw = null; + var state = { + euler: { + heading: 0, + roll: 0, + pitch: 0, + }, + quarternion: { + w: 0, + x: 0, + y: 0, + z: 0, + }, + calibration: 0, + }; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller === null || typeof controller !== "object") { + throw new Error("Missing valid Orientation controller"); + } + + Board.Controller.call(this, controller, opts); + + /* istanbul ignore else */ + if (!this.toScaledQuarternion) { + this.toScaledQuarternion = opts.toScaledQuarternion || function(raw) { + return raw; + }; + } + + /* istanbul ignore else */ + if (!this.toScaledEuler) { + this.toScaledEuler = opts.toScaledEuler || function(raw) { + return raw; + }; + } + + priv.set(this, state); + + /* istanbul ignore else */ + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + setInterval(function() { + if (raw === null) { + return; + } + var didOrientationChange = false; + var didCalibrationChange = false; + + ["heading", "roll", "pitch"].forEach(function(el) { + /* istanbul ignore else */ + if (state.euler[el] !== raw.orientation.euler[el]) { + didOrientationChange = true; + } + state.euler[el] = raw.orientation.euler[el]; + }); + + ["w", "x", "y", "z"].forEach(function(el) { + /* istanbul ignore else */ + if (state.quarternion[el] !== raw.orientation.quarternion[el]) { + didOrientationChange = true; + } + state.quarternion[el] = raw.orientation.quarternion[el]; + }); + + //if we have a raw calibration state... + // not sure if this is the best place... some devices may not have a calibration state... + if (raw.calibration) { + /* istanbul ignore else */ + if (state.calibration !== raw.calibration) { + didCalibrationChange = true; + } + state.calibration = raw.calibration; + } + + var data = { + euler: this.euler, + quarternion: this.quarternion, + calibration: this.calibration + }; + + this.emit("data", data); + + if (didOrientationChange) { + this.emit("change", data); + } + + //not sure how we can get this event into other drivers + if (didCalibrationChange) { + this.emit("calibration", this.calibration); + } + }.bind(this), freq); +} + + +util.inherits(Orientation, Emitter); + +Object.defineProperties(Orientation.prototype, { + euler: { + get: function() { + var state = priv.get(this); + return this.toScaledEuler(state); + } + }, + quarternion: { + get: function() { + var state = priv.get(this); + return this.toScaledQuarternion(state); + } + } +}); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Orientation.Controllers = Controllers; + Orientation.purge = function() { + priv.clear(); + }; +} + + +module.exports = Orientation; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/piezo.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/piezo.js new file mode 100644 index 00000000..9e681be7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/piezo.js @@ -0,0 +1,531 @@ +var Board = require("./board"); +var Timer = require("nanotimer"); + +var MICROSECONDS_PER_SECOND = 1000000; +var priv = new Map(); +var defaultOctave = 4; + +function clearTimer() { + if (!this.timer) { + return; + } + + this.timer.clearInterval(); + delete this.timer; +} + +var Controllers = { + /** + * Timer-based tone generator using digital high/low piezo. + */ + DEFAULT: { + initialize: { + writable: true, + value: function() { + this.io.pinMode(this.pin, this.io.MODES.OUTPUT); + }, + }, + tone: { + writable: true, + value: function(tone, duration) { + if (isNaN(tone) || isNaN(duration)) { + // Very Bad Things happen if one tries to play a NaN tone + throw new Error( + "Piezo.tone: invalid tone or duration" + ); + } + + clearTimer.call(this); + + var timer = this.timer = new Timer(); + var value = 1; + + timer.setInterval(function() { + value = value === 1 ? 0 : 1; + this.io.digitalWrite(this.pin, value); + + if ((timer.difTime / 1000000) > duration) { + clearTimer.call(this); + } + }.bind(this), null, tone + "u", function() {}); + + return this; + }, + }, + noTone: { + writable: true, + value: function() { + this.io.digitalWrite(this.pin, 0); + clearTimer.call(this); + + return this; + }, + }, + }, + + I2C_BACKPACK: { + ADDRESSES: { + value: [0x0A] + }, + REGISTER: { + value: { + NO_TONE: 0x00, + TONE: 0x01, + }, + }, + initialize: { + value: function(opts) { + var state = priv.get(this); + var address = opts.address || this.ADDRESSES[0]; + + state.address = opts.address = address; + + this.io.i2cConfig(opts); + } + }, + tone: { + value: function(tone, duration) { + var state = priv.get(this); + + if (isNaN(tone) || isNaN(duration)) { + throw new Error( + "Piezo.tone: invalid tone or duration" + ); + } + + var data = [ + this.REGISTER.TONE, + this.pin, + (tone >> 8) & 0xff, + tone & 0xff, + (duration >> 24) & 0xff, + (duration >> 16) & 0xff, + (duration >> 8) & 0xff, + duration & 0xff, + ]; + + this.io.i2cWrite(state.address, data); + + return this; + }, + }, + noTone: { + value: function() { + var state = priv.get(this); + + var data = [ + this.REGISTER.NO_TONE, + this.pin, + ]; + + this.io.i2cWrite(state.address, data); + + return this; + }, + }, + }, +}; + +function Piezo(opts) { + + if (!(this instanceof Piezo)) { + return new Piezo(opts); + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var controller = null; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.DEFAULT; + } + + Object.defineProperties(this, controller); + + Board.Controller.call(this, controller, opts); + + // Piezo instance properties + var state = { + isPlaying: false, + timeout: null, + address: null, + }; + + priv.set(this, state); + + Object.defineProperties(this, { + isPlaying: { + get: function() { + return state.isPlaying; + } + } + }); + + if (typeof this.initialize === "function") { + this.initialize(opts); + } +} + +// These notes are rounded up at .5 otherwise down. +Piezo.Notes = { + "c0": 16, + "c#0": 17, + "d0": 18, + "d#0": 19, + "e0": 21, + "f0": 22, + "f#0": 23, + "g0": 25, + "g#0": 26, + "a0": 28, + "a#0": 29, + "b0": 31, + "c1": 33, + "c#1": 35, + "d1": 37, + "d#1": 39, + "e1": 41, + "f1": 44, + "f#1": 47, + "g1": 49, + "g#1": 52, + "a1": 55, + "a#1": 58, + "b1": 62, + "c2": 65, + "c#2": 69, + "d2": 73, + "d#2": 78, + "e2": 82, + "f2": 87, + "f#2": 93, + "g2": 98, + "g#2": 104, + "a2": 110, + "a#2": 117, + "b2": 124, + "c3": 131, + "c#3": 139, + "d3": 147, + "d#3": 156, + "e3": 165, + "f3": 175, + "f#3": 185, + "g3": 196, + "g#3": 208, + "a3": 220, + "a#3": 233, + "b3": 247, + "c4": 262, + "c#4": 277, + "d4": 294, + "d#4": 311, + "e4": 330, + "f4": 349, + "f#4": 370, + "g4": 392, + "g#4": 415, + "a4": 440, + "a#4": 466, + "b4": 494, + "c5": 523, + "c#5": 554, + "d5": 587, + "d#5": 622, + "e5": 659, + "f5": 698, + "f#5": 740, + "g5": 784, + "g#5": 831, + "a5": 880, + "a#5": 932, + "b5": 988, + "c6": 1047, + "c#6": 1109, + "d6": 1175, + "d#6": 1245, + "e6": 1319, + "f6": 1397, + "f#6": 1480, + "g6": 1568, + "g#6": 1661, + "a6": 1760, + "a#6": 1865, + "b6": 1976, + "c7": 2093, + "c#7": 2217, + "d7": 2349, + "d#7": 2489, + "e7": 2637, + "f7": 2794, + "f#7": 2960, + "g7": 3136, + "g#7": 3322, + "a7": 3520, + "a#7": 3729, + "b7": 3951, + "c8": 4186, + "c#8": 4435, + "d8": 4699, + "d#8": 4978, + "e8": 5274, + "f8": 5588, + "f#8": 5920, + "g8": 6272, + "g#8": 6645, + "a8": 7040, + "a#8": 7459, + "b8": 7902, +}; + +Piezo.Frequencies = Object.keys(Piezo.Notes).reduce(function(accum, note) { + accum[Piezo.Notes[note]] = note; + return accum; +}, {}); + +Piezo.Parsers = {}; +/** + * Get the tone from the current note. note + * could be an int, string, array or null. + * If int or null, leave alone. Otherwise, + * derive what the tone should be. + * @return int | null + */ +Piezo.Parsers.hzFromInput = function(input) { + var output = input; + + if (Array.isArray(input)) { + output = input[0]; + } + + // Is it a valid frequency? + if (typeof output === "number" && + Piezo.Frequencies[output]) { + return output; + } + + // See above: Piezo.Notes { ... } + if (typeof output === "string") { + output = output.toLowerCase().trim(); + + // Example: c#, c + if (output.endsWith("#") || output.length === 1) { + output += defaultOctave; + } + + // There will never be a 0 tone + output = Piezo.Notes[output] || null; + } + + // Normalize NaN, null & undefined to null + if (isNaN(output)) { + output = null; + } + + return output; +}; + +/** + * Obtain the beat/duration count from the current + * note. This is either an int or undefined. Default + * to 1. + * @return int (default 1) + */ +Piezo.Parsers.beatFromNote = function(note) { + var beat = 1; + if (Array.isArray(note) && note[1] !== undefined) { + // If extant, beat will be second element of note + beat = note[1]; + } + return beat; +}; + +/** + * Validate the octave provided to ensure the value is + * supported and won't crash the board. + * @return bool + */ +Piezo.isValidOctave = function(octave) { + return typeof octave === "number" && (octave >= 0 && octave <= 8); +}; + +/** + * Set or get a default octave for all notes + * @return number + */ +Piezo.defaultOctave = function(octave) { + if (Piezo.isValidOctave(octave)) { + defaultOctave = octave; + } + + return defaultOctave; +}; + +Piezo.ToFrequency = function(tone) { + var toneSeconds = tone / MICROSECONDS_PER_SECOND; + var period = toneSeconds * 2; + return Math.round(1 / period); +}; + +Piezo.ToTone = function(frequency) { + var period = 1 / frequency; + var duty = period / 2; + return Math.round(duty * MICROSECONDS_PER_SECOND); +}; + +Piezo.ToSong = function(stringSong, beats) { + beats = beats || 1; + var notes = stringSong.split(" "); + var song = []; + var note, lastNote; + while (notes.length) { + note = notes.shift(); + if (/^[0-9]+$/.test(note)) { + note = parseInt(note, 10); + } + lastNote = song[song.length - 1]; + if (lastNote && lastNote[0] === note) { + lastNote[1] += beats; + } else { + song.push([note, beats]); + } + } + return song; +}; + +/** + * Play a note for a duration. + * @param {string} note - see Piezo.Notes. Case-insensitive. + * If a note name without an octave number is given (e.g. "C#" instead of + * "C#4") then the configured default octave will be used. + * @see Piezo.prototype.defaultOctave + * @param {number} duration - in milliseconds. + */ +Piezo.prototype.note = function(note, duration) { + return this.frequency(Piezo.Parsers.hzFromInput(note), duration); +}; + +/** + * Play a tone for a duration. + * This is a lower-level method than frequency (which does + * the translation from frequency to tone for you). Most of + * the time you likely want to use frequency. + * @param {number} tone - Given as a computed duty-cycle, + * in microseconds. Larger values produce lower tones. + * See https://en.wikipedia.org/wiki/Duty_cycle + * @param {number} duration - in milliseconds. + */ +Piezo.prototype.tone = function(tone, duration) { + return this.frequency(Piezo.ToFrequency(tone), duration); +}; + +/** + * Play a frequency for a duration. + * @param {number} frequency - in Hz + * @param {number} duration - in milliseconds + */ +Piezo.prototype.frequency = function(frequency, duration) { + return this.tone(Piezo.ToTone(frequency), duration); +}; + + +Piezo.prototype.play = function(tune, callback) { + if (typeof tune !== "object") { + tune = { + song: tune + }; + } + + if (typeof tune.song === "string") { + tune.song = Piezo.ToSong(tune.song, tune.beats); + } + + if (tune.song && !Array.isArray(tune.song)) { + /* + If `tune.song` was present and not falsy, + but also is not a string (above), or an array + (presently), then it is likely a Hz value, so + normalize song to the appropriate array format: + */ + tune.song = [tune.song]; + /* + Note: This path is taken for calls that look + like this: + + piezo.play({ + song: 262, + }, ...) + + Where 262 is a frequency in Hz + */ + } + + var state = priv.get(this); + var tempo = tune.tempo || 250; + // Length for a single beat in ms + var beatDuration = Math.round(60000 / tempo); + var song = tune.song || []; + var duration; + var nextNoteIndex = 0; + + var next = function() { + if (nextNoteIndex === song.length) { + // No more notes in song: + // Song is over + state.isPlaying = false; + if (typeof callback === "function") { + callback(tune); + } + return; + } + + var note = song[nextNoteIndex]; + var hz = Piezo.Parsers.hzFromInput(note); + var beat = Piezo.Parsers.beatFromNote(note); + + duration = beat * beatDuration; + nextNoteIndex++; + + if (hz === null) { + this.noTone(); + } else { + this.frequency(hz, duration); + } + + state.timeout = setTimeout(next, duration); + }.bind(this); + + // We are playing a song + state.isPlaying = true; + + next(); + + return this; +}; + +Piezo.prototype.off = function() { + return this.noTone(); +}; + +Piezo.prototype.stop = function() { + var state = priv.get(this); + + /* istanbul ignore else */ + if (state.timeout) { + clearTimeout(state.timeout); + state.timeout = null; + } + + return this; +}; + + +module.exports = Piezo; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/pin.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/pin.js new file mode 100644 index 00000000..b9bc2e92 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/pin.js @@ -0,0 +1,356 @@ +var Board = require("./board"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Collection = require("./mixins/collection"); + +var priv = new Map(); +var modes = { + INPUT: 0x00, + OUTPUT: 0x01, + ANALOG: 0x02, + PWM: 0x03, + SERVO: 0x04 +}; + +/** + * Pin + * @constructor + * + * @description Direct Pin access objects + * + * @param {Object} opts Options: pin, freq, range + */ + +function Pin(opts) { + if (!(this instanceof Pin)) { + return new Pin(opts); + } + if (opts === undefined || (typeof opts === "object" && + opts.addr === undefined && opts.pin === undefined)) { + throw new Error("Pins must have a pin number"); + } + + var pinValue = typeof opts === "object" ? (opts.addr || opts.pin || 0) : opts; + var isAnalogInput = Pin.isAnalog(opts); + var isDTOA = false; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + opts.addr = opts.addr || opts.pin; + + if (this.io.analogPins.includes(pinValue)) { + isAnalogInput = false; + isDTOA = true; + } + + var isPin = typeof opts !== "object"; + var addr = isDTOA ? pinValue : (isPin ? opts : opts.addr); + var type = opts.type || (isAnalogInput ? "analog" : "digital"); + + // Create a private side table + var state = { + mode: null, + last: null, + value: 0 + }; + + priv.set(this, state); + + // Create read-only "addr(address)" property + Object.defineProperties(this, { + type: { + get: function() { + return type; + } + }, + addr: { + get: function() { + return addr; + } + }, + value: { + get: function() { + return state.value; + } + }, + mode: { + set: function(mode) { + var state = priv.get(this); + state.mode = mode; + this.io.pinMode(this.addr, mode); + }, + get: function() { + return priv.get(this).mode; + } + } + }); + + this.mode = typeof opts.as !== "undefined" ? opts.as : + (typeof opts.mode !== "undefined" ? opts.mode : (isAnalogInput ? 0x02 : 0x01)); + + this.freq = typeof opts.freq !== "undefined" ? opts.freq : 20; + + if (this.mode === 0 || this.mode === 2) { + read(this); + } + + if (type === "digital") { + Object.defineProperties(this, { + isHigh: { + get: function() { + return !!state.value; + } + }, + isLow: { + get: function() { + return !state.value; + } + }, + }); + } +} + + +function read(pin) { + var state = priv.get(pin); + + pin.io[pin.type + "Read"](pin.addr, function(data) { + state.value = data; + }); + + setInterval(function() { + var isNot, emit; + + isNot = state.value ? "low" : "high"; + emit = state.value ? "high" : "low"; + + if (state.mode === modes.INPUT) { + if (state.last === null) { + state.last = isNot; + } + if (state.last === isNot) { + state.last = emit; + pin.emit(emit, state.value); + pin.emit("change", state.value); + } + } + pin.emit("data", state.value); + }, pin.freq); +} + +util.inherits(Pin, Emitter); + +/** + * Pin.@@MODE + * + * Read-only constants + * Pin.INPUT = 0x00 + * Pin.OUTPUT = 0x01 + * Pin.ANALOG = 0x02 + * Pin.PWM = 0x03 + * Pin.SERVO = 0x04 + * + */ +Object.keys(modes).forEach(function(mode) { + Object.defineProperty(Pin, mode, { + value: modes[mode] + }); +}); + + +Pin.isAnalog = function(opts) { + if (typeof opts === "string" && Pin.isPrefixed(opts, ["I", "A"])) { + return true; + } + + if (typeof opts === "object") { + return Pin.isAnalog( + typeof opts.addr !== "undefined" ? opts.addr : opts.pin + ); + } +}; + +Pin.isPrefixed = function(value, prefixes) { + value = value[0]; + + return prefixes.reduce(function(resolution, prefix) { + if (!resolution) { + return prefix === value; + } + return resolution; + }, false); +}; + +Pin.write = function(pin, val) { + var state = priv.get(pin); + + state.value = val; + + // Set the correct mode (OUTPUT) + // This will only set if it needs to be set, otherwise a no-op + pin.mode = modes.OUTPUT; + + // Create the correct type of write command + pin.io[pin.type + "Write"](pin.addr, val); + + pin.emit("write", null, val); +}; + +Pin.read = function(pin, callback) { + // Set the correct mode (INPUT) + // This will only set if it needs to be set, otherwise a no-op + + var isChanging = false; + + if (pin.type === "digital" && pin.mode !== 0) { + isChanging = true; + pin.mode = modes.INPUT; + } + + if (pin.type === "analog" && pin.mode !== 2) { + isChanging = true; + pin.mode = modes.ANALOG; + } + + if (isChanging) { + read(pin); + } + + pin.on("data", function() { + callback.call(pin, null, pin.value); + }); +}; + + +// Pin.prototype.isDigital = function() { +// return this.addr > 1; +// }; + +// Pin.prototype.isAnalog = function() { +// return this.board > 1; +// }; + +// Pin.prototype.isPWM = function() { +// }; + +// Pin.prototype.isServo = function() { +// }; + +// Pin.prototype.isI2C = function() { +// }; + +// Pin.prototype.isSerial = function() { +// }; + +// Pin.prototype.isInterrupt = function() { +// }; + +// Pin.prototype.isVersion = function() { +// }; + + +Pin.prototype.query = function(callback) { + var index = this.addr; + + if (this.type === "analog") { + index = this.io.analogPins[this.addr]; + } + + function handler() { + callback(this.io.pins[index]); + } + + this.io.queryPinState(index, handler.bind(this)); + + return this; +}; + +/** + * high Write high/1 to the pin + * @return {Pin} + */ + +Pin.prototype.high = function() { + var value = this.type === "analog" ? this.board.RESOLUTION.PWM : 1; + Pin.write(this, value); + this.emit("high"); + return this; +}; + +/** + * low Write low/0 to the pin + * @return {Pin} + */ + +Pin.prototype.low = function() { + Pin.write(this, 0); + this.emit("low"); + return this; +}; + +/** + * read Read from the pin, value is passed to callback continuation + * @return {Pin} + */ + +/** + * write Write to a pin + * @return {Pin} + */ +["read", "write"].forEach(function(operation) { + Pin.prototype[operation] = function(valOrCallback) { + Pin[operation](this, valOrCallback); + return this; + }; +}); + + +/** + * Pins() + * new Pins() + * + * Constructs an Array-like instance of all servos + */ +function Pins(numsOrObjects) { + if (!(this instanceof Pins)) { + return new Pins(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Pin + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(Pins, Collection); + +[ + "high", "low", "write" +].forEach(function(method) { + Pins.prototype[method] = function() { + var length = this.length; + + for (var i = 0; i < length; i++) { + this[i][method].apply(this[i], arguments); + } + return this; + }; +}); + + +// Assign Pins Collection class as static "method" of Pin. +// TODO: Eliminate .Array for 1.0.0 +Pin.Array = Pins; +Pin.Collection = Pins; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Pin.purge = function() { + priv.clear(); + }; +} + +module.exports = Pin; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/ping.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/ping.js new file mode 100644 index 00000000..7e244233 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/ping.js @@ -0,0 +1,113 @@ +var Emitter = require("events").EventEmitter; +var util = require("util"); + +var Board = require("./board"); +var Fn = require("./fn"); +var within = require("./mixins/within"); + +var toFixed = Fn.toFixed; + +var priv = new Map(); + +/** + * Ping + * @param {Object} opts Options: pin + */ + +function Ping(opts) { + + if (!(this instanceof Ping)) { + return new Ping(opts); + } + + var last = null; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + this.pin = opts && opts.pin || 7; + this.freq = opts.freq || 20; + // this.pulse = opts.pulse || 250; + + var state = { + value: null + }; + + // Private settings object + var settings = { + pin: this.pin, + value: this.io.HIGH, + pulseOut: 5 + }; + + this.io.setMaxListeners(100); + + // Interval for polling pulse duration as reported in microseconds + setInterval(function() { + this.io.pingRead(settings, function(microseconds) { + state.value = microseconds; + }); + }.bind(this), 225); + + // Interval for throttled event + setInterval(function() { + if (state.value === null) { + return; + } + + // The "read" event has been deprecated in + // favor of a "data" event. + this.emit("data", state.value); + + // If the state.value for this interval is not the same as the + // state.value in the last interval, fire a "change" event. + if (state.value !== last) { + this.emit("change", state.value); + } + + // Store state.value for comparison in next interval + last = state.value; + + // Reset samples; + // samples.length = 0; + }.bind(this), this.freq); + + Object.defineProperties(this, { + value: { + get: function() { + return state.value; + } + }, + // Based on the round trip travel time in microseconds, + // Calculate the distance in inches and centimeters + inches: { + get: function() { + return toFixed(state.value / 74 / 2, 2); + } + }, + in: { + get: function() { + return this.inches; + } + }, + cm: { + get: function() { + return toFixed(state.value / 29 / 2, 3); + } + } + }); + + priv.set(this, state); +} + +util.inherits(Ping, Emitter); + +Object.assign(Ping.prototype, within); + +module.exports = Ping; + + +//http://itp.nyu.edu/physcomp/Labs/Servo +//http://arduinobasics.blogspot.com/2011/05/arduino-uno-flex-sensor-and-leds.html +//http://protolab.pbworks.com/w/page/19403657/TutorialPings diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/proximity.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/proximity.js new file mode 100644 index 00000000..7f713fd1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/proximity.js @@ -0,0 +1,573 @@ +var Board = require("./board"); +var Collection = require("./mixins/collection"); +var EVS = require("./evshield"); +var Fn = require("./fn"); +var within = require("./mixins/within"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Pins = Board.Pins; + +var toFixed = Fn.toFixed; + +var priv = new Map(); + +function analogHandler(opts, dataHandler) { + this.io.pinMode(this.pin, this.io.MODES.ANALOG); + this.io.analogRead(this.pin, function(data) { + dataHandler.call(this, data); + }.bind(this)); +} + +var Controllers = { + GP2Y0A21YK: { + // https://www.sparkfun.com/products/242 + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + return toFixed(12343.85 * Math.pow(raw, -1.15), 2); + } + } + }, + GP2D120XJ00F: { + // https://www.sparkfun.com/products/8959 + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + return toFixed((2914 / (raw + 5)) - 1, 2); + } + } + }, + GP2Y0A02YK0F: { + // https://www.sparkfun.com/products/8958 + // 15cm - 150cm + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + return toFixed(10650.08 * Math.pow(raw, -0.935) - 10, 2); + } + } + }, + GP2Y0A41SK0F: { + // https://www.sparkfun.com/products/12728 + // 4cm - 30cm + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + return toFixed(2076 / (raw - 11), 2); + } + } + }, + GP2Y0A710K0F: { + // https://www.adafruit.com/products/1568 + // 100cm - 500cm + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + return toFixed(3.8631e8 * Math.pow(raw, -2.463343), 0); + } + } + }, + SRF10: { + initialize: { + value: function(opts, dataHandler) { + + var address = opts.address || 0x70; + var msUntilNextRead = 65; + + opts.address = address; + + // Set up I2C data connection + this.io.i2cConfig(opts); + + // Startup parameter + this.io.i2cWrite(address, [0x01, 16]); + this.io.i2cWrite(address, [0x02, 255]); + + function read() { + this.io.i2cWrite(address, [0x02]); + this.io.i2cReadOnce(address, 2, function(data) { + dataHandler((data[0] << 8) | data[1]); + }.bind(this)); + + prime.call(this); + } + + function prime() { + // 0x51 result in cm (centimeters) + this.io.i2cWrite(address, [0x00, 0x51]); + + setTimeout(read.bind(this), msUntilNextRead); + } + + prime.call(this); + } + }, + toCm: { + value: function(raw) { + return raw; + } + } + }, + // LV-MaxSonar-EZ + // LV-MaxSonar-EZ0 + // LV-MaxSonar-EZ1 + MB1000: { + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + // From http://www.maxbotix.com/articles/032.htm + // ADC -> inches -> cm + // + // + // From intro in page 1 + // 'The LV-MaxSonar-EZ detects objects + // from 0-inches to 254-inches (6.45-meters) and provides sonar range information from 6- + // inches out to 254-inches with 1-inch resolution.' + // 1inch = 2.54cm + return toFixed((raw / 2) * 2.54, 2); + } + } + }, + // HRLV-MaxSonar-EZ0 + MB1003: { + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + // http://www.maxbotix.com/articles/032.htm + // + // + // From intro in page 1 + // 'This sensor line features 1-mm resolution, .....' + return toFixed(raw / 2, 1); + } + } + }, + // XL-MaxSonar-EZ3 + MB1230: { + initialize: { + value: analogHandler + }, + toCm: { + value: function(raw) { + // From http://www.maxbotix.com/articles/016.htm + // Using a Standard Range XL-MaxSonar with an ADC (Analog Digital Converter) + // When using a standard XL-MaxSonar with an ADC, verify that the sensor + // and micro-controller are referencing the same power supply and ground. + // This also assumes that the ADC being used is perfectly accurate. + // When reading the sensor's output with the scaling in centimeters with a + // 10-bit ADC, the range can be read directly off the ADC. + // If the ADC output reads 700 the range in centimeters is 700 centimeters. + // + // ADC -> cm + // + // + // From intro on page 1 + // 'The MB1200 and MB1300 sensor series detects objects from 0-cm1 + // to 765-cm (25.1 feet) or 1068cm (35 feet) (select models) and + // provide sonar range information from 20-cm2 + // out to765-cm or 1068-cm (select models) with 1-cm resolution...' + return raw >> 0; + } + } + }, + HCSR04: { + initialize: { + value: function(opts, dataHandler) { + var pinValue = opts.pinValue; + var msToNextRead = 65; + + if (Pins.isFirmata(this)) { + if (typeof pinValue === "string" && pinValue[0] === "A") { + pinValue = this.io.analogPins[+pinValue.slice(1)]; + } + + pinValue = +pinValue; + + if (this.io.analogPins.includes(pinValue)) { + opts.pin = pinValue; + } + + this.pin = opts.pin; + } + + // Private settings object + var settings = { + pin: opts.pin, + value: this.io.HIGH, + pulseOut: 5, + }; + + var read = function() { + this.io.pingRead(settings, function(microseconds) { + dataHandler(microseconds); + setTimeout(read, msToNextRead); + }); + }.bind(this); + + read(); + } + }, + toCm: { + value: function(raw) { + // https://www.sparkfun.com/products/13959 + // + // + // From `Product features` paragraph at page 1 + // 'Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact + // measurement function, the ranging accuracy can reach to 3mm' + return toFixed(raw / 29.1 / 2, 1); + } + } + }, + HCSR04I2CBACKPACK: { + initialize: { + value: function(opts, datahandler) { + var address = opts.address || 0x27; + var msToNextRead = 90; + + opts.address = address; + + // set up IO connection: + this.io.i2cConfig(opts); + + if (typeof opts.pin === "undefined") { + this.pin = 8; + } + + var read = function() { + // Read the 2 data bytes from the "register" for the pin. + // When firmware is complete, update to: + // this.io.i2cReadOnce(address, this.pin, 2, function(data) { + this.io.i2cReadOnce(address, 2, function(data) { + datahandler((data[0] << 8) + data[1]); + setTimeout(read, msToNextRead); + }); + }.bind(this); + + read(); + } + }, + toCm: { + value: function(raw) { + return toFixed(raw / 29.1 / 2, 1); + } + } + }, + LIDARLITE: { + REGISTER: { + value: { + ENABLE: 0x00, + READ: 0x8F, + } + }, + initialize: { + value: function(opts, dataHandler) { + var address = 0x62; + + opts.address = address; + + this.io.i2cConfig(opts); + + var read = function() { + this.io.i2cWrite(address, this.REGISTER.ENABLE, 0x04); + setTimeout(function() { + this.io.i2cReadOnce(address, this.REGISTER.READ, 2, function(bytes) { + // Step 5 of Quick Start Guide + dataHandler((bytes[0] << 8) + bytes[1]); + read(); + }); + }.bind(this), 20); + }.bind(this); + + read(); + } + }, + toCm: { + value: function(raw) { + + // + // From `Technology` paragraph at page 11 + // 'Our patented, high"accuracy" + // measurement"technique"enables"distance"measurement"accuracy down"to 1cm..' + return raw >> 0; + } + } + }, + EVS_EV3_IR: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + state.shield = EVS.shieldPort(opts.pin); + + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + state.ev3.setup(state.shield, EVS.Type_EV3); + state.ev3.read(state.shield, EVS.Proximity, EVS.Proximity_Bytes, function(data) { + var value = data[0] | (data[1] << 8); + + dataHandler(value); + }); + } + }, + toCm: { + value: function(raw) { + return raw; + } + } + }, + EVS_EV3_US: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this); + + state.shield = EVS.shieldPort(opts.pin); + + state.ev3 = new EVS(Object.assign(opts, { + io: this.io + })); + state.ev3.setup(state.shield, EVS.Type_EV3); + state.ev3.read(state.shield, EVS.Proximity, EVS.Proximity_Bytes, function(data) { + var value = data[0] | (data[1] << 8); + dataHandler(value); + }); + } + }, + toCm: { + value: function(raw) { + return raw / 10; + } + } + }, +}; + +// Sensor aliases +// IR +Controllers["2Y0A21"] = Controllers.GP2Y0A21YK; +Controllers["2D120X"] = Controllers.GP2D120XJ00F; +Controllers["2Y0A02"] = Controllers.GP2Y0A02YK0F; +Controllers["0A41"] = Controllers.GP2Y0A41SK0F; +Controllers["0A21"] = Controllers.GP2Y0A21YK; +Controllers["0A02"] = Controllers.GP2Y0A02YK0F; +Controllers["41SK0F"] = Controllers.GP2Y0A41SK0F; +Controllers["21YK"] = Controllers.GP2Y0A21YK; +Controllers["2YK0F"] = Controllers.GP2Y0A02YK0F; + +// Sonar +Controllers.MB1010 = Controllers.MB1000; + +Controllers["LV-MaxSonar-EZ"] = Controllers.MB1000; +Controllers["LV-MaxSonar-EZ0"] = Controllers.MB1000; +Controllers["LV-MaxSonar-EZ1"] = Controllers.MB1010; +Controllers["HRLV-MaxSonar-EZ0"] = Controllers.MB1003; +Controllers["XL-MaxSonar-EZ3"] = Controllers.MB1230; + +// Ping +[ + "HC-SR04", + "SR04", + "SRF05", + "SRF06", + "PARALLAXPING", + "SEEEDPING", + "GROVEPING", + "PING_PULSE_IN", + "ULTRASONIC_PING", +].forEach(function(alias) { + Controllers[alias] = Controllers.HCSR04; +}); + +// Ping/HCSR04 I2C Backpack +[ + "HCSR04-I2C-BACKPACK", + "HC-SR04-I2C-BACKPACK", + "SR04-I2C-BACKPACK", + "SR04I2CBACKPACK", + "PINGI2CBACKPACK", + "PING-I2C-BACKPACK", + "HCSR04_I2C_BACKPACK", + "HC_SR04_I2C_BACKPACK", + "SR04_I2C_BACKPACK", + "SR04I2CBACKPACK", + "PINGI2CBACKPACK", + "PING_I2C_BACKPACK", +].forEach(function(alias) { + Controllers[alias] = Controllers.HCSR04I2CBACKPACK; +}); + + +// LIDAR Lite +Controllers["LIDAR-Lite"] = Controllers.LIDARLITE; + + +/** + * Proximity + * @constructor + * + * five.Proximity("A0"); + * + * five.Proximity({ + * controller: "GP2Y0A41SK0F", + * pin: "A0", + * freq: 100 + * }); + * + * + * @param {Object} opts [description] + * + */ + +function Proximity(opts) { + + if (!(this instanceof Proximity)) { + return new Proximity(opts); + } + + var controller = null; + var state = {}; + var raw = 0; + var freq = opts.freq || 25; + var last = 0; + var pinValue = typeof opts === "object" ? opts.pin : opts; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (typeof opts.controller === "string") { + controller = Controllers[opts.controller]; + } else { + controller = opts.controller || Controllers["GP2Y0A21YK"]; + } + + Board.Controller.call(this, controller, opts); + + if (!this.toCm) { + this.toCm = opts.toCm || function(x) { + return x; + }; + } + + priv.set(this, state); + + Object.defineProperties(this, { + /** + * [read-only] Calculated centimeter value + * @property centimeters + * @type Number + */ + centimeters: { + get: function() { + return this.toCm(raw); + } + }, + cm: { + get: function() { + return this.centimeters; + } + }, + /** + * [read-only] Calculated inch value + * @property inches + * @type Number + */ + inches: { + get: function() { + return toFixed(this.centimeters * 0.39, 2); + } + }, + in: { + get: function() { + return this.inches; + } + }, + }); + + if (typeof this.initialize === "function") { + opts.pinValue = pinValue; + this.initialize(opts, function(data) { + raw = data; + }); + } + + setInterval(function() { + if (raw === undefined) { + return; + } + + var data = { + cm: this.cm, + centimeters: this.centimeters, + in: this.in, + inches: this.inches + }; + + this.emit("data", data); + + if (raw !== last) { + last = raw; + this.emit("change", data); + } + }.bind(this), freq); +} + +Proximity.Controllers = [ + "2Y0A21", "GP2Y0A21YK", + "2D120X", "GP2D120XJ00F", + "2Y0A02", "GP2Y0A02YK0F", + "OA41SK", "GP2Y0A41SK0F", + "0A21", "GP2Y0A21YK", + "0A02", "GP2Y0A02YK0F", +]; + +util.inherits(Proximity, Emitter); + +Object.assign(Proximity.prototype, within); + + +/** + * new Proximity.Collection(); + */ + +Proximity.Collection = function(numsOrObjects) { + if (!(this instanceof Proximity.Collection)) { + return new Proximity.Collection(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Proximity + }); + + Collection.Emitter.call(this, numsOrObjects); +}; + +util.inherits(Proximity.Collection, Collection.Emitter); + +Collection.installMethodForwarding( + Proximity.Collection.prototype, Proximity.prototype +); + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Proximity.Controllers = Controllers; + Proximity.purge = function() { + priv.clear(); + }; +} + +module.exports = Proximity; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/reflectancearray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/reflectancearray.js new file mode 100644 index 00000000..d637d68a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/reflectancearray.js @@ -0,0 +1,297 @@ +var Board = require("./board"), + events = require("events"), + util = require("util"), + __ = require("./fn"), + Led = require("./led"), + Sensor = require("./sensor"); + +var CALIBRATED_MIN_VALUE = 0; +var CALIBRATED_MAX_VALUE = 1000; +var LINE_ON_THRESHOLD = 200; +var LINE_NOISE_THRESHOLD = 50; + +var priv = new Map(); + +// Private methods +function initialize() { + var self = this, + state = priv.get(this); + + if (typeof this.opts.emitter === "undefined") { + throw new Error("Emitter pin is required"); + } + + if (!this.pins || this.pins.length === 0) { + throw new Error("Pins must be defined"); + } + + state.emitter = new Led({ + board: this.board, + pin: this.opts.emitter + }); + + state.sensorStates = this.pins.map(function(pin) { + var sensorState = { + sensor: new Sensor({ + board: this.board, + freq: this.freq, + pin: pin + }), + rawValue: 0, + dataReceived: false + }; + + + sensorState.sensor.on("data", function() { + onData.call(self, sensorState, this.value); + }); + + return sensorState; + }, this); +} + +function onData(sensorState, value) { + var allRead, state = priv.get(this); + + sensorState.dataReceived = true; + sensorState.rawValue = value; + + allRead = state.sensorStates.every(function(sensorState) { + return sensorState.dataReceived; + }); + + if (allRead) { + this.emit("data", this.raw); + + if (state.autoCalibrate) { + setCalibration(state.calibration, this.raw); + } + + if (this.isCalibrated) { + this.emit("calibratedData", this.values); + this.emit("line", this.line); + } + + state.sensorStates.forEach(function(sensorState) { + sensorState.dataReceived = false; + }); + } +} + +function setCalibration(calibration, values) { + values.forEach(function(value, i) { + if (calibration.min[i] === undefined || value < calibration.min[i]) { + calibration.min[i] = value; + } + + if (calibration.max[i] === undefined || value > calibration.max[i]) { + calibration.max[i] = value; + } + }); +} + +function calibrationIsValid(calibration, sensors) { + return calibration && + (calibration.max && calibration.max.length === sensors.length) && + (calibration.min && calibration.min.length === sensors.length); +} + + +function calibratedValues() { + return this.raw.map(function(value, i) { + var max = this.calibration.max[i], + min = this.calibration.min[i]; + + var scaled = __.scale(value, min, max, CALIBRATED_MIN_VALUE, CALIBRATED_MAX_VALUE); + return __.constrain(scaled, CALIBRATED_MIN_VALUE, CALIBRATED_MAX_VALUE); + }, this); +} + +function maxLineValue() { + return (this.sensors.length - 1) * CALIBRATED_MAX_VALUE; +} + +// Returns a value between 0 and (n-1)*1000 +// Given 5 sensors, the value will be between 0 and 4000 +function getLine(whiteLine) { + var onLine = false; + var avg = 0, + sum = 0; + var state = priv.get(this); + + whiteLine = !!whiteLine; + + this.values.forEach(function(value, i) { + value = whiteLine ? (CALIBRATED_MAX_VALUE - value) : value; + + if (value > LINE_ON_THRESHOLD) { + onLine = true; + } + + if (value > LINE_NOISE_THRESHOLD) { + avg += value * i * CALIBRATED_MAX_VALUE; + sum += value; + } + }); + + if (!onLine) { + var maxPoint = maxLineValue.call(this) + 1; + var centerPoint = maxPoint / 2; + + return state.lastLine < centerPoint ? 0 : maxPoint; + } + + return state.lastLine = Math.floor(avg / sum); +} + +// Constructor +function ReflectanceArray(opts) { + + if (!(this instanceof ReflectanceArray)) { + return new ReflectanceArray(opts); + } + + this.opts = Board.Options(opts); + + Board.Component.call( + this, this.opts, { + requestPin: false + } + ); + + // Read event throttling + this.freq = opts.freq || 25; + + // Make private data entry + var state = { + lastLine: 0, + isOn: false, + calibration: { + min: [], + max: [] + }, + autoCalibrate: opts.autoCalibrate || false + }; + + priv.set(this, state); + + initialize.call(this); + + Object.defineProperties(this, { + isOn: { + get: function() { + return state.emitter.isOn; + } + }, + isCalibrated: { + get: function() { + return calibrationIsValid(this.calibration, this.sensors); + } + }, + isOnLine: { + get: function() { + var line = this.line; + return line > CALIBRATED_MIN_VALUE && line < maxLineValue.call(this); + } + }, + sensors: { + get: function() { + return state.sensorStates.map(function(sensorState) { + return sensorState.sensor; + }); + } + }, + calibration: { + get: function() { + return state.calibration; + } + }, + raw: { + get: function() { + return state.sensorStates.map(function(sensorState) { + return sensorState.rawValue; + }); + } + }, + values: { + get: function() { + return this.isCalibrated ? calibratedValues.call(this) : this.raw; + } + }, + line: { + get: function() { + return this.isCalibrated ? getLine.call(this) : 0; + } + } + }); +} + +util.inherits(ReflectanceArray, events.EventEmitter); + +// Public methods +ReflectanceArray.prototype.enable = function() { + var state = priv.get(this); + + state.emitter.on(); + + return this; +}; + +ReflectanceArray.prototype.disable = function() { + var state = priv.get(this); + + state.emitter.off(); + + return this; +}; + +// Calibrate will store the min/max values for this sensor array +// It should be called many times in order to get a lot of readings +// on light and dark areas. See calibrateUntil for a convenience +// for looping until a condition is met. +ReflectanceArray.prototype.calibrate = function() { + var state = priv.get(this); + + this.once("data", function(values) { + setCalibration(state.calibration, values); + + this.emit("calibrated"); + }); + + return this; +}; + +// This will continue to calibrate until the predicate is true. +// Allows the user to calibrate n-times, or wait for user input, +// or base it on calibration heuristics. However the user wants. +ReflectanceArray.prototype.calibrateUntil = function(predicate) { + var loop = function() { + this.calibrate(); + this.once("calibrated", function() { + if (!predicate()) { + loop(); + } + }); + }.bind(this); + + loop(); + + return this; +}; + +// Let the user tell us what the calibration data is +// This allows the user to save calibration data and +// reload it without needing to calibrate every time. +ReflectanceArray.prototype.loadCalibration = function(calibration) { + var state = priv.get(this); + + if (!calibrationIsValid(calibration, this.sensors)) { + throw new Error("Calibration data not properly set: {min: [], max: []}"); + } + + state.calibration = calibration; + + return this; +}; + +module.exports = ReflectanceArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/relay.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/relay.js new file mode 100644 index 00000000..ec8aef72 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/relay.js @@ -0,0 +1,176 @@ +var Board = require("./board"); +var Collection = require("./mixins/collection"); +var Pins = Board.Pins; +var util = require("util"); +var priv = new Map(); + +function Relay(opts) { + + if (!(this instanceof Relay)) { + return new Relay(opts); + } + + var pinValue = typeof opts === "object" ? opts.pin : opts; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + opts.type = opts.type || "NO"; + + var state = { + isInverted: opts.type === "NC", + isOn: false, + value: null, + }; + + priv.set(this, state); + + Object.defineProperties(this, { + value: { + get: function() { + return Number(this.isOn); + } + }, + type: { + get: function() { + return state.isInverted ? "NC" : "NO"; + } + }, + isOn: { + get: function() { + return state.isOn; + } + } + }); + + if (Pins.isFirmata(this) && + (typeof pinValue === "string" && pinValue[0] === "A")) { + this.pin = this.io.analogPins[+pinValue.slice(1)]; + this.io.pinMode(this.pin, this.io.MODES.OUTPUT); + } +} + +/** + * on Turn the relay on + * @return {Relay} + */ +Relay.prototype.on = function() { + var state = priv.get(this); + + this.io.digitalWrite( + this.pin, state.isInverted ? this.io.LOW : this.io.HIGH + ); + state.isOn = true; + + return this; +}; + +Relay.prototype.close = Relay.prototype.on; + +/** + * off Turn the relay off + * @return {Relay} + */ +Relay.prototype.off = function() { + var state = priv.get(this); + + this.io.digitalWrite( + this.pin, state.isInverted ? this.io.HIGH : this.io.LOW + ); + state.isOn = false; + + return this; +}; + +Relay.prototype.open = Relay.prototype.off; + +/** + * toggle Toggle the on/off state of the relay + * @return {Relay} + */ +Relay.prototype.toggle = function() { + var state = priv.get(this); + + if (state.isOn) { + this.off(); + } else { + this.on(); + } + + return this; +}; + +/** + * Relays() + * new Relays() + * + * Constructs an Array-like instance of all relays + */ +function Relays(numsOrObjects) { + if (!(this instanceof Relays)) { + return new Relays(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Relay + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(Relays, Collection); + +/* + * Relays, on() + * + * Turn all relays on + * + * eg. collection.on(); + * + * + * Relays, off() + * + * Turn all relays off + * + * eg. collection.off(); + * + * + * Relays, open() + * + * Open all relays + * + * eg. collection.open(); + * + * + * Relays, close() + * + * Close all relays + * + * eg. collection.close(); + * + * + * Relays, toggle() + * + * Toggle the state of all relays + * + * eg. collection.toggle(); + */ + +Collection.installMethodForwarding( + Relays.prototype, Relay.prototype +); + +// Assign Relays Collection class as static "method" of Relay. +// TODO: Eliminate .Array for 1.0.0 +Relay.Array = Relays; +Relay.Collection = Relays; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Relay.purge = function() { + priv.clear(); + }; +} + +module.exports = Relay; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/repl.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/repl.js new file mode 100644 index 00000000..4d43cdf2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/repl.js @@ -0,0 +1,138 @@ +var Emitter = require("events").EventEmitter; +var repl = require("repl"); +var util = require("util"); + +var priv = new Map(); + +// Ported from +// https://github.com/jgautier/firmata + +function Repl(opts) { + if (!Repl.isActive) { + Repl.isActive = true; + + if (!(this instanceof Repl)) { + return new Repl(opts); + } + + // Store context values in instance property + // this will be used for managing scope when + // injecting new values into an existing Repl + // session. + this.context = {}; + this.ready = false; + + var state = { + opts: opts, + board: opts.board, + }; + + priv.set(this, state); + + // Store an accessible copy of the Repl instance + // on a static property. This is later used by the + // Board constructor to automattically setup Repl + // sessions for all programs, which reduces the + // boilerplate requirement. + Repl.ref = this; + } else { + return Repl.ref; + } +} + +// Inherit event api +util.inherits(Repl, Emitter); + +Repl.isActive = false; +Repl.isBlocked = false; + +// See Repl.ref notes above. +Repl.ref = null; + +Repl.prototype.initialize = function(callback) { + var state = priv.get(this); + + process.stdin.resume(); + process.stdin.setEncoding("utf8"); + + var replDefaults = { + prompt: ">> ", + useGlobal: false + }; + + // Call this immediately before repl.start to + // avoid crash on Intel Edison + state.board.info("Repl", "Initialized"); + + // Initialize the REPL session with the default + // repl settings. + // Assign the returned repl instance to "cmd" + var cmd = repl.start(replDefaults); + + this.ready = true; + + // Assign a reference to the REPL's "content" object + // This will be use later by the Repl.prototype.inject + // method for allowing user programs to inject their + // own explicit values and reference + this.cmd = cmd; + this.context = cmd.context; + + cmd.on("exit", function() { + // Time to wait before forcing exit + var failExitTimeout = 1000; + + state.board.emit("exit"); + state.board.warn("Board", "Closing."); + + // A fail safe timeout if 1 second to force exit. + var timeout = setTimeout(function () { + process.reallyExit(); + }, failExitTimeout); + + var interval = setInterval(function () { + var pendingIo = false; + // More than one board is attached, wait until everyone has no + // io pending before exit. + if (state.board.length) { + for (let i = 0; i < state.board.length; i++) { + if (state.board[i].io.pending) { + pendingIo = true; + break; + } + } + } + // Only one board connected, wait until there is no io pending before exit. + else { + pendingIo = state.board.io.pending; + } + + if (!pendingIo) { + clearInterval(interval); + clearTimeout(timeout); + process.nextTick(process.reallyExit); + } + }, 1); + }); + + this.inject(state.opts); + + /* istanbul ignore else */ + if (callback) { + process.nextTick(callback); + } +}; + +Repl.prototype.close = function() { + this.cmd.emit("exit"); +}; + +Repl.prototype.inject = function(obj) { + Object.keys(obj).forEach(function(key) { + Object.defineProperty( + this.context, key, Object.getOwnPropertyDescriptor(obj, key) + ); + }, this); +}; + +module.exports = Repl; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sensor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sensor.js new file mode 100644 index 00000000..92b6520c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sensor.js @@ -0,0 +1,437 @@ +var Board = require("./board"); +var Fn = require("./fn"); +var events = require("events"); +var util = require("util"); +var Collection = require("./mixins/collection"); +var within = require("./mixins/within"); + + +// Sensor instance private data +var priv = new Map(); +// var aliases = { +// change: [ +// // Generic sensor value change +// "change", +// // Slider sensors (alias) +// "slide", +// // Soft Potentiometer (alias) +// "touch", +// // Force Sensor (alias) +// "force", +// // Flex Sensor (alias) +// "bend" +// ] +// }; + +// To reduce noise in sensor readings, sort collected samples +// from high to low and select the value in the center. +function median(input) { + // faster than default comparitor (even for small n) + var sorted = input.sort(function(a, b) { + return a - b; + }); + var len = sorted.length; + var half = Math.floor(len / 2); + + // If the length is odd, return the midpoint m + // If the length is even, return average of m & m + 1 + return len % 2 ? sorted[half] : (sorted[half - 1] + sorted[half]) / 2; +} + +/** + * Sensor + * @constructor + * + * @description Generic analog or digital sensor constructor + * + * @param {Object} opts Options: pin, freq, range + */ + +function Sensor(opts) { + + if (!(this instanceof Sensor)) { + return new Sensor(opts); + } + + // Defaults to 10-bit resolution + var resolution = 0x3FF; + var raw = null; + var last = -1; + var samples = []; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (!opts.type) { + opts.type = "analog"; + } + + if (this.io.RESOLUTION && + (this.io.RESOLUTION.ADC && + (this.io.RESOLUTION.ADC !== resolution))) { + resolution = this.io.RESOLUTION.ADC; + } + + // Set the pin to ANALOG (INPUT) mode + this.mode = opts.type === "digital" ? + this.io.MODES.INPUT : + this.io.MODES.ANALOG; + + this.io.pinMode(this.pin, this.mode); + + // Create a "state" entry for privately + // storing the state of the sensor + var state = { + enabled: typeof opts.enabled === "undefined" ? true : opts.enabled, + booleanBarrier: opts.type === "digital" ? 0 : null, + intervalId: null, + scale: null, + value: 0, + median: 0, + freq: opts.freq || 25, + previousFreq: opts.freq || 25, + }; + // Put a reference where the prototype methods defined in this file have access + priv.set(this, state); + + // Sensor instance properties + this.range = opts.range || [0, resolution]; + this.limit = opts.limit || null; + this.threshold = opts.threshold === undefined ? 1 : opts.threshold; + this.isScaled = false; + + this.io[opts.type + "Read"](this.pin, function(data) { + raw = data; + + // Only append to the samples when noise filtering can/will be used + if (opts.type !== "digital") { + samples.push(raw); + } + }.bind(this)); + + // Throttle + // TODO: The event (interval) processing function should be outside of the Sensor + // constructor function (with appropriate passed (and bound?) arguments), to + // avoid creating a separate copy (of the function) for each Sensor instance. + var eventProcessing = function() { + var err, boundary; + + err = null; + + // For digital sensors, skip the analog + // noise filtering provided below. + if (opts.type === "digital") { + this.emit("data", raw); + + /* istanbul ignore else */ + if (last !== raw) { + this.emit("change", raw); + last = raw; + } + return; + } + + // Keep the previous calculated value if there were no new readings + if (samples.length > 0) { + // Filter the accumulated sample values to reduce analog reading noise + state.median = median(samples); + } + + var roundMedian = Math.round(state.median); + + this.emit("data", roundMedian); + + // If the filtered (state.median) value for this interval is at least ± the + // configured threshold from last, fire change events + if (state.median <= (last - this.threshold) || state.median >= (last + this.threshold)) { + this.emit("change", roundMedian); + // Update the instance-local `last` value (only) when a new change event + // has been emitted. For comparison in the next interval + last = state.median; + } + + if (this.limit) { + if (state.median <= this.limit[0]) { + boundary = "lower"; + } + if (state.median >= this.limit[1]) { + boundary = "upper"; + } + + if (boundary) { + this.emit("limit", { + boundary: boundary, + value: roundMedian + }); + this.emit("limit:" + boundary, roundMedian); + } + } + + // Reset samples + samples.length = 0; + }.bind(this); // ./function eventProcessing() + + + Object.defineProperties(this, { + raw: { + get: function() { + return raw; + } + }, + analog: { + get: function() { + if (opts.type === "digital") { + return raw; + } + + return raw === null ? 0 : + Fn.map(this.raw, 0, resolution, 0, 255) | 0; + }, + }, + constrained: { + get: function() { + if (opts.type === "digital") { + return raw; + } + + return raw === null ? 0 : + Fn.constrain(this.raw, 0, 255); + } + }, + boolean: { + get: function() { + var state = priv.get(this); + var booleanBarrier = state.booleanBarrier; + var scale = state.scale || [0, resolution]; + + if (booleanBarrier === null) { + booleanBarrier = scale[0] + (scale[1] - scale[0]) / 2; + } + + return this.value > booleanBarrier; + } + }, + scaled: { + get: function() { + var mapped, constrain; + + if (state.scale && raw !== null) { + if (opts.type === "digital") { + // Value is either 0 or 1, use as an index + // to return the scaled value. + return state.scale[raw]; + } + + mapped = Fn.fmap(raw, this.range[0], this.range[1], state.scale[0], state.scale[1]); + constrain = Fn.constrain(mapped, state.scale[0], state.scale[1]); + + return constrain; + } + return this.constrained; + } + }, + freq: { + get: function() { + return state.freq; + }, + set: function(newFreq) { + state.freq = newFreq; + if (state.intervalId) { + clearInterval(state.intervalId); + } + + if (state.freq !== null) { + state.intervalId = setInterval(eventProcessing, newFreq); + } + } + }, + value: { + get: function() { + if (state.scale) { + this.isScaled = true; + return this.scaled; + } + + return raw; + } + }, + resolution: { + get: function() { + return resolution; + } + } + }); + + /* istanbul ignore else */ + if (!!process.env.IS_TEST_MODE) { + Object.defineProperties(this, { + state: { + get: function() { + return priv.get(this); + } + } + }); + } + + // Set the freq property only after the get and set functions are defined + // and only if the sensor is not `enabled: false` + if (state.enabled) { + this.freq = state.freq; + } +} + +util.inherits(Sensor, events.EventEmitter); + +/** + * EXPERIMENTAL + * + * within When value is within the provided range, execute callback + * + * @param {Number} range Upperbound, converted into an array, + * where 0 is lowerbound + * @param {Function} callback Callback to execute when value falls inside range + * @return {Object} instance + * + * + * @param {Array} range Lower to Upper bounds [ low, high ] + * @param {Function} callback Callback to execute when value falls inside range + * @return {Object} instance + * + */ +Object.assign(Sensor.prototype, within); + +/** + * enable Enable a disabled sensor. + * + * @return {Object} instance + * + */ +Sensor.prototype.enable = function() { + var state = priv.get(this); + + /* istanbul ignore else */ + if (!state.enabled) { + this.freq = state.freq || state.previousFreq; + } + + return this; +}; + +/** + * disable Disable an enabled sensor. + * + * @return {Object} instance + * + */ +Sensor.prototype.disable = function() { + var state = priv.get(this); + + /* istanbul ignore else */ + if (state.enabled) { + state.enabled = false; + state.previousFreq = state.freq; + this.freq = null; + } + + return this; +}; + +/** + * scale/scaleTo Set a value scaling range + * + * @param {Number} low Lowerbound + * @param {Number} high Upperbound + * @return {Object} instance + * + * @param {Array} [ low, high] Lowerbound + * @return {Object} instance + * + */ +Sensor.prototype.scale = function(low, high) { + this.isScaled = true; + + priv.get(this).scale = Array.isArray(low) ? + low : [low, high]; + + return this; +}; + +/** + * scaleTo Scales value to integer representation + * @param {Number} low An array containing a lower and upper bound + * + * @param {Number} low A number to use as a lower bound + * @param {Number} high A number to use as an upper bound + * @return {Number} The scaled value + */ +Sensor.prototype.scaleTo = function(low, high) { + var scale = Array.isArray(low) ? low : [low, high]; + return Fn.map(this.raw, 0, this.resolution, scale[0], scale[1]); +}; + +/** + * fscaleTo Scales value to single precision float representation + * @param {Number} low An array containing a lower and upper bound + * + * @param {Number} low A number to use as a lower bound + * @param {Number} high A number to use as an upper bound + * @return {Number} The scaled value + */ +Sensor.prototype.fscaleTo = function(low, high) { + var scale = Array.isArray(low) ? low : [low, high]; + return Fn.fmap(this.raw, 0, this.resolution, scale[0], scale[1]); +}; + +/** + * booleanAt Set a midpoint barrier value used to calculate returned value of + * .boolean property. + * + * @param {Number} barrier + * @return {Object} instance + * + */ +Sensor.prototype.booleanAt = function(barrier) { + priv.get(this).booleanBarrier = barrier; + return this; +}; + + + +/** + * Sensors() + * new Sensors() + * + * Constructs an Array-like instance of all servos + */ +function Sensors(numsOrObjects) { + if (!(this instanceof Sensors)) { + return new Sensors(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Sensor + }); + + Collection.Emitter.call(this, numsOrObjects); +} + +util.inherits(Sensors, Collection.Emitter); + + +Collection.installMethodForwarding( + Sensors.prototype, Sensor.prototype +); + +// Assign Sensors Collection class as static "method" of Sensor. +Sensor.Collection = Sensors; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Sensor.purge = function() { + priv.clear(); + }; +} + + +module.exports = Sensor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/servo.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/servo.js new file mode 100644 index 00000000..1c818c0f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/servo.js @@ -0,0 +1,696 @@ +var Board = require("./board"); +var Pins = Board.Pins; +var Expander = require("./expander"); +var Emitter = require("events").EventEmitter; +var util = require("util"); +var Collection = require("./mixins/collection"); +var Fn = require("./fn"); +var Animation = require("./animation"); + +// Servo instance private data +var priv = new Map(); + +var Controllers = { + PCA9685: { + initialize: { + value: function(opts) { + var state = priv.get(this); + + this.address = opts.address || 0x40; + this.pwmRange = opts.pwmRange || [450, 1850]; + this.frequency = opts.frequency || 50; + + state.expander = Expander.get({ + address: this.address, + controller: this.controller, + bus: this.bus, + pwmRange: this.pwmRange, + frequency: this.frequency, + }); + + this.pin = state.expander.normalize(opts.pin); + } + }, + update: { + writable: true, + value: function(microseconds) { + var state = priv.get(this); + state.expander.servoWrite(this.pin, microseconds); + } + } + }, + Standard: { + initialize: { + value: function(opts) { + + // When in debug mode, if pin is not a PWM pin, emit an error + if (opts.debug && !this.board.pins.isServo(this.pin)) { + Board.Pins.Error({ + pin: this.pin, + type: "PWM", + via: "Servo", + }); + } + + if (Array.isArray(opts.pwmRange)) { + this.io.servoConfig(this.pin, opts.pwmRange[0], opts.pwmRange[1]); + } else { + this.io.pinMode(this.pin, this.mode); + } + } + }, + update: { + writable: true, + value: function(degrees) { + + // If same degrees return immediately. + if (this.last && this.last.degrees === degrees) { + return this; + } + + // Map value from degreeRange to pwmRange + var microseconds = Fn.map( + degrees, + this.degreeRange[0], this.degreeRange[1], + this.pwmRange[0], this.pwmRange[1] + ); + + // Restrict values to integers + microseconds |= 0; + + this.io.servoWrite(this.pin, microseconds); + } + } + } +}; + +/** + * Servo + * @constructor + * + * @param {Object} opts Options: pin, type, id, range + */ + +function Servo(opts) { + + if (!(this instanceof Servo)) { + return new Servo(opts); + } + + var history = []; + var pinValue = typeof opts === "object" ? opts.pin : opts; + var controller = null; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + this.degreeRange = opts.degreeRange || [0, 180]; + this.pwmRange = opts.pwmRange || [600, 2400]; + this.range = opts.range || this.degreeRange; + this.deadband = opts.deadband || [90, 90]; + this.fps = opts.fps || 100; + this.offset = opts.offset || 0; + this.range = opts.range || [0 - this.offset, 180 - this.offset]; + this.mode = this.io.MODES.SERVO; + this.interval = null; + this.value = null; + + // StandardFirmata on Arduino allows controlling + // servos from analog pins. + // If we're currently operating with an Arduino + // and the user has provided an analog pin name + // (eg. "A0", "A5" etc.), parse out the numeric + // value and capture the fully qualified analog + // pin number. + if (typeof opts.controller === "undefined" && Pins.isFirmata(this)) { + if (typeof pinValue === "string" && pinValue[0] === "A") { + pinValue = this.io.analogPins[+pinValue.slice(1)]; + } + + pinValue = +pinValue; + + // If the board's default pin normalization + // came up with something different, use the + // the local value. + if (!Number.isNaN(pinValue) && this.pin !== pinValue) { + this.pin = pinValue; + } + } + + + // The type of servo determines certain alternate + // behaviours in the API + this.type = opts.type || "standard"; + + // Invert the value of all servoWrite operations + // eg. 80 => 100, 90 => 90, 0 => 180 + if (opts.isInverted) { + console.warn("The 'isInverted' property has been renamed 'invert'"); + } + this.invert = opts.isInverted || opts.invert || false; + + + // Collect all movement history for this servo + // history = [ + // { + // timestamp: Date.now(), + // degrees: degrees + // } + // ]; + + // Allow "setup"instructions to come from + // constructor options properties + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.Standard; + } + + priv.set(this, { + history: history + }); + + Board.Controller.call(this, controller, opts); + + Object.defineProperties(this, { + history: { + get: function() { + return history.slice(-5); + } + }, + last: { + get: function() { + return history[history.length - 1]; + } + }, + position: { + get: function() { + return history.length ? history[history.length - 1].degrees : -1; + } + } + }); + + this.initialize(opts); + + // If "startAt" is defined and center is falsy + // set servo to min or max degrees + if (typeof opts.startAt !== "undefined") { + this.startAt = opts.startAt; + this.to(opts.startAt); + } else { + this.startAt = (this.degreeRange[1] - this.degreeRange[0]) / 2 + this.degreeRange[0]; + } + + // If "center" true set servo to 90deg + if (opts.center) { + this.center(); + } + + if (opts.type === "continuous") { + this.stop(); + } +} + +util.inherits(Servo, Emitter); + + +/** + * to + * + * Set the servo horn's position to given degree over time. + * + * @param {Number} degrees Degrees to turn servo to. + * @param {Number} time Time to spend in motion. + * @param {Number} rate The rate of the motion transiton + * + * - or - + * + * @param {Object} an Animation() segment config object + * + * @return {Servo} instance + */ + +Servo.prototype.to = function(degrees, time, rate) { + + var state = priv.get(this); + var options = {}; + + if (typeof degrees === "object") { + + Object.assign(options, degrees); + + options.duration = degrees.duration || degrees.interval || 1000; + options.cuePoints = degrees.cuePoints || [0, 1.0]; + options.keyFrames = degrees.keyFrames || [ + null, + { + value: typeof degrees.degrees === "number" ? degrees.degrees : this.startAt + } + ]; + + options.oncomplete = function() { + // Enforce async execution for user "oncomplete" + process.nextTick(function() { + if (typeof degrees.oncomplete === "function") { + degrees.oncomplete(); + } + this.emit("move:complete"); + }.bind(this)); + }.bind(this); + + + state.isRunning = true; + state.animation = state.animation || new Animation(this); + state.animation.enqueue(options); + + } else { + + var target = degrees; + + // Enforce limited range of motion + degrees = Fn.constrain(degrees, this.range[0], this.range[1]); + + if (typeof time !== "undefined") { + + options.duration = time; + options.keyFrames = [null, { + degrees: degrees + }]; + options.fps = rate || this.fps; + + this.to(options); + + } else { + + this.value = degrees; + + degrees += this.offset; + + if (this.invert) { + degrees = Fn.map( + degrees, + this.degreeRange[0], this.degreeRange[1], + this.degreeRange[1], this.degreeRange[0] + ); + } + + this.update(degrees); + + if (state.history.length > 5) { + state.history.shift(); + } + + state.history.push({ + timestamp: Date.now(), + degrees: degrees, + target: target + }); + } + } + + // return this instance + return this; +}; + + +/** + * Animation.normalize + * + * @param [number || object] keyFrames An array of step values or a keyFrame objects + */ + +Servo.prototype[Animation.normalize] = function(keyFrames) { + + var last = this.last ? this.last.target : this.startAt; + + // If user passes null as the first element in keyFrames use current position + if (keyFrames[0] === null) { + keyFrames[0] = { + value: last + }; + } + + // If user passes a step as the first element in keyFrames use current position + step + if (typeof keyFrames[0] === "number") { + keyFrames[0] = { + value: last + keyFrames[0] + }; + } + + return keyFrames.map(function(frame) { + var value = frame; + + /* istanbul ignore else */ + if (frame !== null) { + // frames that are just numbers represent _step_ + if (typeof frame === "number") { + frame = { + step: value, + }; + } else { + if (typeof frame.degrees === "number") { + frame.value = frame.degrees; + delete frame.degrees; + } + if (typeof frame.copyDegrees === "number") { + frame.copyValue = frame.copyDegrees; + delete frame.copyDegrees; + } + } + + /* istanbul ignore else */ + if (!frame.easing) { + frame.easing = "linear"; + } + } + return frame; + }); +}; + +/** + * Animation.render + * + * @position [number] value to set the servo to + */ +Servo.prototype[Animation.render] = function(position) { + return this.to(position[0]); +}; + +/** + * step + * + * Update the servo horn's position by specified degrees (over time) + * + * @param {Number} degrees Degrees to turn servo to. + * @param {Number} time Time to spend in motion. + * + * @return {Servo} instance + */ + +Servo.prototype.step = function(degrees, time) { + return this.to(this.last.target + degrees, time); +}; + +/** + * move Alias for Servo.prototype.to + */ +Servo.prototype.move = function(degrees, time) { + console.warn("Servo.prototype.move has been renamed to Servo.prototype.to"); + + return this.to(degrees, time); +}; + +/** + * min Set Servo to minimum degrees, defaults to 0deg + * @param {Number} time Time to spend in motion. + * @param {Number} rate The rate of the motion transiton + * @return {Object} instance + */ + +Servo.prototype.min = function(time, rate) { + return this.to(this.range[0], time, rate); +}; + +/** + * max Set Servo to maximum degrees, defaults to 180deg + * @param {Number} time Time to spend in motion. + * @param {Number} rate The rate of the motion transiton + * @return {[type]} [description] + */ +Servo.prototype.max = function(time, rate) { + return this.to(this.range[1], time, rate); +}; + +/** + * center Set Servo to centerpoint, defaults to 90deg + * @param {Number} time Time to spend in motion. + * @param {Number} rate The rate of the motion transiton + * @return {[type]} [description] + */ +Servo.prototype.center = function(time, rate) { + return this.to(Math.abs((this.range[0] + this.range[1]) / 2), time, rate); +}; + +/** + * home Return Servo to startAt position + */ +Servo.prototype.home = function() { + return this.to(this.startAt); +}; + +/** + * sweep Sweep the servo between min and max or provided range + * @param {Array} range constrain sweep to range + * + * @param {Object} options Set range or interval. + * + * @return {[type]} [description] + */ +Servo.prototype.sweep = function(opts) { + + var options = { + keyFrames: [{ + value: this.range[0] + }, { + value: this.range[1] + }], + metronomic: true, + loop: true, + easing: "inOutSine" + }; + + // If opts is an array, then assume a range was passed + if (Array.isArray(opts)) { + options.keyFrames = rangeToKeyFrames(opts); + } else { + if (typeof opts === "object" && opts !== null) { + Object.assign(options, opts); + /* istanbul ignore else */ + if (Array.isArray(options.range)) { + options.keyFrames = rangeToKeyFrames(options.range); + } + } + } + + return this.to(options); +}; + +function rangeToKeyFrames(range) { + return range.map(function(value) { + return { value: value }; + }); +} + +/** + * stop Stop a moving servo + * @return {[type]} [description] + */ +Servo.prototype.stop = function() { + var state = priv.get(this); + + if (state.animation) { + state.animation.stop(); + } + + if (this.type === "continuous") { + this.to( + this.deadband.reduce(function(a, b) { + return Math.round((a + b) / 2); + }) + ); + } else { + clearInterval(this.interval); + } + + return this; +}; + +// +["clockWise", "cw", "counterClockwise", "ccw"].forEach(function(api) { + Servo.prototype[api] = function(rate) { + var range; + rate = rate === undefined ? 1 : rate; + /* istanbul ignore if */ + if (this.type !== "continuous") { + this.board.error( + "Servo", + "Servo.prototype." + api + " is only available for continuous servos" + ); + } + if (api === "cw" || api === "clockWise") { + range = [rate, 0, 1, this.deadband[1] + 1, this.range[1]]; + } else { + range = [rate, 0, 1, this.deadband[0] - 1, this.range[0]]; + } + return this.to(Fn.scale.apply(null, range) | 0); + }; +}); + + +/** + * + * Static API + * + * + */ + +Servo.Continuous = function(pinOrOpts) { + var opts = {}; + + if (typeof pinOrOpts === "object") { + Object.assign(opts, pinOrOpts); + } else { + opts.pin = pinOrOpts; + } + + opts.type = "continuous"; + return new Servo(opts); +}; + +Servo.Continuous.speeds = { + // seconds to travel 60 degrees + "@4.8V": 0.23, + "@5.0V": 0.17, + "@6.0V": 0.18 +}; + +/** + * Servos() + * new Servos() + */ +function Servos(numsOrObjects) { + if (!(this instanceof Servos)) { + return new Servos(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Servo + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(Servos, Collection); + +/* + * Servos, center() + * + * centers all servos to 90deg + * + * eg. array.center(); + + * Servos, min() + * + * set all servos to the minimum degrees + * defaults to 0 + * + * eg. array.min(); + + * Servos, max() + * + * set all servos to the maximum degrees + * defaults to 180 + * + * eg. array.max(); + + * Servos, stop() + * + * stop all servos + * + * eg. array.stop(); + */ + +Collection.installMethodForwarding( + Servos.prototype, Servo.prototype +); + + +/** + * Animation.normalize + * + * @param [number || object] keyFrames An array of step values or a keyFrame objects + */ +Servos.prototype[Animation.normalize] = function(keyFrameSet) { + return keyFrameSet.map(function(keyFrames, index) { + if (keyFrames !== null && Array.isArray(keyFrames)) { + var servo = this[index]; + + // If servo is a servoArray then user servo[0] for default values + if (servo instanceof Servos) { + servo = servo[0]; + } + + var last = servo.last ? servo.last.target : servo.startAt; + + // If the first keyFrameSet is null use the current position + if (keyFrames[0] === null) { + keyFrames[0] = { + value: last + }; + } + + if (Array.isArray(keyFrames)) { + if (keyFrames[0] === null) { + keyFrameSet[index][0] = { + value: last + }; + } + } + return this[index][Animation.normalize](keyFrames); + } + + if (keyFrames && typeof keyFrames.degrees === "number") { + keyFrames.value = keyFrames.degrees; + delete keyFrames.degrees; + } + return keyFrames; + }, this); +}; + +/** + * Animation.render + * + * @position [number] array of values to set the servos to + */ +Servos.prototype[Animation.render] = function(position) { + return this.each(function(servo, i) { + servo.to(position[i]); + }); +}; + + +// Assign Servos Collection class as static "method" of Servo. +// TODO: Eliminate .Array for 1.0.0 +Servo.Array = Servos; +Servo.Collection = Servos; + +// Alias +// TODO: Deprecate and REMOVE +Servo.prototype.write = Servo.prototype.move; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Servo.Controllers = Controllers; + Servo.purge = function() { + priv.clear(); + }; +} + +module.exports = Servo; +// References +// +// http://www.societyofrobots.com/actuators_servos.shtml +// http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/900-00008-CRServo-v2.2.pdf +// http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM +// http://servocity.com/html/hs-7980th_servo.html +// http://mbed.org/cookbook/Servo + +// Further API info: +// http://www.tinkerforge.com/doc/Software/Bricks/Servo_Brick_Python.html#servo-brick-python-api +// http://www.tinkerforge.com/doc/Software/Bricks/Servo_Brick_Java.html#servo-brick-java-api diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/shiftregister.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/shiftregister.js new file mode 100644 index 00000000..18f4723f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/shiftregister.js @@ -0,0 +1,223 @@ +var Board = require("./board"); +var Collection = require("./mixins/collection"); +var util = require("util"); +var priv = new Map(); + +function ShiftRegister(opts) { + if (!(this instanceof ShiftRegister)) { + return new ShiftRegister(opts); + } + + if (Array.isArray(opts)) { + // [Data, Clock, Latch, Reset] + opts = { + pins: { + data: opts[0], + clock: opts[1], + latch: opts[2], + reset: opts.length === 4 ? opts[3] : null, + } + }; + } else if (typeof opts.pins === "object" && Array.isArray(opts.pins)) { + opts.pins = { + data: opts.pins[0], + clock: opts.pins[1], + latch: opts.pins[2], + reset: opts.pins.length === 4 ? opts.pins[3] : null, + }; + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + this.size = opts.size || 1; + this.pins.reset = typeof opts.pins.reset !== "undefined" ? opts.pins.reset : null; + + var isAnode = typeof opts.isAnode !== "undefined" ? opts.isAnode : false; + var clear = isAnode ? 255 : 0; + var state = { + isAnode: isAnode, + value: new Array(this.size).fill(clear), + encoded: encoded[isAnode ? "anode" : "cathode"], + clear: clear, + }; + + priv.set(this, state); + + Object.defineProperties(this, { + isAnode: { + get: function() { + return isAnode; + } + }, + value: { + get: function() { + return state.value; + } + }, + }); +} + +var encoded = { + cathode: [63, 6, 91, 79, 102, 109, 125, 7, 127, 103], + anode: [64, 121, 36, 48, 25, 18, 2, 120, 0, 24], +}; + +/** + * Print a digit on a seven segment display, or several + * digits across several displays. + */ +ShiftRegister.prototype.display = function(value) { + var state = priv.get(this); + var chars; + + if (typeof value === "number") { + // 1, 20, etc. + return this.display(String(value)); + } + + if (typeof value === "string") { + var matches = value.match(/([0-9]{1}\.*)/g); + + if (matches && matches.length) { + chars = matches.map(function(char) { + // "1" + if (char.length === 1) { + return state.encoded[char] | (1 << 7); + } + // "1.?.?" + return state.encoded[char[0]]; + }); + } + } + + this.send(chars); + + state.value = chars; + + return this; +}; + +/** + * Send one or more values to the shift register. + * @param {...number} value Value to send + * @returns {ShiftRegister} + */ +ShiftRegister.prototype.send = function(value) { + var state = priv.get(this); + var args = Array.from(arguments); + + if (args.length === 1) { + args = [value]; + } + + if (Array.isArray(value)) { + args = value; + } + + // open latch to fill register with data + this.io.digitalWrite(this.pins.latch, this.io.LOW); + + args.forEach(function(arg) { + if (typeof arg === "string") { + arg = arg.charCodeAt(0); + } + if (this.isAnode && + (arg !== 255 && !state.encoded.includes(arg) && !state.encoded.includes(arg & ~(1 << 7)))) { + + var index = encoded.anode.findIndex(function(value) { + return value === arg; + }); + + if (index !== -1) { + arg = encoded.cathode[index]; + } + } + this.board.shiftOut(this.pins.data, this.pins.clock, true, arg); + }, this); + + // close latch to commit bits into register. + this.io.digitalWrite(this.pins.latch, this.io.HIGH); + + state.value = args; + + return this; +}; + +/** + * Clear the shift register by replacing each value with a 0. + * @type {ShiftRegister} + */ +ShiftRegister.prototype.clear = function() { + var state = priv.get(this); + return this.send(Array(this.size).fill(state.clear)); +}; + +ShiftRegister.prototype.reset = function() { + if (this.pins.reset === null) { + throw new Error("ShiftRegister was not initialized with a reset pin"); + } + this.io.digitalWrite(this.pins.clock, this.io.LOW); + this.io.digitalWrite(this.pins.reset, this.io.LOW); + this.io.digitalWrite(this.pins.clock, this.io.HIGH); + this.io.digitalWrite(this.pins.reset, this.io.HIGH); + + return this; +}; + + + + +/** + * ShiftRegisters() + * new ShiftRegisters() + */ +function ShiftRegisters(numsOrObjects) { + if (!(this instanceof ShiftRegisters)) { + return new ShiftRegisters(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: ShiftRegister + }); + + Collection.call(this, numsOrObjects); +} + +util.inherits(ShiftRegisters, Collection); + + +/* + * ShiftRegisters, display(...) + * + * eg. array.display(...); + + * ShiftRegisters, send(...) + * + * eg. array.send(...); + + * ShiftRegisters, clear() + * + * eg. array.clear(); + + * ShiftRegisters, reset() + * + * eg. array.reset(); + */ + +Collection.installMethodForwarding( + ShiftRegisters.prototype, ShiftRegister.prototype +); + +// Assign ShiftRegisters Collection class as static "method" of ShiftRegister. +ShiftRegister.Collection = ShiftRegisters; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + ShiftRegister.purge = function() { + priv.clear(); + }; +} + +module.exports = ShiftRegister; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sleep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sleep.js new file mode 100644 index 00000000..1b37df2e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sleep.js @@ -0,0 +1,6 @@ +module.exports = { + nano: function(ns) { + var start = process.hrtime(); + while (process.hrtime() < start + ns) {} + } +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sonar.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sonar.js new file mode 100644 index 00000000..bf35cb93 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/sonar.js @@ -0,0 +1,175 @@ +var Board = require("./board"), + events = require("events"), + util = require("util"), + within = require("./mixins/within"); + +var priv = new Map(); +var Devices; + +/** + * Sonar + * @constructor + * + * @param {Object} opts Options: pin (analog) + */ + +function Sonar(opts) { + + if (!(this instanceof Sonar)) { + return new Sonar(opts); + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + var device, state; + + // Sonar instance properties + this.freq = opts.freq || 100; + this.value = null; + + state = { + last: 0, + median: 0, + samples: [] + }; + + priv.set(this, state); + + if (typeof opts.device === "string") { + device = Devices[opts.device]; + } else { + device = opts.device; + } + + if (typeof device === "undefined") { + device = Devices.DEFAULT; + } + + device.initialize.call(this, opts); + + if (!device.descriptor.inches) { + device.descriptor.inches = { + get: function() { + return +(this.cm * 0.39).toFixed(2); + } + }; + } + + device.descriptor.in = device.descriptor.inches; + + Object.defineProperties(this, device.descriptor); + + // Throttle + setInterval(function() { + // Nothing read since previous interval + if (state.samples.length === 0) { + return; + } + + state.median = state.samples.sort()[Math.floor(state.samples.length / 2)]; + this.value = state.median; + + this.emit("data", state.median); + + // If the state.median value for this interval is not the same as the + // state.median value in the last interval, fire a "change" event. + // + if (state.last && state.median && + (state.median.toFixed(1) !== state.last.toFixed(1))) { + this.emit("change", state.median); + } + + // Store this media value for comparison + // in next interval + state.last = state.median; + + // Reset state.samples; + state.samples.length = 0; + }.bind(this), this.freq); +} + +util.inherits(Sonar, events.EventEmitter); +Object.assign(Sonar.prototype, within); + +Devices = { + SRF10: { + initialize: function(opts) { + + var samples = priv.get(this).samples; + var address = 0x70; + var delay = 65; + + // Set up I2C data connection + this.io.i2cConfig(opts); + + // Startup parameter + this.io.i2cWrite(address, [0x01, 16]); + this.io.i2cWrite(address, [0x02, 255]); + + this.io.setMaxListeners(100); + + function read() { + this.io.i2cWrite(address, [0x02]); + this.io.i2cReadOnce(address, 2, function(data) { + samples.push((data[0] << 8) | data[1]); + }.bind(this)); + + prime.call(this); + } + + function prime() { + // 0x52 result in us (microseconds) + this.io.i2cWrite(address, [0x00, 0x52]); + + setTimeout(read.bind(this), delay); + } + + prime.call(this); + }, + descriptor: { + cm: { + get: function() { + var median = priv.get(this).median; + return +((((median / 2) * 343.2) / 10) / 1000).toFixed(1); + } + } + } + }, + + DEFAULT: { + initialize: function() { + var samples = priv.get(this).samples; + + // Set the pin to ANALOG mode + this.mode = this.io.MODES.ANALOG; + this.io.pinMode(this.pin, this.mode); + + this.io.analogRead(this.pin, function(data) { + samples.push(data); + }.bind(this)); + }, + descriptor: { + cm: { + get: function() { + var median = priv.get(this).median; + return +((median / 2) * 2.54).toFixed(1); + } + } + } + } +}; + +Devices.SRF02 = Devices.SRF08 = Devices.SRF10; + +module.exports = Sonar; + +// Reference +// +// http://www.maxbotix.com/tutorials.htm#Code_example_for_the_BasicX_BX24p +// http://www.electrojoystick.com/tutorial/?page_id=285 + +// Tutorials +// +// http://www.sensorpedia.com/blog/how-to-interface-an-ultrasonic-rangefinder-with-sensorpedia-via-twitter-guide-2/ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/stepper.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/stepper.js new file mode 100644 index 00000000..a51d2cb6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/stepper.js @@ -0,0 +1,461 @@ +var Board = require("./board"); +var Fn = require("./fn"); +var priv = new Map(); +var steppers = new Map(); +var TAU = Fn.TAU; + +var MAXSTEPPERS = 6; // correlates with MAXSTEPPERS in firmware + + +function Step(stepper) { + this.rpm = 180; + this.direction = -1; + this.speed = 0; + this.accel = 0; + this.decel = 0; + + this.stepper = stepper; +} + +Step.PROPERTIES = ["rpm", "direction", "speed", "accel", "decel"]; +Step.DEFAULTS = [180, -1, 0, 0, 0]; + + +function MotorPins(pins) { + var k = 0; + pins = pins.slice(); + while (pins.length) { + this["motor" + (++k)] = pins.shift(); + } +} + +function isSupported(io) { + return io.pins.some(function(pin) { + return pin.supportedModes.includes(io.MODES.STEPPER); + }); +} + +/** + * Stepper + * + * Class for handling steppers using AdvancedFirmata support for asynchronous stepper control + * + * + * five.Stepper({ + * type: constant, // io.STEPPER.TYPE.* + * stepsPerRev: number, // steps to make on revolution of stepper + * pins: { + * step: number, // pin attached to step pin on driver (used for type DRIVER) + * dir: number, // pin attached to direction pin on driver (used for type DRIVER) + * motor1: number, // (used for type TWO_WIRE and FOUR_WIRE) + * motor2: number, // (used for type TWO_WIRE and FOUR_WIRE) + * motor3: number, // (used for type FOUR_WIRE) + * motor4: number, // (used for type FOUR_WIRE) + * } + * }); + * + * + * five.Stepper({ + * type: five.Stepper.TYPE.DRIVER, + * stepsPerRev: number, + * pins: { + * step: number, + * dir: number + * } + * }); + * + * five.Stepper({ + * type: five.Stepper.TYPE.DRIVER, + * stepsPerRev: number, + * pins: [ step, dir ] + * }); + * + * five.Stepper({ + * type: five.Stepper.TYPE.TWO_WIRE, + * stepsPerRev: number, + * pins: { + * motor1: number, + * motor2: number + * } + * }); + * + * five.Stepper({ + * type: five.Stepper.TYPE.TWO_WIRE, + * stepsPerRev: number, + * pins: [ motor1, motor2 ] + * }); + * + * five.Stepper({ + * type: five.Stepper.TYPE.FOUR_WIRE, + * stepsPerRev: number, + * pins: { + * motor1: number, + * motor2: number, + * motor3: number, + * motor4: number + * } + * }); + * + * five.Stepper({ + * type: five.Stepper.TYPE.FOUR_WIRE, + * stepsPerRev: number, + * pins: [ motor1, motor2, motor3, motor4 ] + * }); + * + * + * @param {Object} opts + * + */ + +function Stepper(opts) { + var state, params = []; + + if (!(this instanceof Stepper)) { + return new Stepper(opts); + } + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + if (!isSupported(this.io)) { + throw new Error( + "Stepper is not supported" + ); + } + + if (!opts.pins) { + throw new Error( + "Stepper requires a `pins` object or array" + ); + } + + if (!opts.stepsPerRev) { + throw new Error( + "Stepper requires a `stepsPerRev` number value" + ); + } + + steppers.set(this.board, steppers.get(this.board) || []); + this.id = steppers.get(this.board).length; + + if (this.id >= MAXSTEPPERS) { + throw new Error( + "Stepper cannot exceed max steppers (" + MAXSTEPPERS + ")" + ); + } + + // Convert an array of pins to the appropriate named pin + if (Array.isArray(this.pins)) { + if (this.pins.length === 2) { + // Using an array of 2 pins requres a TYPE + // to disambiguate DRIVER and TWO_WIRE + if (!opts.type) { + throw new Error( + "Stepper requires a `type` number value (DRIVER, TWO_WIRE)" + ); + } + } + + if (opts.type === Stepper.TYPE.DRIVER) { + this.pins = { + step: this.pins[0], + dir: this.pins[1] + }; + } else { + this.pins = new MotorPins(this.pins); + } + } + + // Attempt to guess the type if none is provided + if (!opts.type) { + if (this.pins.dir) { + opts.type = Stepper.TYPE.DRIVER; + } else { + if (this.pins.motor3) { + opts.type = Stepper.TYPE.FOUR_WIRE; + } else { + opts.type = Stepper.TYPE.TWO_WIRE; + } + } + } + + + // Initial Stepper config params (same for all 3 types) + params.push(this.id, opts.type, opts.stepsPerRev); + + + if (opts.type === Stepper.TYPE.DRIVER) { + if (typeof this.pins.dir === "undefined" || + typeof this.pins.step === "undefined") { + throw new Error( + "Stepper.TYPE.DRIVER expects: `pins.dir`, `pins.step`" + ); + } + + params.push( + this.pins.dir, this.pins.step + ); + } + + if (opts.type === Stepper.TYPE.TWO_WIRE) { + if (typeof this.pins.motor1 === "undefined" || + typeof this.pins.motor2 === "undefined") { + throw new Error( + "Stepper.TYPE.TWO_WIRE expects: `pins.motor1`, `pins.motor2`" + ); + } + + params.push( + this.pins.motor1, this.pins.motor2 + ); + } + + if (opts.type === Stepper.TYPE.FOUR_WIRE) { + if (typeof this.pins.motor1 === "undefined" || + typeof this.pins.motor2 === "undefined" || + typeof this.pins.motor3 === "undefined" || + typeof this.pins.motor4 === "undefined") { + throw new Error( + "Stepper.TYPE.FOUR_WIRE expects: `pins.motor1`, `pins.motor2`, `pins.motor3`, `pins.motor4`" + ); + } + + params.push( + this.pins.motor1, this.pins.motor2, this.pins.motor3, this.pins.motor4 + ); + } + + // Iterate the params and set each pin's mode to MODES.STEPPER + // Params: + // [deviceNum, type, stepsPerRev, dirOrMotor1Pin, stepOrMotor2Pin, motor3Pin, motor4Pin] + // The first 3 are required, the remaining 2-4 will be pins + params.slice(3).forEach(function(pin) { + this.io.pinMode(pin, this.io.MODES.STEPPER); + }, this); + + this.io.stepperConfig.apply(this.io, params); + + steppers.get(this.board).push(this); + + state = Step.PROPERTIES.reduce(function(state, key, i) { + return (state[key] = typeof opts[key] !== "undefined" ? opts[key] : Step.DEFAULTS[i], state); + }, { + isRunning: false, + type: opts.type, + pins: this.pins + }); + + priv.set(this, state); + + Object.defineProperties(this, { + type: { + get: function() { + return state.type; + } + }, + + pins: { + get: function() { + return state.pins; + } + } + }); +} + +Object.defineProperties(Stepper, { + TYPE: { + value: Object.freeze({ + DRIVER: 1, + TWO_WIRE: 2, + FOUR_WIRE: 4 + }) + }, + RUNSTATE: { + value: Object.freeze({ + STOP: 0, + ACCEL: 1, + DECEL: 2, + RUN: 3 + }) + }, + DIRECTION: { + value: Object.freeze({ + CCW: 0, + CW: 1 + }) + } +}); + +/** + * rpm + * + * Gets the rpm value or sets the rpm in revs per minute + * making an internal conversion to speed in `0.01 * rad/s` + * + * @param {Number} rpm Revs per minute + * + * NOTE: *rpm* is optional, if missing + * the method will behave like a getter + * + * @return {Stepper} this Chainable method when used as a setter + */ +Stepper.prototype.rpm = function(rpm) { + var state = priv.get(this); + + if (typeof rpm === "undefined") { + return state.rpm; + } + state.rpm = rpm; + state.speed = Math.round(rpm * TAU * 100 / 60); + return this; +}; + +/** + * speed + * + * Gets the speed value or sets the speed in `0.01 * rad/s` + * making an internal conversion to rpm + * + * @param {Number} speed Speed given in 0.01 * rad/s + * + * NOTE: *speed* is optional, if missing + * the method will behave like a getter + * + * @return {Stepper} this Chainable method when used as a setter + */ +Stepper.prototype.speed = function(speed) { + var state = priv.get(this); + + if (typeof speed === "undefined") { + return state.speed; + } + state.speed = speed; + state.rpm = Math.round(speed / TAU / 100 * 60); + return this; +}; + +["direction", "accel", "decel"].forEach(function(prop) { + Stepper.prototype[prop] = function(value) { + var state = priv.get(this); + + if (typeof value === "undefined") { + return state[prop]; + } + state[prop] = value; + return this; + }; +}); + +Stepper.prototype.ccw = function() { + return this.direction(0); +}; + +Stepper.prototype.cw = function() { + return this.direction(1); +}; + +/** + * step + * + * Move stepper motor a number of steps and call the callback on completion + * + * @param {Number} stepsOrOpts Steps to move using current settings for speed, accel, etc. + * @param {Object} stepsOrOpts Options object containing any of the following: + * stepsOrOpts = { + * steps: + * rpm: + * speed: + * direction: + * accel: + * decel: + * } + * + * NOTE: *steps* is required. + * + * @param {Function} callback function(err, complete) + */ +Stepper.prototype.step = function(stepsOrOpts, callback) { + var steps, step, state, params, isValidStep; + + steps = typeof stepsOrOpts === "object" ? + (stepsOrOpts.steps || 0) : Math.floor(stepsOrOpts); + + step = new Step(this); + + state = priv.get(this); + + params = []; + + isValidStep = true; + + function failback(error) { + isValidStep = false; + if (callback) { + callback(error); + } + } + + params.push(steps); + + if (typeof stepsOrOpts === "object") { + // If an object of property values has been provided, + // call the correlating method with the value argument. + Step.PROPERTIES.forEach(function(key) { + if (typeof stepsOrOpts[key] !== "undefined") { + this[key](stepsOrOpts[key]); + } + }, this); + } + + if (!state.speed) { + this.rpm(state.rpm); + step.speed = this.speed(); + } + + + // Ensure that the property params are set in the + // correct order, but without rpm + Step.PROPERTIES.slice(1).forEach(function(key) { + params.push(step[key] = this[key]()); + }, this); + + + if (steps === 0) { + failback( + new Error( + "Must set a number of steps when calling `step()`" + ) + ); + } + + if (step.direction < 0) { + failback( + new Error( + "Must set a direction before calling `step()`" + ) + ); + } + + if (isValidStep) { + state.isRunning = true; + + params.push(function(complete) { + state.isRunning = false; + callback(null, complete); + }); + + step.move.apply(step, params); + } + + return this; +}; + +Step.prototype.move = function(steps, dir, speed, accel, decel, callback) { + // Restore the param order... (steps, dir => dir, steps) + this.stepper.io.stepperStep.apply( + this.stepper.io, [this.stepper.id, dir, steps, speed, accel, decel, callback] + ); +}; + +module.exports = Stepper; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/switch.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/switch.js new file mode 100644 index 00000000..96296d9c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/switch.js @@ -0,0 +1,175 @@ +var Board = require("./board"); +var Collection = require("./mixins/collection"); +var Emitter = require("events").EventEmitter; +var Fn = require("./fn"); +var util = require("util"); + +var aliases = { + close: ["close", "closed", "on"], + open: ["open", "off"] +}; + + +/** + * Switch + * @constructor + * + * five.Switch(); + * + * five.Switch({ + * pin: 10 + * }); + * + * + * @param {Object} opts [description] + * + */ + +function Switch(opts) { + + if (!(this instanceof Switch)) { + return new Switch(opts); + } + + // Create a 5 ms debounce boundary on event triggers + // this avoids button events firing on + // press noise and false positives + var trigger = Fn.debounce(function(key) { + aliases[key].forEach(function(type) { + this.emit(type, null); + }, this); + }, 5); + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + // Resolve the default type to Normally Open + opts.type = opts.type || "NO"; + + // Is this instance Normally Open? + var isNormallyOpen = opts.type === "NO"; + var raw = null; + var invert = typeof opts.invert !== "undefined" ? + opts.invert : (isNormallyOpen || false); + + // Logical Defaults + var closeValue = 1; + var openValue = 0; + + if (invert) { + closeValue ^= 1; + openValue ^= 1; + } + + this.io.pinMode(this.pin, this.io.MODES.INPUT); + + if (isNormallyOpen) { + this.io.digitalWrite(this.pin, this.io.HIGH); + } + + this.io.digitalRead(this.pin, function(data) { + raw = data; + + trigger.call(this, this.isOpen ? "open" : "close"); + }.bind(this)); + + Object.defineProperties(this, { + value: { + get: function() { + return Number(this.isOpen); + } + }, + invert: { + get: function() { + return invert; + }, + set: function(value) { + invert = value; + closeValue = invert ? 0 : 1; + openValue = invert ? 1 : 0; + } + }, + closeValue: { + get: function() { + return closeValue; + }, + set: function(value) { + closeValue = value; + openValue = value ^ 1; + } + }, + openValue: { + get: function() { + return openValue; + }, + set: function(value) { + openValue = value; + closeValue = value ^ 1; + } + }, + isOpen: { + get: function() { + return raw === openValue; + } + }, + isClosed: { + get: function() { + return raw === closeValue; + } + }, + }); +} + +util.inherits(Switch, Emitter); + + +/** + * Fired when the Switch is close + * + * @event + * @name close + * @memberOf Switch + */ + + +/** + * Fired when the Switch is opened + * + * @event + * @name open + * @memberOf Switch + */ + + +/** + * Switches() + * new Switches() + * + * Constructs an Array-like instance of all servos + */ + +function Switches(numsOrObjects) { + if (!(this instanceof Switches)) { + return new Switches(numsOrObjects); + } + + Object.defineProperty(this, "type", { + value: Switch + }); + + Collection.Emitter.call(this, numsOrObjects); +} + +util.inherits(Switches, Collection.Emitter); + +Collection.installMethodForwarding( + Switches.prototype, Switch.prototype +); + +// Assign Switches Collection class as static "method" of Switch. +Switch.Collection = Switches; + + + +module.exports = Switch; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/thermometer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/thermometer.js new file mode 100644 index 00000000..37ce1548 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/thermometer.js @@ -0,0 +1,1072 @@ +var Emitter = require("events").EventEmitter; +var util = require("util"); + +var Board = require("./board"); +var Fn = require("./fn"); + +var toFixed = Fn.toFixed; + +var CELSIUS_TO_KELVIN = 273.15; + +function analogHandler(opts, dataHandler) { + var pin = opts.pin; + + this.io.pinMode(pin, this.io.MODES.ANALOG); + this.io.analogRead(pin, function(data) { + dataHandler.call(this, data); + }.bind(this)); +} + +var activeDrivers = new Map(); + +var Drivers = { + MAX31850K: { + initialize: { + value: function(board, opts) { + var CONSTANTS = { + TEMPERATURE_FAMILY: 0x3B, + CONVERT_TEMPERATURE_COMMAND: 0x44, + READ_SCRATCHPAD_COMMAND: 0xBE, + READ_COUNT: 9 + }, + pin = opts.pin, + freq = opts.freq || 100, + getAddress, readTemperature, isConversionAvailable, getAddresses, readOne; + + getAddress = function(device) { + // 64-bit device code + // device[0] => Family Code + // device[1..6] => Serial Number (device[1] is LSB) + // device[7] => CRC + var i, result = 0; + for (i = 6; i > 0; i--) { + result = result * 256 + device[i]; + } + return result; + }; + + board.io.sendOneWireConfig(pin, true); + board.io.sendOneWireSearch(pin, function(err, devices) { + if (err) { + this.emit("error", err); + return; + } + + this.devices = devices.filter(function(device) { + return device[0] === CONSTANTS.TEMPERATURE_FAMILY; + }, this); + + if (devices.length === 0) { + this.emit("error", new Error("FAILED TO FIND TEMPERATURE DEVICE")); + return; + } + + this.devices.forEach(function(device) { + this.emit("initialized", getAddress(device)); + }.bind(this)); + + getAddresses = function() { + if (this.addresses) { + return this.devices.filter(function(device) { + var address = getAddress(device); + return this.addresses.includes(address); + }, this); + } else { + return [this.devices[0]]; + } + }.bind(this); + + readTemperature = function() { + var devicesToWait, devicesToRead, result; + + // request tempeature conversion + devicesToWait = getAddresses(); + devicesToRead = getAddresses(); + + devicesToRead.forEach(function(device) { + board.io.sendOneWireReset(pin); + board.io.sendOneWireWrite(pin, device, CONSTANTS.CONVERT_TEMPERATURE_COMMAND); + }); + + isConversionAvailable = function(done) { + var nextDevice; + + if (devicesToWait.length === 0) { + return done(); + } + + nextDevice = devicesToWait.pop(); + + board.io.sendOneWireReset(pin); + + board.io.sendOneWireWriteAndRead(pin, nextDevice, CONSTANTS.READ_SCRATCHPAD_COMMAND, CONSTANTS.READ_COUNT, function(err, data) { + if (!data[0]) { + devicesToWait.push(nextDevice); + + if (data[1] !== 0) { //*****checks if second data bit is 0, if not its an error and gets thrown out + return done(); + } + } + + isConversionAvailable(done); + }); + }.bind(this); + + readOne = function() { + var device; + + if (devicesToRead.length === 0) { + setTimeout(readTemperature, freq); + return; + } + + device = devicesToRead.pop(); + // read from the scratchpad + board.io.sendOneWireReset(pin); + + board.io.sendOneWireWriteAndRead(pin, device, CONSTANTS.READ_SCRATCHPAD_COMMAND, CONSTANTS.READ_COUNT, function(err, data) { + if (err) { + this.emit("error", err); + return; + } + + result = (data[1] << 8) | data[0]; + this.emit("data", getAddress(device), result); + + readOne(); + }.bind(this)); + }.bind(this); + + isConversionAvailable(readOne); + }.bind(this); + + readTemperature(); + }.bind(this)); + } + }, + register: { + value: function(address) { + if (!this.addresses) { + this.addresses = []; + } + + this.addresses.push(address); + } + } + }, + DS18B20: { + initialize: { + value: function(board, opts) { + var CONSTANTS = { + TEMPERATURE_FAMILY: 0x28, + CONVERT_TEMPERATURE_COMMAND: 0x44, + READ_SCRATCHPAD_COMMAND: 0xBE, + READ_COUNT: 2 + }, + pin = opts.pin, + freq = opts.freq || 100, + getAddress, readThermometer, readOne; + + getAddress = function(device) { + // 64-bit device code + // device[0] => Family Code + // device[1..6] => Serial Number (device[1] is LSB) + // device[7] => CRC + var i, result = 0; + for (i = 6; i > 0; i--) { + result = result * 256 + device[i]; + } + return result; + }; + + board.io.sendOneWireConfig(pin, true); + board.io.sendOneWireSearch(pin, function(err, devices) { + if (err) { + this.emit("error", err); + return; + } + + this.devices = devices.filter(function(device) { + return device[0] === CONSTANTS.TEMPERATURE_FAMILY; + }, this); + + if (devices.length === 0) { + this.emit("error", new Error("FAILED TO FIND TEMPERATURE DEVICE")); + return; + } + + this.devices.forEach(function(device) { + this.emit("initialized", getAddress(device)); + }.bind(this)); + + readThermometer = function() { + var devicesToRead, result; + + // request tempeature conversion + if (this.addresses) { + devicesToRead = this.devices.filter(function(device) { + var address = getAddress(device); + return this.addresses.includes(address); + }, this); + } else { + devicesToRead = [this.devices[0]]; + } + + devicesToRead.forEach(function(device) { + board.io.sendOneWireReset(pin); + board.io.sendOneWireWrite(pin, device, CONSTANTS.CONVERT_TEMPERATURE_COMMAND); + }); + + // the delay gives the sensor time to do the calculation + board.io.sendOneWireDelay(pin, 1); + + readOne = function() { + var device; + + if (devicesToRead.length === 0) { + setTimeout(readThermometer, freq); + return; + } + + device = devicesToRead.pop(); + // read from the scratchpad + board.io.sendOneWireReset(pin); + + board.io.sendOneWireWriteAndRead(pin, device, CONSTANTS.READ_SCRATCHPAD_COMMAND, CONSTANTS.READ_COUNT, function(err, data) { + if (err) { + this.emit("error", err); + return; + } + + result = (data[1] << 8) | data[0]; + this.emit("data", getAddress(device), result); + + readOne(); + }.bind(this)); + }.bind(this); + + readOne(); + }.bind(this); + + readThermometer(); + }.bind(this)); + } + }, + register: { + value: function(address) { + if (!this.addresses) { + this.addresses = []; + } + + this.addresses.push(address); + } + } + } +}; + +Drivers.get = function(board, driverName, opts) { + var drivers, driver; + + if (!activeDrivers.has(board)) { + activeDrivers.set(board, {}); + } + + drivers = activeDrivers.get(board); + + var key = driverName + "_" + opts.pin; + + if (!drivers[key]) { + driver = new Emitter(); + Object.defineProperties(driver, Drivers[driverName]); + driver.initialize(board, opts); + drivers[key] = driver; + } + + return drivers[key]; +}; + +Drivers.clear = function() { + activeDrivers.clear(); +}; + +// References +// +var Controllers = { + // Generic thermistors. See datasheet for each device. + ANALOG: { + initialize: { + value: analogHandler + } + }, + + LM35: { + initialize: { + value: analogHandler + }, + toCelsius: { + value: function(raw) { + // VOUT = 1500 mV at 150°C + // VOUT = 250 mV at 25°C + // VOUT = –550 mV at –55°C + + var mV = this.aref * 1000 * raw / 1023; + + // 10mV = 1°C + // + // Page 1 + return Math.round(mV / 10); + } + } + }, + + LM335: { + initialize: { + value: analogHandler + }, + toCelsius: { + value: function(raw) { + // OUTPUT 10mV/°K + + var mV = this.aref * 1000 * raw / 1023; + + // Page 1 + return Math.round((mV / 10) - CELSIUS_TO_KELVIN); + } + } + }, + + TMP36: { + initialize: { + value: analogHandler + }, + toCelsius: { + value: function(raw) { + // Analog Reference Voltage + var mV = this.aref * 1000 * raw / 1023; + + // tempC = (mV / 10) - 50 + // + // Page 3 + // Table 1 + // Accuracy 1°C + return Math.round((mV / 10) - 50); + } + } + }, + + TMP102: { + ADDRESSES: { + value: [0x48] + }, + initialize: { + value: function(opts, dataHandler) { + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + this.io.i2cConfig(opts); + + // Addressing is unclear. + + this.io.i2cRead(address, 0x00, 2, function(data) { + // Based on the example code from https://www.sparkfun.com/products/11931 + var raw = ((data[0] << 8) | data[1]) >> 4; + + // The tmp102 does twos compliment but has the negative bit in the wrong spot, so test for it and correct if needed + if (raw & (1 << 11)) { + raw |= 0xF800; // Set bits 11 to 15 to 1s to get this reading into real twos compliment + } + + // twos compliment + raw = raw >> 15 ? ((raw ^ 0xFFFF) + 1) * -1 : raw; + + dataHandler(raw); + }); + } + }, + toCelsius: { + value: function(raw) { + // 6.5 Electrical Characteristics + // –25°C to 85°C ±0.5 + return toFixed(raw / 16, 1); + } + }, + }, + + MAX31850K: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this), + address = opts.address, + driver = Drivers.get(this.board, "MAX31850K", opts); + + if (address) { + state.address = address; + driver.register(address); + } else { + if (driver.addressless) { + this.emit("error", "You cannot have more than one MAX31850K without an address"); + } + driver.addressless = true; + } + + driver.once("initialized", function(dataAddress) { + if (!state.address) { + state.address = dataAddress; + } + }); + + driver.on("data", function(dataAddress, data) { + if (!address || dataAddress === address) { + dataHandler(data); + } + }.bind(this)); + } + }, + toCelsius: { + // Page 4 + // Thermocouple Temperature Data Resolution + value: function(raw) { + return toFixed(raw / 16, 2); + } + }, + address: { + get: function() { + return priv.get(this).address || 0x00; + } + } + }, + + // Based on code from Westin Pigott: + // https://github.com/westinpigott/one-wire-temps + // And the datasheet: + // OneWire protocol. The device needs to be issued a "Convert Temperature" + // command which can take up to 10 microseconds to compute, so we need + // tell the board to delay 1 millisecond before issuing the "Read Scratchpad" command + // + // This device requires the OneWire support enabled via ConfigurableFirmata + DS18B20: { + initialize: { + value: function(opts, dataHandler) { + var state = priv.get(this), + address = opts.address, + driver = Drivers.get(this.board, "DS18B20", opts); + + if (address) { + state.address = address; + driver.register(address); + } else { + if (driver.addressless) { + this.emit("error", "You cannot have more than one DS18B20 without an address"); + } + driver.addressless = true; + } + + driver.once("initialized", function(dataAddress) { + if (!state.address) { + state.address = dataAddress; + } + }); + + driver.on("data", function(dataAddress, data) { + if (!address || dataAddress === address) { + dataHandler(data); + } + }); + } + }, + toCelsius: { + value: function(raw) { + // ±0.5°C accuracy from -10°C to +85°C + // + // Temp resolution is as follows: + // 9b, 10b 11b, 12b + // 0.5°C, 0.25°C, 0.125°C, 0.0625°C + // + // I'm not sure which we're reading, so default to 4 + // fractional digits until we can verify + return toFixed(raw / 16, 4); + } + }, + address: { + get: function() { + return priv.get(this).address || 0x00; + } + } + }, + + + SHT31D: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "SHT31D", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 4, Table 1.2 Temperature Sensor Performance + // Resolution: 0.015 + // + // Page 14 + // 4.13 Conversion of Signal Output + // T[C] = -45 + 175 * (St / ((2 ** 26) - 1)) + // St = Sensor raw temperature + return toFixed((175 * raw / 65535) - 45, 3); + } + } + }, + + HTU21D: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "HTU21D", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 5 + // Digital Relative Humidity sensor with Temperature output + // Resolution shows 0.01-0.04 + // + // Page 15 + // CONVERSION OF SIGNAL OUTPUTS + // T = -46.85 + 175.72 * (Stemp / (2 ** 16)) + // Stemp = Sensor raw temperature + return toFixed((175.72 * raw / 65536) - 46.85, 2); + } + } + }, + HIH6130: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "HIH6130", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 3 + // 5.0 Calculation of Optional Temperature + // from the Digital Output + // + // -40 C = 0 + // 125 C = 2 ** 14 - 1 + return Math.round(raw / 1000); + } + } + }, + + DHT_I2C_NANO_BACKPACK: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "DHT_I2C_NANO_BACKPACK", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 2 + // 5. Product parameters + // Range: ... ±2°C + return Math.round(raw / 100); + } + } + }, + + TH02: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "TH02", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 8, Table 5 + // Temperature Sensor + // Accuracy Typical at 25 °C — ±0.5 ±1.0 °C + return toFixed(raw, 1); + } + } + }, + + MPU6050: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var driver = IMU.Drivers.get(this.board, "MPU6050", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // No sub-degree/fractional parts illustrated in datasheet + return Math.round((raw / 340.00) + 36.53); + } + } + }, + + BNO055: { + initialize: { + value: function(opts, dataHandler) { + var IMU = require("./imu"); + var driver = IMU.Drivers.get(this.board, "BNO055", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 37, Table 3-37 + // Temperature data representation + // 1°C = 1 LSB + // raw is already C + return Math.trunc(raw); + } + } + }, + + MPL115A2: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MPL115A2", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // No description, so removing fractional parts + return Math.trunc((raw - 498) / -5.35 + 25); + } + } + }, + + MPL3115A2: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MPL3115A2", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 5 + // Table 2 Mechanical Characteristics + // Accuracy @ 25 °C ±1°C + return Math.round(raw / 16); + } + } + }, + + MS5611: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "MS5611", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 1 + // TECHNICAL DATA + // Resolution <0.01 °C + return toFixed(raw, 2); + } + } + }, + + GROVE: { + initialize: { + value: analogHandler + }, + toCelsius: { + value: function(raw) { + // http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor + var adcres = 1023; + // Beta parameter + var beta = 3975; + // 10 kOhm (sensor resistance) + var rb = 10000; + // Ginf = 1/Rinf + // var ginf = 120.6685; + // Reference Temperature 25°C + var tempr = 298.15; + + var rthermistor = (adcres - raw) * rb / raw; + var tempc = 1 / (Math.log(rthermistor / rb) / beta + 1 / tempr) - CELSIUS_TO_KELVIN; + + return Math.round(tempc); + } + } + }, + + // MF52A103J3470 + TINKERKIT: { + initialize: { + value: analogHandler + }, + toCelsius: { + value: function(raw) { + var adcres = 1023; + var beta = 3950; + var rb = 10000; // 10 kOhm + var ginf = 120.6685; // Ginf = 1/Rinf + + var rthermistor = rb * (adcres / raw - 1); + var tempc = beta / (Math.log(rthermistor * ginf)); + + return Math.round(tempc - CELSIUS_TO_KELVIN); + } + } + }, + + BMP180: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BMP180", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 6, Table 1 + // Operating conditions, output signal and mechanical characteristics + // + // Resolution of output data + // pressure 0.01 hPa + // temperature 0.1 °C + return toFixed(raw, 1); + } + } + }, + + BMP280: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BMP280", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 8 + // + // Resolution of output data in ultra high resolution mode* + // Pressure 0.0016 hPa + // Temperature 0.01 °C + // + // * resolution mode is currently not configurable. + // + return toFixed(raw, 2); + } + } + }, + + BME280: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "BME280", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 23 + // Resolution is 0.01 DegC. + return toFixed(raw, 2); + } + } + }, + + SI7020: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "SI7020", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 9, Table 5. Temperature Sensor + // Accuracy1 –10 °C< tA < 85 °C — ±0.3 ±0.4 °C + // + // Page 23 + // (See temperature conversion expression) + return toFixed((175.72 * raw / 65536) - 46.85, 1); + } + } + }, + + MCP9808: { + ADDRESSES: { + value: [0x18] + }, + initialize: { + value: function(opts, dataHandler) { + var address = opts.address || this.ADDRESSES[0]; + + opts.address = address; + + this.io.i2cConfig(opts); + // Page 17 + // Register 0x05 = Ta (Temp, Ambient) + this.io.i2cRead(address, 0x05, 2, function(data) { + // Page 24 + // 5.1.3 AMBIENT TEMPERATURE REGISTER (TA) + var raw = (data[0] << 8) | data[1]; + + // Page 25 + raw = (raw & 0x0FFF) / 16; + + if (raw & 0x1000) { + raw -= 256; + } + dataHandler(raw); + }); + } + }, + toCelsius: { + value: function(raw) { + // Page 1 + // Microchip Technology Inc.s MCP9808 digital + // temperature sensor converts temperatures between + // -20°C and +100°C to a digital word with + // ±0.25°C/±0.5°C (typical/maximum) accuracy. + return toFixed(raw, 2); + } + }, + }, + + LSM303C: { + initialize: { + value: function(opts, dataHandler) { + var Multi = require("./imu"); + var driver = Multi.Drivers.get(this.board, "LSM303C", opts); + driver.on("data", function(data) { + dataHandler(data.temperature); + }); + } + }, + toCelsius: { + value: function(raw) { + // int16 resolution, 8 bits per C, 0 = 25 C + return toFixed((raw / 8) + 25, 1); + } + } + }, +}; + +Controllers.BMP085 = Controllers.BMP180; +Controllers.GY521 = Controllers.MPU6050; +Controllers.SI7021 = Controllers.SI7020; +Controllers.DHT11_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; +Controllers.DHT21_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; +Controllers.DHT22_I2C_NANO_BACKPACK = Controllers.DHT_I2C_NANO_BACKPACK; + + +var priv = new Map(); + +function Thermometer(opts) { + + if (!(this instanceof Thermometer)) { + return new Thermometer(opts); + } + + var controller = null; + var last = null; + var raw = null; + + Board.Component.call( + this, opts = Board.Options(opts) + ); + + // Analog Reference Voltage (default to board.io.aref || 5) + this.aref = opts.aref || this.io.aref || 5; + + if (opts.controller && typeof opts.controller === "string") { + controller = Controllers[opts.controller.toUpperCase()]; + } else { + controller = opts.controller; + } + + if (controller == null) { + controller = Controllers.ANALOG; + } + + var state = { + enabled: typeof opts.enabled === "undefined" ? true : opts.enabled, + intervalId: null, + freq: opts.freq || 25, + previousFreq: opts.freq || 25, + }; + priv.set(this, state); + + Board.Controller.call(this, controller, opts); + + if (!this.toCelsius) { + this.toCelsius = opts.toCelsius || function(x) { + return x; + }; + } + + // TODO: Move this out of the constructor + var eventProcessing = function() { + if (raw == null) { + return; + } + + var data = {}; + data.C = data.celsius = this.celsius; + data.F = data.fahrenheit = this.fahrenheit; + data.K = data.kelvin = this.kelvin; + + this.emit("data", data); + + if (this.celsius !== last) { + last = this.celsius; + this.emit("change", data); + } + }.bind(this); + + var descriptors = { + celsius: { + get: function() { + return this.toCelsius(raw); + } + }, + fahrenheit: { + get: function() { + return toFixed((this.celsius * 9 / 5) + 32, 2); + } + }, + kelvin: { + get: function() { + return toFixed(this.celsius + CELSIUS_TO_KELVIN, 2); + } + }, + freq: { + get: function() { + return state.freq; + }, + set: function(newFreq) { + state.freq = newFreq; + if (state.intervalId) { + clearInterval(state.intervalId); + } + + if (state.freq !== null) { + state.intervalId = setInterval(eventProcessing, newFreq); + } + } + }, + }; + // Convenience aliases + descriptors.C = descriptors.celsius; + descriptors.F = descriptors.fahrenheit; + descriptors.K = descriptors.kelvin; + + Object.defineProperties(this, descriptors); + + if (typeof this.initialize === "function") { + this.initialize(opts, function(data) { + raw = data; + }); + } + + // Set the freq property only after the get and set functions are defined + // and only if the sensor is not `enabled: false` + if (state.enabled) { + this.freq = state.freq; + } +} + +util.inherits(Thermometer, Emitter); + +/** + * enable Enable a disabled thermometer. + * + * @return {Object} instance + * + */ +Thermometer.prototype.enable = function() { + var state = priv.get(this); + + /* istanbul ignore else */ + if (!state.enabled) { + this.freq = state.freq || state.previousFreq; + } + + return this; +}; + +/** + * disable Disable an enabled thermometer. + * + * @return {Object} instance + * + */ +Thermometer.prototype.disable = function() { + var state = priv.get(this); + + /* istanbul ignore else */ + if (state.enabled) { + state.enabled = false; + state.previousFreq = state.freq; + this.freq = null; + } + + return this; +}; + +Thermometer.Drivers = Drivers; + +/* istanbul ignore else */ +if (!!process.env.IS_TEST_MODE) { + Thermometer.Controllers = Controllers; + Thermometer.purge = function() { + priv.clear(); + }; +} + +module.exports = Thermometer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/wii.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/wii.js new file mode 100644 index 00000000..34365f2a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/lib/wii.js @@ -0,0 +1,624 @@ +var Board = require("./board"), + events = require("events"), + util = require("util"); + +var Devices, Change, Update; + +// Event type alias map +var aliases = { + down: ["down", "press", "tap", "impact", "hit"], + up: ["up", "release"], + hold: ["hold"] +}; + +// all private instances +var priv = new Map(); + +// hold time out for buttons. +var holdTimeout = new Map(); + +// keeps data between cycles and fires change event +// if data changes +var last = new Map(); + + + + +/** + * Wii + * @constructor + * + * five.Wii({ + * device: "RVL-004", + * holdtime: ms before firing a hold event on a button, + * freq: ms to throttle the read data loop + * threshold: difference of change to qualify for a change event + * }); + * + * Available events: + * "data" - firehose. + * "down", "press", "tap", "impact", "hit" - button press + * "up", "release" - button release + * "hold" - button hold + * + * @param {Object} opts [description] + * + */ + +function Wii(opts) { + /* istanbul ignore if */ + if (!(this instanceof Wii)) { + return new Wii(opts); + } + + Board.Component.call(this, opts); + + // Derive device definition from Devices + var device = Devices[opts.device]; + var address = device.address; + var bytes = device.bytes; + var delay = device.delay; + var data = device.data.bind(this); + var setup = device.setup; + var preread = device.preread; + + // Wii controller instance properties + this.freq = opts.freq || 100; + + // Button instance properties + this.holdtime = opts.holdtime || 500; + this.threshold = opts.threshold || 10; + + // Initialize components + device.initialize.call(this); + + // Set initial "last data" byte array + last.set(this, [0, 0, 0, 0, 0, 0, 0]); + + // Set up I2C data connection + this.io.i2cConfig(opts); + + // Iterate and write each set of setup instructions + setup.forEach(function(bytes) { + this.io.i2cWrite(address, bytes); + }, this); + + // Unthrottled i2c read request loop + setInterval(function() { + + // Send this command to get all sensor data and store into + // the 6-byte register within Wii controller. + // This must be execute before reading data from the Wii. + + // Iterate and write each set of setup instructions + preread.forEach(function(bytes) { + this.io.i2cWrite(address, bytes); + }, this); + + + // Request six bytes of data from the controller + this.io.i2cReadOnce(address, bytes, data); + + // Use the high-frequency data read loop as the change event + // emitting loop. This drastically improves change event + // frequency and sensitivity + // + // Emit change events if any delta is greater than + // the threshold + + // RVL-005 does not have a read method at this time. + /* istanbul ignore else */ + if (typeof device.read !== "undefined") { + device.read.call(this); + } + }.bind(this), delay || this.freq); + + // Throttled "read" event loop + setInterval(function() { + var event = new Board.Event({ + target: this + }); + + this.emit("data", event); + + }.bind(this), this.freq); +} + +Wii.Components = {}; + +// A nunchuck button (c or z.) +Wii.Components.Button = function(which, controller) { + /* istanbul ignore if */ + if (!(this instanceof Wii.Components.Button)) { + return new Wii.Components.Button(which, controller); + } + + // c or z. + this.which = which; + + // reference to parent controller + this.controller = controller; + + // Set initial values for state tracking + var state = { + isDown: false + }; + priv.set(this, state); + + Object.defineProperties(this, { + // is the button up (not pressed)? + isUp: { + get: function() { + return !state.isDown; + } + }, + + // is the button pressed? + isDown: { + get: function() { + return state.isDown; + } + } + }); +}; + +Wii.Components.Joystick = function(controller) { + /* istanbul ignore if */ + if (!(this instanceof Wii.Components.Joystick)) { + return new Wii.Components.Joystick(controller); + } + + this.controller = controller; + + var state, accessors; + + // Initialize empty state object + state = {}; + + // Initialize empty accessors object + accessors = {}; + + // Enumerate Joystick properties + ["x", "y", "dx", "dy"].forEach(function(key) { + + state[key] = 0; + + // Define accessors for each property in Joystick list + accessors[key] = { + get: function() { + return state[key]; + } + }; + }, this); + + // Store private state cache + priv.set(this, state); + + // Register newly defined accessors + Object.defineProperties(this, accessors); +}; + +Wii.Components.Accelerometer = function(controller) { + /* istanbul ignore if */ + if (!(this instanceof Wii.Components.Accelerometer)) { + return new Wii.Components.Accelerometer(controller); + } + + this.controller = controller; + + var state, accessors; + + // Initialize empty state object + state = {}; + + // Initialize empty accessors object + accessors = {}; + + // Enumerate Joystick properties + ["x", "y", "z", "dx", "dy", "dz"].forEach(function(key) { + + state[key] = 0; + + // Define accessors for each property in Joystick list + accessors[key] = { + get: function() { + return state[key]; + } + }; + }, this); + + // Store private state cache + priv.set(this, state); + + // Register newly defined accessors + Object.defineProperties(this, accessors); +}; + +util.inherits(Wii, events.EventEmitter); +util.inherits(Wii.Components.Button, events.EventEmitter); +util.inherits(Wii.Components.Joystick, events.EventEmitter); +util.inherits(Wii.Components.Accelerometer, events.EventEmitter); + + +// Regular Wiimote driver bytes will be encoded 0x17 + +function decodeByte(x) { + return (x ^ 0x17) + 0x17; +} + +// Change handlers for disparate controller event types +// +// Note: Change.* methods are |this| sensitive, +// therefore, call sites must use: +// +// Change.button.call( instance, data ); +// +// Change.component.call( instance, data ); +// +// +Change = { + + // Fire a "down", "up" or "hold" (and aliases) event + // for a button context + button: function(key) { + // |this| is button context set by calling as: + // Change.button.call( button instance, event key ); + // + + // Enumerate all button event aliases, + // fire matching types + aliases[key].forEach(function(type) { + var event = new Board.Event({ + // |this| value is a button instance + target: this, + type: type + }); + + // fire button event on the button itself + this.emit(type, event); + + // fire button event on the controller + this.controller.emit(type, event); + }, this); + }, + + // Fire a "change" event on a component context + component: function(coordinate) { + // |this| is component context set by calling as: + // Change.component.call( component instance, coordinate, val ); + // + + ["axischange", "change"].forEach(function(type) { + var event; + + if (this._events && this._events[type]) { + event = new Board.Event({ + // |this| value is a button instance + target: this, + type: type, + axis: coordinate, + // Check dx/dy/dz change to determine direction + direction: this["d" + coordinate] < 0 ? -1 : 1 + }); + + // Fire change event on actual component + this.emit(type, event); + + // Fire change on controller + this.controller.emit(type, event); + } + }, this); + } +}; + +// Update handlers for disparate controller event types +// +// Note: Update.* methods are |this| sensitive, +// therefore, call sites must use: +// +// Update.button.call( button instance, boolean down ); +// +// Update.component.call( component instance, coordinate, val ); +// +// + +Update = { + // Set "down" state for button context. + button: function(isDown) { + // |this| is button context set by calling as: + // Update.button.call( button instance, boolean down ); + // + + var state, isFireable; + + // Derive state from private cache + state = priv.get(this); + + // if this is a state change, mark this + // change as fireable. + isFireable = false; + + if (isDown !== state.isDown) { + isFireable = true; + } + + state.isDown = isDown; + + if (isFireable) { + // start hold timeout for broadcasting hold. + holdTimeout.set(this, setTimeout(function() { + if (state.isDown) { + Change.button.call(this, "hold"); + } + }.bind(this), this.controller.holdtime)); + + Change.button.call(this, isDown ? "down" : "up"); + } + }, + + // Set "coordinate value" state for component context. + component: function(coordinate, val) { + // |this| is component context set by calling as: + // Update.component.call( component instance, coordinate, val ); + // + + var state = priv.get(this); + state["d" + coordinate] = val - state[coordinate]; + state[coordinate] = val; + } +}; + + +Devices = { + + // Nunchuk + "RVL-004": { + address: 0x52, + bytes: 6, + delay: 100, + setup: [ + [0x40, 0x00] + ], + preread: [ + [0x00] + ], + // device.read.call(this); + read: function() { + var axes = ["x", "y", "z"]; + + [ + this.joystick, + this.accelerometer + ].forEach(function(component) { + axes.forEach(function(axis) { + var delta = "d" + axis; + if (typeof component[delta] !== "undefined") { + if (Math.abs(component[delta]) > this.threshold) { + Change.component.call(component, axis); + } + } + }, this); + }, this); + }, + // Call as: + // device.initialize.call(this); + initialize: function() { + this.joystick = new Wii.Components.Joystick(this); + this.accelerometer = new Wii.Components.Accelerometer(this); + this.c = new Wii.Components.Button("c", this); + this.z = new Wii.Components.Button("z", this); + }, + data: function(data) { + // TODO: Shift state management to weakmap, this + // should only update an entry in the map + // + + if (data[0] !== 254 && data[1] !== 254 && data[2] !== 254) { + + // Byte 0x00 : X-axis data of the joystick + Update.component.call( + this.joystick, + "x", decodeByte(data[0]) << 2 + ); + + // Byte 0x01 : Y-axis data of the joystick + Update.component.call( + this.joystick, + "y", decodeByte(data[1]) << 2 + ); + + // Byte 0x02 : X-axis data of the accellerometer sensor + Update.component.call( + this.accelerometer, + "x", decodeByte(data[2]) << 2 + ); + + // Byte 0x03 : Y-axis data of the accellerometer sensor + Update.component.call( + this.accelerometer, + "y", decodeByte(data[3]) << 2 + ); + + // Byte 0x04 : Z-axis data of the accellerometer sensor + Update.component.call( + this.accelerometer, + "z", decodeByte(data[4]) << 2 + ); + + // Update Z button + // Grab the first bit of the sixth byte + Update.button.call( + this.z, (decodeByte(data[5]) & 0x01) === 0 + ); + + // Update C button + // Grab the second bit of the sixth byte + Update.button.call( + this.c, (decodeByte(data[5]) & 0x02) === 0 + ); + + // Update last data array cache + last.set(this, data); + } + } + }, + + // Classic Controller + "RVL-005": { + address: 0x52, + bytes: 6, + delay: 100, + setup: [ + [0x40, 0x00] + ], + preread: [ + [0x00] + ], + + // read: function( this ) { + // var axes = [ "x", "y", "z" ]; + + // [ this.joystick.left, this.joystick.right ].forEach(function( component ) { + // axes.forEach( function( axis ) { + // var delta = "d" + axis; + // if ( typeof component[ delta ] !== "undefined" ) { + // if ( Math.abs( component[ delta ] ) > this.threshold ) { + // Change.component.call( component, axis ); + // } + // } + // }, this ); + // }, this ); + // }, + initialize: function() { + + this.joystick = { + left: new Wii.Components.Joystick(this), + right: new Wii.Components.Joystick(this) + }; + + // obj.direction_pad = new Wii.DirectionPad( obj ); + [ + "y", "x", "up", "down", "left", "right", + "a", "b", "l", "r", "zl", "zr", "start", "home", "select" + ].forEach(function(id) { + + this[id] = new Wii.Components.Button(id, this); + + }, this); + }, + data: function(data) { + // TODO: Shift state management to weakmap, this + // should only update an entry in the map + if (data[0] !== 254 && data[1] !== 254 && data[2] !== 254) { + + // LEFT/RIGHT + Update.button.call( + this.l, (decodeByte(data[4]) & 0x20) === 0 + ); + + Update.button.call( + this.r, (decodeByte(data[4]) & 0x02) === 0 + ); + + // Direction + Update.button.call( + this.up, (decodeByte(data[5]) & 0x01) === 0 + ); + + Update.button.call( + this.left, (decodeByte(data[5]) & 0x02) === 0 + ); + + Update.button.call( + this.down, (decodeByte(data[4]) & 0x40) === 0 + ); + + Update.button.call( + this.right, (decodeByte(data[4]) & 0x80) === 0 + ); + + // Z* + Update.button.call( + this.zr, (decodeByte(data[5]) & 0x04) === 0 + ); + + Update.button.call( + this.zl, (decodeByte(data[5]) & 0x80) === 0 + ); + + // X/Y + Update.button.call( + this.x, (decodeByte(data[5]) & 0x08) === 0 + ); + + Update.button.call( + this.y, (decodeByte(data[5]) & 0x20) === 0 + ); + + // A/B + Update.button.call( + this.a, (decodeByte(data[5]) & 0x10) === 0 + ); + + Update.button.call( + this.b, (decodeByte(data[5]) & 0x40) === 0 + ); + + // MENU + Update.button.call( + this.select, (decodeByte(data[4]) & 0x10) === 0 + ); + + Update.button.call( + this.start, (decodeByte(data[4]) & 0x04) === 0 + ); + + Update.button.call( + this.home, (decodeByte(data[4]) & 0x08) === 0 + ); + + + Update.component.call( + this.joystick.left, + "x", decodeByte(data[0]) & 0x3f + ); + + // Byte 0x01 : Y-axis data of the joystick + Update.component.call( + this.joystick.left, + "y", decodeByte(data[0]) & 0x3f + ); + + Update.component.call( + this.joystick.right, + "x", ((data[0] & 0xc0) >> 3) + ((data[1] & 0xc0) >> 5) + ((data[2] & 0x80) >> 7) + ); + + Update.component.call( + this.joystick.right, + "y", data[2] & 0x1f + ); + + // Update last data array cache + last.set(this, data); + } + } + } +}; + + +Wii.Nunchuk = function(opts) { + opts = opts || {}; + opts.device = "RVL-004"; + + return new Wii(opts); +}; + +Wii.Classic = function(opts) { + opts = opts || {}; + opts.device = "RVL-005"; + + return new Wii(opts); +}; + +module.exports = Wii; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/package.json new file mode 100644 index 00000000..c57d5130 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five/package.json @@ -0,0 +1,220 @@ +{ + "_from": "johnny-five@^1.1.0", + "_id": "johnny-five@1.1.0", + "_inBundle": false, + "_integrity": "sha512-hvYdZs9jzb2BfjNXUW3jAx03FxC3udgE+u4XwfX8rz0gAEokmysX55lU+RHYudu/ph50nUib7O2+4e2G7PuIIg==", + "_location": "/node-red-contrib-johnny-five/johnny-five", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "johnny-five@^1.1.0", + "name": "johnny-five", + "escapedName": "johnny-five", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five" + ], + "_resolved": "https://registry.npmjs.org/johnny-five/-/johnny-five-1.1.0.tgz", + "_shasum": "26e75a296ccbc8767d8a1885a4d2fee7e0192e86", + "_spec": "johnny-five@^1.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five", + "author": { + "name": "Rick Waldron", + "email": "waldron.rick@gmail.com" + }, + "bugs": { + "url": "https://github.com/rwaldron/johnny-five/issues" + }, + "bundleDependencies": false, + "dependencies": { + "browser-serialport": "latest", + "chalk": "2.1.0", + "color-convert": "~1.2.2", + "ease-component": "latest", + "firmata": "^2.0.0", + "lodash.clonedeep": "^4.3.0", + "lodash.debounce": "^4.0.3", + "nanotimer": "0.3.10", + "serialport": "^7.1.5", + "temporal": "latest" + }, + "deprecated": false, + "description": "The JavaScript Robotics and Hardware Programming Framework. Use with: Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!", + "devDependencies": { + "async": "^2.6.1", + "common-tags": "^1.8.0", + "copy-paste": "^1.3.0", + "coveralls": "^3.0.2", + "grunt": "^1.0.3", + "grunt-cli": "^1.2.0", + "grunt-contrib-jshint": "^1.1.0", + "grunt-contrib-nodeunit": "^2.0.0", + "grunt-contrib-watch": "^1.1.0", + "grunt-jsbeautifier": "^0.2.13", + "grunt-jscs": "^3.0.1", + "keypress": "latest", + "mock-firmata": "latest", + "nyc": "^12.0.2", + "optimist": "^0.6.1", + "sinon": "~1.10.2" + }, + "homepage": "https://johnny-five.io", + "keywords": [ + "0A02", + "0A21", + "16x2 LCD", + "20x4 LCD", + "2D120X", + "2Y0A02", + "2Y0A21", + "74HC595", + "ADXL335", + "ADXL345", + "ALS-PT19", + "ALSPT19", + "ANALOG", + "arduino", + "Ardumoto", + "AT42QT1070", + "BLINKM", + "BMP180", + "Continuous Rotation", + "DEFAULT", + "Diffused LED", + "DS18B20", + "Edison Arduino Block", + "Edison GPIO Block", + "Edison I2C Block", + "Edison PWM Block", + "edison", + "ESPLORA", + "EV3", + "firmata", + "galileo-io", + "galileo", + "GP2D120XJ00F", + "GP2Y0A02YK0F", + "GP2Y0A21YK", + "GP2Y0A41SK0F", + "GY-521", + "GY521", + "HD44780", + "High Torque", + "Hitec HS-35HD", + "Hitec HS-422", + "Hitec HS-425BB", + "Hitec HS-625MG", + "Hitec HS-646WP", + "Hitec HS-755HB", + "Hitec HS-805BB", + "Hitec HS-85MG", + "HMC5883L", + "HMC6352", + "Hobby Motor", + "HRLV-MaxSonar-EZ0", + "HT16K33", + "HTU21D", + "i2c", + "Infrared Proximity Sensor", + "Infrared Sensor", + "intel edison", + "intel galileo", + "ISL29125", + "JHD1313M1", + "Joystick", + "Joystick", + "LCD1602", + "LCD2004", + "LCM1602", + "LED", + "LIDAR-Lite v2", + "Ludus Protoshield Wireless", + "Ludus Protoshield", + "LV-MaxSonar-EZ0", + "LV-MaxSonar-EZ3", + "MCP23008", + "MCP23017", + "MCP9808", + "Metal Gear", + "MJKDZ", + "MMA7361", + "MMA7660", + "MMA8462Q", + "MPL115A2", + "MPL3115A2", + "MPR121", + "MPR121QR2", + "MPU-6050", + "MPU6050", + "MUXSHIELD2", + "NXT", + "OA41SK", + "PARALLEL", + "particle", + "PCA9685", + "pcduino", + "PCF8574", + "PCF8574A", + "PCF8574AT", + "PCF8574T", + "PCF8575", + "PCF8591", + "photon", + "PIR Motion Sensor", + "QTOUCH", + "raspberry pi", + "raspberry pi", + "raspberrypi", + "raspi-io", + "RedBoard", + "RGB LED", + "robot", + "robotics", + "rpi", + "serial", + "serialport", + "Servo", + "Shift Register 8-Bit SN74HC595", + "Shift Register", + "SI7020", + "spark core", + "spark-io", + "spark", + "SparkFun Essential Sensor Kit", + "SparkFun Sensor Kit", + "Speed controller", + "Temperature", + "tessel 2", + "Thumb Joystick", + "TINKERKIT", + "TMP36", + "TSL2561", + "Ultrasonic Range Finder", + "usb", + "VKEY", + "Weather Shield Arduino", + "Weather Shield Photon" + ], + "license": "MIT", + "main": "lib/johnny-five", + "name": "johnny-five", + "optionalDependencies": { + "browser-serialport": "latest", + "firmata": "^2.0.0", + "serialport": "^7.1.5" + }, + "repository": { + "type": "git", + "url": "git://github.com/rwaldron/johnny-five.git" + }, + "scripts": { + "coveralls": "nyc --reporter=lcov grunt nodeunit && cat ./coverage/lcov.info | coveralls", + "test": "grunt", + "test-cover": "nyc grunt nodeunit" + }, + "version": "1.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js new file mode 100644 index 00000000..d5f66752 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/key_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/nested.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/nested.js new file mode 100644 index 00000000..9a672fc6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/nested.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/str.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/str.js new file mode 100644 index 00000000..9b4b3cd2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/str.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 6, b: [4,5], a: 3 }; +console.log(stringify(obj)); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js new file mode 100644 index 00000000..09f1c5f7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/example/value_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/index.js new file mode 100644 index 00000000..a6f40c7b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/index.js @@ -0,0 +1,82 @@ +module.exports = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var space = opts.space || ''; + if (typeof space === 'number') space = Array(space+1).join(' '); + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + var replacer = opts.replacer || function(key, value) { return value; }; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (parent, key, node, level) { + var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; + var colonSeparator = space ? ': ' : ':'; + + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + node = replacer.call(parent, key, node); + + if (node === undefined) { + return; + } + if (typeof node !== 'object' || node === null) { + return JSON.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + var item = stringify(node, i, node[i], level+1) || JSON.stringify(null); + out.push(indent + space + item); + } + return '[' + out.join(',') + indent + ']'; + } + else { + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + else seen.push(node); + + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node, key, node[key], level+1); + + if(!value) continue; + + var keyValue = JSON.stringify(key) + + colonSeparator + + value; + ; + out.push(indent + space + keyValue); + } + seen.splice(seen.indexOf(node), 1); + return '{' + out.join(',') + indent + '}'; + } + })({ '': obj }, '', obj, 0); +}; + +var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; +}; + +var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/package.json new file mode 100644 index 00000000..52c453ac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/package.json @@ -0,0 +1,72 @@ +{ + "_from": "json-stable-stringify-without-jsonify@^1.0.1", + "_id": "json-stable-stringify-without-jsonify@1.0.1", + "_inBundle": false, + "_integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "_location": "/node-red-contrib-johnny-five/json-stable-stringify-without-jsonify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "json-stable-stringify-without-jsonify@^1.0.1", + "name": "json-stable-stringify-without-jsonify", + "escapedName": "json-stable-stringify-without-jsonify", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/unique-stream" + ], + "_resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "_shasum": "9db7b59496ad3f3cfef30a75142d2d930ad72651", + "_spec": "json-stable-stringify-without-jsonify@^1.0.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/unique-stream", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/samn/json-stable-stringify/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies", + "devDependencies": { + "tape": "~1.0.4" + }, + "homepage": "https://github.com/samn/json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "sort", + "stable" + ], + "license": "MIT", + "main": "index.js", + "name": "json-stable-stringify-without-jsonify", + "repository": { + "type": "git", + "url": "git://github.com/samn/json-stable-stringify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "ff/5", + "ff/latest", + "chrome/15", + "chrome/latest", + "safari/latest", + "opera/latest" + ] + }, + "version": "1.0.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/readme.markdown b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/readme.markdown new file mode 100644 index 00000000..e95b468a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/readme.markdown @@ -0,0 +1,132 @@ +# json-stable-stringify + +This is the same as https://github.com/substack/json-stable-stringify but it doesn't depend on libraries without licenses (jsonify). + +deterministic version of `JSON.stringify()` so you can get a consistent hash +from stringified results + +You can also pass in a custom comparison function. + +[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify) + +[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify) + +# example + +``` js +var stringify = require('json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + +# methods + +``` js +var stringify = require('json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + +## options + +### cmp + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +### space + +If you specify `opts.space`, it will indent the output for pretty-printing. +Valid values are strings (e.g. `{space: \t}`) or a number of spaces +(`{space: 3}`). + +For example: + +```js +var obj = { b: 1, a: { foo: 'bar', and: [1, 2, 3] } }; +var s = stringify(obj, { space: ' ' }); +console.log(s); +``` + +which outputs: + +``` +{ + "a": { + "and": [ + 1, + 2, + 3 + ], + "foo": "bar" + }, + "b": 1 +} +``` + +### replacer + +The replacer parameter is a function `opts.replacer(key, value)` that behaves +the same as the replacer +[from the core JSON object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter). + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install json-stable-stringify +``` + +# license + +MIT diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/cmp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/cmp.js new file mode 100644 index 00000000..2dbb3935 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/cmp.js @@ -0,0 +1,11 @@ +var test = require('tape'); +var stringify = require('../'); + +test('custom comparison function', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; + }); + t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/nested.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/nested.js new file mode 100644 index 00000000..052c7d64 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/nested.js @@ -0,0 +1,42 @@ +var test = require('tape'); +var stringify = require('../'); + +test('nested', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); +}); + +test('cyclic (default)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + try { + stringify(one); + } catch (ex) { + t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); + } +}); + +test('cyclic (specifically allowed)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); +}); + +test('repeated non-cyclic value', function(t) { + t.plan(1); + var one = { x: 1 }; + var two = { a: one, b: one }; + t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); +}); + +test('acyclic but with reused obj-property pointers', function (t) { + t.plan(1); + var x = { a: 1 } + var y = { b: x, c: x } + t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}'); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/replacer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/replacer.js new file mode 100644 index 00000000..98802a72 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/replacer.js @@ -0,0 +1,74 @@ +var test = require('tape'); +var stringify = require('../'); + +test('replace root', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { return 'one'; }; + + t.equal(stringify(obj, { replacer: replacer }), '"one"'); +}); + +test('replace numbers', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(value === 1) return 'one'; + if(value === 2) return 'two'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":false}'); +}); + +test('replace with object', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(key === 'b') return { d: 1 }; + if(value === 1) return 'one'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":{"d":"one"},"c":false}'); +}); + +test('replace with undefined', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(value === false) return; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":2}'); +}); + +test('replace with array', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(key === 'b') return ['one', 'two']; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":["one","two"],"c":false}'); +}); + +test('replace array item', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: [1,2] }; + var replacer = function(key, value) { + if(value === 1) return 'one'; + if(value === 2) return 'two'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":["one","two"]}'); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/space.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/space.js new file mode 100644 index 00000000..2621122a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/space.js @@ -0,0 +1,59 @@ +var test = require('tape'); +var stringify = require('../'); + +test('space parameter', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: ' '}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": 2\n' + + '}' + ); +}); + +test('space parameter (with tabs)', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: '\t'}), '' + + '{\n' + + '\t"one": 1,\n' + + '\t"two": 2\n' + + '}' + ); +}); + +test('space parameter (with a number)', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: 3}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": 2\n' + + '}' + ); +}); + +test('space parameter (nested objects)', function (t) { + t.plan(1); + var obj = { one: 1, two: { b: 4, a: [2,3] } }; + t.equal(stringify(obj, {space: ' '}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": {\n' + + ' "a": [\n' + + ' 2,\n' + + ' 3\n' + + ' ],\n' + + ' "b": 4\n' + + ' }\n' + + '}' + ); +}); + +test('space parameter (same as native)', function (t) { + t.plan(1); + // for this test, properties need to be in alphabetical order + var obj = { one: 1, two: { a: [2,3], b: 4 } }; + t.equal(stringify(obj, {space: ' '}), JSON.stringify(obj, null, ' ')); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/str.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/str.js new file mode 100644 index 00000000..67426b99 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/str.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var stringify = require('../'); + +test('simple object', function (t) { + t.plan(1); + var obj = { c: 6, b: [4,5], a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); +}); + +test('object with undefined', function (t) { + t.plan(1); + var obj = { a: 3, z: undefined }; + t.equal(stringify(obj), '{"a":3}'); +}); + +test('array with undefined', function (t) { + t.plan(1); + var obj = [4, undefined, 6]; + t.equal(stringify(obj), '[4,null,6]'); +}); + +test('object with empty string', function (t) { + t.plan(1); + var obj = { a: 3, z: '' }; + t.equal(stringify(obj), '{"a":3,"z":""}'); +}); + +test('array with empty string', function (t) { + t.plan(1); + var obj = [4, '', 6]; + t.equal(stringify(obj), '[4,"",6]'); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/to-json.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/to-json.js new file mode 100644 index 00000000..ef9a9809 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/json-stable-stringify-without-jsonify/test/to-json.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var stringify = require('../'); + +test('toJSON function', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; + t.equal(stringify(obj), '{"one":1}' ); +}); + +test('toJSON returns string', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; + t.equal(stringify(obj), '"one"'); +}); + +test('toJSON returns array', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; + t.equal(stringify(obj), '["one"]'); +}); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/index.js new file mode 100644 index 00000000..bb44b791 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/index.js @@ -0,0 +1,85 @@ +/* eslint-disable no-nested-ternary */ +'use strict'; +var arr = []; +var charCodeCache = []; + +module.exports = function (a, b) { + if (a === b) { + return 0; + } + + var swap = a; + + // Swapping the strings if `a` is longer than `b` so we know which one is the + // shortest & which one is the longest + if (a.length > b.length) { + a = b; + b = swap; + } + + var aLen = a.length; + var bLen = b.length; + + if (aLen === 0) { + return bLen; + } + + if (bLen === 0) { + return aLen; + } + + // Performing suffix trimming: + // We can linearly drop suffix common to both strings since they + // don't increase distance at all + // Note: `~-` is the bitwise way to perform a `- 1` operation + while (aLen > 0 && (a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen))) { + aLen--; + bLen--; + } + + if (aLen === 0) { + return bLen; + } + + // Performing prefix trimming + // We can linearly drop prefix common to both strings since they + // don't increase distance at all + var start = 0; + + while (start < aLen && (a.charCodeAt(start) === b.charCodeAt(start))) { + start++; + } + + aLen -= start; + bLen -= start; + + if (aLen === 0) { + return bLen; + } + + var bCharCode; + var ret; + var tmp; + var tmp2; + var i = 0; + var j = 0; + + while (i < aLen) { + charCodeCache[start + i] = a.charCodeAt(start + i); + arr[i] = ++i; + } + + while (j < bLen) { + bCharCode = b.charCodeAt(start + j); + tmp = j++; + ret = j; + + for (i = 0; i < aLen; i++) { + tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1; + tmp = arr[i]; + ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2; + } + } + + return ret; +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/license b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/package.json new file mode 100644 index 00000000..8b84ff6d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/package.json @@ -0,0 +1,87 @@ +{ + "_from": "leven@^2.1.0", + "_id": "leven@2.1.0", + "_inBundle": false, + "_integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "_location": "/node-red-contrib-johnny-five/leven", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "leven@^2.1.0", + "name": "leven", + "escapedName": "leven", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/commist" + ], + "_resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "_shasum": "c2e7a9f772094dee9d34202ae8acce4687875580", + "_spec": "leven@^2.1.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/commist", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/leven/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Measure the difference between two strings using the fastest JS implementation of the Levenshtein distance algorithm", + "devDependencies": { + "ava": "^0.17.0", + "fast-levenshtein": "^2.0.5", + "ld": "^0.1.0", + "levdist": "^2.0.0", + "levenshtein": "^1.0.4", + "levenshtein-component": "0.0.1", + "levenshtein-edit-distance": "^2.0.0", + "matcha": "^0.7.0", + "natural": "^0.4.0", + "talisman": "^0.18.0", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/leven#readme", + "keywords": [ + "leven", + "levenshtein", + "distance", + "algorithm", + "algo", + "string", + "difference", + "diff", + "fast", + "fuzzy", + "similar", + "similarity", + "compare", + "comparison", + "edit", + "text", + "match", + "matching" + ], + "license": "MIT", + "name": "leven", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/leven.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && ava" + }, + "version": "2.1.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/readme.md new file mode 100644 index 00000000..9493c9f3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/leven/readme.md @@ -0,0 +1,50 @@ +# leven [![Build Status](https://travis-ci.org/sindresorhus/leven.svg?branch=master)](https://travis-ci.org/sindresorhus/leven) + +> Measure the difference between two strings
+> The fastest JS implementation of the [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance) algorithm + + +## Install + +``` +$ npm install --save leven +``` + + +## Usage + +```js +const leven = require('leven'); + +leven('cat', 'cow'); +//=> 2 +``` + + +## Benchmark + +``` +$ npm run bench +``` + +``` + 401,487 op/s » leven + 371,707 op/s » talisman + 264,191 op/s » levenshtein-edit-distance + 152,923 op/s » fast-levenshtein + 57,267 op/s » levenshtein-component + 19,915 op/s » levdist + 21,802 op/s » ld + 18,079 op/s » natural + 11,761 op/s » levenshtein +``` + + +## Related + +- [leven-cli](https://github.com/sindresorhus/leven-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/README.md new file mode 100644 index 00000000..fee48e47 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/README.md @@ -0,0 +1,18 @@ +# lodash.clonedeep v4.5.0 + +The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.clonedeep +``` + +In Node.js: +```js +var cloneDeep = require('lodash.clonedeep'); +``` + +See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/index.js new file mode 100644 index 00000000..1b0e5029 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/index.js @@ -0,0 +1,1748 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, true, true); +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = cloneDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/package.json new file mode 100644 index 00000000..abee2d07 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.clonedeep/package.json @@ -0,0 +1,69 @@ +{ + "_from": "lodash.clonedeep@^4.3.0", + "_id": "lodash.clonedeep@4.5.0", + "_inBundle": false, + "_integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "_location": "/node-red-contrib-johnny-five/lodash.clonedeep", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.clonedeep@^4.3.0", + "name": "lodash.clonedeep", + "escapedName": "lodash.clonedeep", + "rawSpec": "^4.3.0", + "saveSpec": null, + "fetchSpec": "^4.3.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/johnny-five" + ], + "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "_shasum": "e23f3f9c4f8fbdde872529c1071857a086e5ccef", + "_spec": "lodash.clonedeep@^4.3.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The lodash method `_.cloneDeep` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "clonedeep" + ], + "license": "MIT", + "name": "lodash.clonedeep", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.5.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/README.md new file mode 100644 index 00000000..52e638c7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/README.md @@ -0,0 +1,18 @@ +# lodash.debounce v4.0.8 + +The [lodash](https://lodash.com/) method `_.debounce` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.debounce +``` + +In Node.js: +```js +var debounce = require('lodash.debounce'); +``` + +See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/4.0.8-npm-packages/lodash.debounce) for more details. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/index.js new file mode 100644 index 00000000..ac5707d7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/index.js @@ -0,0 +1,377 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ +var now = function() { + return root.Date.now(); +}; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = debounce; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/package.json new file mode 100644 index 00000000..a4d3373e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.debounce/package.json @@ -0,0 +1,69 @@ +{ + "_from": "lodash.debounce@^4.0.3", + "_id": "lodash.debounce@4.0.8", + "_inBundle": false, + "_integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "_location": "/node-red-contrib-johnny-five/lodash.debounce", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.debounce@^4.0.3", + "name": "lodash.debounce", + "escapedName": "lodash.debounce", + "rawSpec": "^4.0.3", + "saveSpec": null, + "fetchSpec": "^4.0.3" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/johnny-five" + ], + "_resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "_shasum": "82d79bff30a67c4005ffd5e2515300ad9ca4d7af", + "_spec": "lodash.debounce@^4.0.3", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The lodash method `_.debounce` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "debounce" + ], + "license": "MIT", + "name": "lodash.debounce", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.8" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/README.md new file mode 100644 index 00000000..f614a298 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/README.md @@ -0,0 +1,18 @@ +# lodash.padend v4.6.1 + +The [lodash](https://lodash.com/) method `_.padEnd` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.padend +``` + +In Node.js: +```js +var padEnd = require('lodash.padend'); +``` + +See the [documentation](https://lodash.com/docs#padEnd) or [package source](https://github.com/lodash/lodash/blob/4.6.1-npm-packages/lodash.padend) for more details. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/index.js new file mode 100644 index 00000000..5fba18ad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/index.js @@ -0,0 +1,554 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +var asciiSize = baseProperty('length'); + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + result++; + } + return result; +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeFloor = Math.floor; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +/** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ +function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; +} + +module.exports = padEnd; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/package.json new file mode 100644 index 00000000..239fadc0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash.padend/package.json @@ -0,0 +1,69 @@ +{ + "_from": "lodash.padend@^4.6.1", + "_id": "lodash.padend@4.6.1", + "_inBundle": false, + "_integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", + "_location": "/node-red-contrib-johnny-five/lodash.padend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.padend@^4.6.1", + "name": "lodash.padend", + "escapedName": "lodash.padend", + "rawSpec": "^4.6.1", + "saveSpec": null, + "fetchSpec": "^4.6.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/node-led" + ], + "_resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", + "_shasum": "53ccba047d06e158d311f45da625f4e49e6f166e", + "_spec": "lodash.padend@^4.6.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/node-led", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The lodash method `_.padEnd` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "padend" + ], + "license": "MIT", + "name": "lodash.padend", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.6.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/LICENSE new file mode 100644 index 00000000..c6f2f614 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/LICENSE @@ -0,0 +1,47 @@ +Copyright JS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/README.md new file mode 100644 index 00000000..ba111a5a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/README.md @@ -0,0 +1,39 @@ +# lodash v4.17.11 + +The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. + +## Installation + +Using npm: +```shell +$ npm i -g npm +$ npm i --save lodash +``` + +In Node.js: +```js +// Load the full build. +var _ = require('lodash'); +// Load the core build. +var _ = require('lodash/core'); +// Load the FP build for immutable auto-curried iteratee-first data-last methods. +var fp = require('lodash/fp'); + +// Load method categories. +var array = require('lodash/array'); +var object = require('lodash/fp/object'); + +// Cherry-pick methods for smaller browserify/rollup/webpack bundles. +var at = require('lodash/at'); +var curryN = require('lodash/fp/curryN'); +``` + +See the [package source](https://github.com/lodash/lodash/tree/4.17.11-npm) for more details. + +**Note:**
+Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. + +## Support + +Tested in Chrome 68-69, Firefox 61-62, IE 11, Edge 17, Safari 10-11, Node.js 6-10, & PhantomJS 2.1.1.
+Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_DataView.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_DataView.js new file mode 100644 index 00000000..ac2d57ca --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_DataView.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Hash.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Hash.js new file mode 100644 index 00000000..b504fe34 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Hash.js @@ -0,0 +1,32 @@ +var hashClear = require('./_hashClear'), + hashDelete = require('./_hashDelete'), + hashGet = require('./_hashGet'), + hashHas = require('./_hashHas'), + hashSet = require('./_hashSet'); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_LazyWrapper.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_LazyWrapper.js new file mode 100644 index 00000000..81786c7f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_LazyWrapper.js @@ -0,0 +1,28 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ +function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; +} + +// Ensure `LazyWrapper` is an instance of `baseLodash`. +LazyWrapper.prototype = baseCreate(baseLodash.prototype); +LazyWrapper.prototype.constructor = LazyWrapper; + +module.exports = LazyWrapper; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_ListCache.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_ListCache.js new file mode 100644 index 00000000..26895c3a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_ListCache.js @@ -0,0 +1,32 @@ +var listCacheClear = require('./_listCacheClear'), + listCacheDelete = require('./_listCacheDelete'), + listCacheGet = require('./_listCacheGet'), + listCacheHas = require('./_listCacheHas'), + listCacheSet = require('./_listCacheSet'); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_LodashWrapper.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_LodashWrapper.js new file mode 100644 index 00000000..c1e4d9df --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_LodashWrapper.js @@ -0,0 +1,22 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ +function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; +} + +LodashWrapper.prototype = baseCreate(baseLodash.prototype); +LodashWrapper.prototype.constructor = LodashWrapper; + +module.exports = LodashWrapper; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Map.js new file mode 100644 index 00000000..b73f29a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Map.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_MapCache.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_MapCache.js new file mode 100644 index 00000000..4a4eea7b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_MapCache.js @@ -0,0 +1,32 @@ +var mapCacheClear = require('./_mapCacheClear'), + mapCacheDelete = require('./_mapCacheDelete'), + mapCacheGet = require('./_mapCacheGet'), + mapCacheHas = require('./_mapCacheHas'), + mapCacheSet = require('./_mapCacheSet'); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Promise.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Promise.js new file mode 100644 index 00000000..247b9e1b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Promise.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Set.js new file mode 100644 index 00000000..b3c8dcbf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Set.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_SetCache.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_SetCache.js new file mode 100644 index 00000000..6468b064 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_SetCache.js @@ -0,0 +1,27 @@ +var MapCache = require('./_MapCache'), + setCacheAdd = require('./_setCacheAdd'), + setCacheHas = require('./_setCacheHas'); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Stack.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Stack.js new file mode 100644 index 00000000..80b2cf1b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Stack.js @@ -0,0 +1,27 @@ +var ListCache = require('./_ListCache'), + stackClear = require('./_stackClear'), + stackDelete = require('./_stackDelete'), + stackGet = require('./_stackGet'), + stackHas = require('./_stackHas'), + stackSet = require('./_stackSet'); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Symbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Symbol.js new file mode 100644 index 00000000..a013f7c5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Symbol.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Uint8Array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Uint8Array.js new file mode 100644 index 00000000..2fb30e15 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_Uint8Array.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_WeakMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_WeakMap.js new file mode 100644 index 00000000..567f86c6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_WeakMap.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_apply.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_apply.js new file mode 100644 index 00000000..36436dda --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_apply.js @@ -0,0 +1,21 @@ +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayAggregator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayAggregator.js new file mode 100644 index 00000000..d96c3ca4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayAggregator.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; +} + +module.exports = arrayAggregator; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEach.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEach.js new file mode 100644 index 00000000..2c5f5796 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEach.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEachRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEachRight.js new file mode 100644 index 00000000..976ca5c2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEachRight.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEachRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEvery.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEvery.js new file mode 100644 index 00000000..e26a9184 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayEvery.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayFilter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayFilter.js new file mode 100644 index 00000000..75ea2544 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayFilter.js @@ -0,0 +1,25 @@ +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayIncludes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayIncludes.js new file mode 100644 index 00000000..3737a6d9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayIncludes.js @@ -0,0 +1,17 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayIncludesWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayIncludesWith.js new file mode 100644 index 00000000..235fd975 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayIncludesWith.js @@ -0,0 +1,22 @@ +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayLikeKeys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayLikeKeys.js new file mode 100644 index 00000000..b2ec9ce7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayLikeKeys.js @@ -0,0 +1,49 @@ +var baseTimes = require('./_baseTimes'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isIndex = require('./_isIndex'), + isTypedArray = require('./isTypedArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayMap.js new file mode 100644 index 00000000..22b22464 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayMap.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayPush.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayPush.js new file mode 100644 index 00000000..7d742b38 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayPush.js @@ -0,0 +1,20 @@ +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayReduce.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayReduce.js new file mode 100644 index 00000000..de8b79b2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayReduce.js @@ -0,0 +1,26 @@ +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +module.exports = arrayReduce; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayReduceRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayReduceRight.js new file mode 100644 index 00000000..22d8976d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayReduceRight.js @@ -0,0 +1,24 @@ +/** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; +} + +module.exports = arrayReduceRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySample.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySample.js new file mode 100644 index 00000000..fcab0105 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySample.js @@ -0,0 +1,15 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ +function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; +} + +module.exports = arraySample; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySampleSize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySampleSize.js new file mode 100644 index 00000000..8c7e364f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySampleSize.js @@ -0,0 +1,17 @@ +var baseClamp = require('./_baseClamp'), + copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); +} + +module.exports = arraySampleSize; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayShuffle.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayShuffle.js new file mode 100644 index 00000000..46313a39 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arrayShuffle.js @@ -0,0 +1,15 @@ +var copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); +} + +module.exports = arrayShuffle; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySome.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySome.js new file mode 100644 index 00000000..6fd02fd4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_arraySome.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiSize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiSize.js new file mode 100644 index 00000000..11d29c33 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiSize.js @@ -0,0 +1,12 @@ +var baseProperty = require('./_baseProperty'); + +/** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +var asciiSize = baseProperty('length'); + +module.exports = asciiSize; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiToArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiToArray.js new file mode 100644 index 00000000..8e3dd5b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiToArray.js @@ -0,0 +1,12 @@ +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +module.exports = asciiToArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiWords.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiWords.js new file mode 100644 index 00000000..d765f0f7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_asciiWords.js @@ -0,0 +1,15 @@ +/** Used to match words composed of alphanumeric characters. */ +var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + +/** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function asciiWords(string) { + return string.match(reAsciiWord) || []; +} + +module.exports = asciiWords; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assignMergeValue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assignMergeValue.js new file mode 100644 index 00000000..cb1185e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assignMergeValue.js @@ -0,0 +1,20 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignMergeValue; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assignValue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assignValue.js new file mode 100644 index 00000000..40839575 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assignValue.js @@ -0,0 +1,28 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assocIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assocIndexOf.js new file mode 100644 index 00000000..5b77a2bd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_assocIndexOf.js @@ -0,0 +1,21 @@ +var eq = require('./eq'); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAggregator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAggregator.js new file mode 100644 index 00000000..4bc9e91f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAggregator.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; +} + +module.exports = baseAggregator; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssign.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssign.js new file mode 100644 index 00000000..e5c4a1a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssign.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keys = require('./keys'); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssignIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssignIn.js new file mode 100644 index 00000000..6624f900 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssignIn.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keysIn = require('./keysIn'); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssignValue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssignValue.js new file mode 100644 index 00000000..d6f66ef3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAssignValue.js @@ -0,0 +1,25 @@ +var defineProperty = require('./_defineProperty'); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAt.js new file mode 100644 index 00000000..90e4237a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseAt.js @@ -0,0 +1,23 @@ +var get = require('./get'); + +/** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ +function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; +} + +module.exports = baseAt; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseClamp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseClamp.js new file mode 100644 index 00000000..a1c56929 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseClamp.js @@ -0,0 +1,22 @@ +/** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +module.exports = baseClamp; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseClone.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseClone.js new file mode 100644 index 00000000..6f73684f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseClone.js @@ -0,0 +1,171 @@ +var Stack = require('./_Stack'), + arrayEach = require('./_arrayEach'), + assignValue = require('./_assignValue'), + baseAssign = require('./_baseAssign'), + baseAssignIn = require('./_baseAssignIn'), + cloneBuffer = require('./_cloneBuffer'), + copyArray = require('./_copyArray'), + copySymbols = require('./_copySymbols'), + copySymbolsIn = require('./_copySymbolsIn'), + getAllKeys = require('./_getAllKeys'), + getAllKeysIn = require('./_getAllKeysIn'), + getTag = require('./_getTag'), + initCloneArray = require('./_initCloneArray'), + initCloneByTag = require('./_initCloneByTag'), + initCloneObject = require('./_initCloneObject'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isMap = require('./isMap'), + isObject = require('./isObject'), + isSet = require('./isSet'), + keys = require('./keys'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + + return result; + } + + if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + + return result; + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseConforms.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseConforms.js new file mode 100644 index 00000000..947e20d4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseConforms.js @@ -0,0 +1,18 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ +function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; +} + +module.exports = baseConforms; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseConformsTo.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseConformsTo.js new file mode 100644 index 00000000..e449cb84 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseConformsTo.js @@ -0,0 +1,27 @@ +/** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ +function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; +} + +module.exports = baseConformsTo; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseCreate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseCreate.js new file mode 100644 index 00000000..ffa6a52a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseCreate.js @@ -0,0 +1,30 @@ +var isObject = require('./isObject'); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseDelay.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseDelay.js new file mode 100644 index 00000000..1486d697 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseDelay.js @@ -0,0 +1,21 @@ +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ +function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); +} + +module.exports = baseDelay; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseDifference.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseDifference.js new file mode 100644 index 00000000..343ac19f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseDifference.js @@ -0,0 +1,67 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEach.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEach.js new file mode 100644 index 00000000..512c0676 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEach.js @@ -0,0 +1,14 @@ +var baseForOwn = require('./_baseForOwn'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEachRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEachRight.js new file mode 100644 index 00000000..0a8feeca --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEachRight.js @@ -0,0 +1,14 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEachRight = createBaseEach(baseForOwnRight, true); + +module.exports = baseEachRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEvery.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEvery.js new file mode 100644 index 00000000..fa52f7bc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseEvery.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseExtremum.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseExtremum.js new file mode 100644 index 00000000..9d6aa77e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseExtremum.js @@ -0,0 +1,32 @@ +var isSymbol = require('./isSymbol'); + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +module.exports = baseExtremum; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFill.js new file mode 100644 index 00000000..46ef9c76 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFill.js @@ -0,0 +1,32 @@ +var toInteger = require('./toInteger'), + toLength = require('./toLength'); + +/** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ +function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; +} + +module.exports = baseFill; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFilter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFilter.js new file mode 100644 index 00000000..46784773 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFilter.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFindIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFindIndex.js new file mode 100644 index 00000000..e3f5d8aa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFindIndex.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFindKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFindKey.js new file mode 100644 index 00000000..2e430f3a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFindKey.js @@ -0,0 +1,23 @@ +/** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ +function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; +} + +module.exports = baseFindKey; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFlatten.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFlatten.js new file mode 100644 index 00000000..4b1e009b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFlatten.js @@ -0,0 +1,38 @@ +var arrayPush = require('./_arrayPush'), + isFlattenable = require('./_isFlattenable'); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFor.js new file mode 100644 index 00000000..d946590f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFor.js @@ -0,0 +1,16 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForOwn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForOwn.js new file mode 100644 index 00000000..503d5234 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForOwn.js @@ -0,0 +1,16 @@ +var baseFor = require('./_baseFor'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForOwnRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForOwnRight.js new file mode 100644 index 00000000..a4b10e6c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForOwnRight.js @@ -0,0 +1,16 @@ +var baseForRight = require('./_baseForRight'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); +} + +module.exports = baseForOwnRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForRight.js new file mode 100644 index 00000000..32842cd8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseForRight.js @@ -0,0 +1,15 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseForRight = createBaseFor(true); + +module.exports = baseForRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFunctions.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFunctions.js new file mode 100644 index 00000000..d23bc9b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseFunctions.js @@ -0,0 +1,19 @@ +var arrayFilter = require('./_arrayFilter'), + isFunction = require('./isFunction'); + +/** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ +function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); +} + +module.exports = baseFunctions; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGet.js new file mode 100644 index 00000000..a194913d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGet.js @@ -0,0 +1,24 @@ +var castPath = require('./_castPath'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGetAllKeys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGetAllKeys.js new file mode 100644 index 00000000..8ad204ea --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGetAllKeys.js @@ -0,0 +1,20 @@ +var arrayPush = require('./_arrayPush'), + isArray = require('./isArray'); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGetTag.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGetTag.js new file mode 100644 index 00000000..b927ccc1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGetTag.js @@ -0,0 +1,28 @@ +var Symbol = require('./_Symbol'), + getRawTag = require('./_getRawTag'), + objectToString = require('./_objectToString'); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGt.js new file mode 100644 index 00000000..502d273c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseGt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +module.exports = baseGt; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseHas.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseHas.js new file mode 100644 index 00000000..1b730321 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseHas.js @@ -0,0 +1,19 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); +} + +module.exports = baseHas; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseHasIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseHasIn.js new file mode 100644 index 00000000..2e0d0426 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseHasIn.js @@ -0,0 +1,13 @@ +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInRange.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInRange.js new file mode 100644 index 00000000..ec956661 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInRange.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ +function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); +} + +module.exports = baseInRange; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIndexOf.js new file mode 100644 index 00000000..167e706e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIndexOf.js @@ -0,0 +1,20 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictIndexOf = require('./_strictIndexOf'); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIndexOfWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIndexOfWith.js new file mode 100644 index 00000000..f815fe0d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIndexOfWith.js @@ -0,0 +1,23 @@ +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIntersection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIntersection.js new file mode 100644 index 00000000..c1d250c2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIntersection.js @@ -0,0 +1,74 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInverter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInverter.js new file mode 100644 index 00000000..fbc337f0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInverter.js @@ -0,0 +1,21 @@ +var baseForOwn = require('./_baseForOwn'); + +/** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ +function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; +} + +module.exports = baseInverter; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInvoke.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInvoke.js new file mode 100644 index 00000000..49bcf3c3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseInvoke.js @@ -0,0 +1,24 @@ +var apply = require('./_apply'), + castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ +function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); +} + +module.exports = baseInvoke; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsArguments.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsArguments.js new file mode 100644 index 00000000..b3562cca --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsArguments.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsArrayBuffer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsArrayBuffer.js new file mode 100644 index 00000000..a2c4f30a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsArrayBuffer.js @@ -0,0 +1,17 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +var arrayBufferTag = '[object ArrayBuffer]'; + +/** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ +function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; +} + +module.exports = baseIsArrayBuffer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsDate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsDate.js new file mode 100644 index 00000000..ba67c785 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsDate.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var dateTag = '[object Date]'; + +/** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ +function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; +} + +module.exports = baseIsDate; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsEqual.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsEqual.js new file mode 100644 index 00000000..00a68a4f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsEqual.js @@ -0,0 +1,28 @@ +var baseIsEqualDeep = require('./_baseIsEqualDeep'), + isObjectLike = require('./isObjectLike'); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsEqualDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsEqualDeep.js new file mode 100644 index 00000000..e3cfd6a8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsEqualDeep.js @@ -0,0 +1,83 @@ +var Stack = require('./_Stack'), + equalArrays = require('./_equalArrays'), + equalByTag = require('./_equalByTag'), + equalObjects = require('./_equalObjects'), + getTag = require('./_getTag'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isTypedArray = require('./isTypedArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsMap.js new file mode 100644 index 00000000..02a4021c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsMap.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsMatch.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsMatch.js new file mode 100644 index 00000000..72494bed --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsMatch.js @@ -0,0 +1,62 @@ +var Stack = require('./_Stack'), + baseIsEqual = require('./_baseIsEqual'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsNaN.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsNaN.js new file mode 100644 index 00000000..316f1eb1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsNaN.js @@ -0,0 +1,12 @@ +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsNative.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsNative.js new file mode 100644 index 00000000..87023304 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsNative.js @@ -0,0 +1,47 @@ +var isFunction = require('./isFunction'), + isMasked = require('./_isMasked'), + isObject = require('./isObject'), + toSource = require('./_toSource'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsRegExp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsRegExp.js new file mode 100644 index 00000000..6cd7c1ae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsRegExp.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var regexpTag = '[object RegExp]'; + +/** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ +function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; +} + +module.exports = baseIsRegExp; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsSet.js new file mode 100644 index 00000000..6dee3671 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsSet.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsTypedArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsTypedArray.js new file mode 100644 index 00000000..1edb32ff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIsTypedArray.js @@ -0,0 +1,60 @@ +var baseGetTag = require('./_baseGetTag'), + isLength = require('./isLength'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIteratee.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIteratee.js new file mode 100644 index 00000000..995c2575 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseIteratee.js @@ -0,0 +1,31 @@ +var baseMatches = require('./_baseMatches'), + baseMatchesProperty = require('./_baseMatchesProperty'), + identity = require('./identity'), + isArray = require('./isArray'), + property = require('./property'); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseKeys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseKeys.js new file mode 100644 index 00000000..45e9e6f3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseKeys.js @@ -0,0 +1,30 @@ +var isPrototype = require('./_isPrototype'), + nativeKeys = require('./_nativeKeys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseKeysIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseKeysIn.js new file mode 100644 index 00000000..ea8a0a17 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseKeysIn.js @@ -0,0 +1,33 @@ +var isObject = require('./isObject'), + isPrototype = require('./_isPrototype'), + nativeKeysIn = require('./_nativeKeysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseLodash.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseLodash.js new file mode 100644 index 00000000..f76c790e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseLodash.js @@ -0,0 +1,10 @@ +/** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ +function baseLodash() { + // No operation performed. +} + +module.exports = baseLodash; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseLt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseLt.js new file mode 100644 index 00000000..8674d294 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseLt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ +function baseLt(value, other) { + return value < other; +} + +module.exports = baseLt; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMap.js new file mode 100644 index 00000000..0bf5cead --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMap.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'), + isArrayLike = require('./isArrayLike'); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMatches.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMatches.js new file mode 100644 index 00000000..e56582ad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMatches.js @@ -0,0 +1,22 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'), + matchesStrictComparable = require('./_matchesStrictComparable'); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMatchesProperty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMatchesProperty.js new file mode 100644 index 00000000..24afd893 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMatchesProperty.js @@ -0,0 +1,33 @@ +var baseIsEqual = require('./_baseIsEqual'), + get = require('./get'), + hasIn = require('./hasIn'), + isKey = require('./_isKey'), + isStrictComparable = require('./_isStrictComparable'), + matchesStrictComparable = require('./_matchesStrictComparable'), + toKey = require('./_toKey'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMean.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMean.js new file mode 100644 index 00000000..fa9e00a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMean.js @@ -0,0 +1,20 @@ +var baseSum = require('./_baseSum'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ +function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; +} + +module.exports = baseMean; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMerge.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMerge.js new file mode 100644 index 00000000..c5868f04 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMerge.js @@ -0,0 +1,42 @@ +var Stack = require('./_Stack'), + assignMergeValue = require('./_assignMergeValue'), + baseFor = require('./_baseFor'), + baseMergeDeep = require('./_baseMergeDeep'), + isObject = require('./isObject'), + keysIn = require('./keysIn'), + safeGet = require('./_safeGet'); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +module.exports = baseMerge; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMergeDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMergeDeep.js new file mode 100644 index 00000000..4679e8dc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseMergeDeep.js @@ -0,0 +1,94 @@ +var assignMergeValue = require('./_assignMergeValue'), + cloneBuffer = require('./_cloneBuffer'), + cloneTypedArray = require('./_cloneTypedArray'), + copyArray = require('./_copyArray'), + initCloneObject = require('./_initCloneObject'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLikeObject = require('./isArrayLikeObject'), + isBuffer = require('./isBuffer'), + isFunction = require('./isFunction'), + isObject = require('./isObject'), + isPlainObject = require('./isPlainObject'), + isTypedArray = require('./isTypedArray'), + safeGet = require('./_safeGet'), + toPlainObject = require('./toPlainObject'); + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +module.exports = baseMergeDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseNth.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseNth.js new file mode 100644 index 00000000..0403c2a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseNth.js @@ -0,0 +1,20 @@ +var isIndex = require('./_isIndex'); + +/** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ +function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; +} + +module.exports = baseNth; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseOrderBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseOrderBy.js new file mode 100644 index 00000000..d8a46ab2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseOrderBy.js @@ -0,0 +1,34 @@ +var arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseMap = require('./_baseMap'), + baseSortBy = require('./_baseSortBy'), + baseUnary = require('./_baseUnary'), + compareMultiple = require('./_compareMultiple'), + identity = require('./identity'); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePick.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePick.js new file mode 100644 index 00000000..09b458a6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePick.js @@ -0,0 +1,19 @@ +var basePickBy = require('./_basePickBy'), + hasIn = require('./hasIn'); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePickBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePickBy.js new file mode 100644 index 00000000..85be68c8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePickBy.js @@ -0,0 +1,30 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'), + castPath = require('./_castPath'); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseProperty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseProperty.js new file mode 100644 index 00000000..496281ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseProperty.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePropertyDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePropertyDeep.js new file mode 100644 index 00000000..1e5aae50 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePropertyDeep.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePropertyOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePropertyOf.js new file mode 100644 index 00000000..46173999 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePropertyOf.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = basePropertyOf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePullAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePullAll.js new file mode 100644 index 00000000..305720ed --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePullAll.js @@ -0,0 +1,51 @@ +var arrayMap = require('./_arrayMap'), + baseIndexOf = require('./_baseIndexOf'), + baseIndexOfWith = require('./_baseIndexOfWith'), + baseUnary = require('./_baseUnary'), + copyArray = require('./_copyArray'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ +function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; +} + +module.exports = basePullAll; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePullAt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePullAt.js new file mode 100644 index 00000000..c3e9e710 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_basePullAt.js @@ -0,0 +1,37 @@ +var baseUnset = require('./_baseUnset'), + isIndex = require('./_isIndex'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ +function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; +} + +module.exports = basePullAt; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRandom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRandom.js new file mode 100644 index 00000000..94f76a76 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRandom.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeRandom = Math.random; + +/** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ +function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); +} + +module.exports = baseRandom; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRange.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRange.js new file mode 100644 index 00000000..0fb8e419 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRange.js @@ -0,0 +1,28 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ +function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; +} + +module.exports = baseRange; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseReduce.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseReduce.js new file mode 100644 index 00000000..5a1f8b57 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseReduce.js @@ -0,0 +1,23 @@ +/** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ +function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; +} + +module.exports = baseReduce; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRepeat.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRepeat.js new file mode 100644 index 00000000..ee44c31a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRepeat.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +module.exports = baseRepeat; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRest.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRest.js new file mode 100644 index 00000000..d0dc4bdd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseRest.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSample.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSample.js new file mode 100644 index 00000000..58582b91 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSample.js @@ -0,0 +1,15 @@ +var arraySample = require('./_arraySample'), + values = require('./values'); + +/** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ +function baseSample(collection) { + return arraySample(values(collection)); +} + +module.exports = baseSample; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSampleSize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSampleSize.js new file mode 100644 index 00000000..5c90ec51 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSampleSize.js @@ -0,0 +1,18 @@ +var baseClamp = require('./_baseClamp'), + shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); +} + +module.exports = baseSampleSize; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSet.js new file mode 100644 index 00000000..612a24cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSet.js @@ -0,0 +1,47 @@ +var assignValue = require('./_assignValue'), + castPath = require('./_castPath'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSetData.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSetData.js new file mode 100644 index 00000000..c409947d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSetData.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + metaMap = require('./_metaMap'); + +/** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; +}; + +module.exports = baseSetData; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSetToString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSetToString.js new file mode 100644 index 00000000..89eaca38 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSetToString.js @@ -0,0 +1,22 @@ +var constant = require('./constant'), + defineProperty = require('./_defineProperty'), + identity = require('./identity'); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseShuffle.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseShuffle.js new file mode 100644 index 00000000..023077ac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseShuffle.js @@ -0,0 +1,15 @@ +var shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function baseShuffle(collection) { + return shuffleSelf(values(collection)); +} + +module.exports = baseShuffle; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSlice.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSlice.js new file mode 100644 index 00000000..786f6c99 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSlice.js @@ -0,0 +1,31 @@ +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSome.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSome.js new file mode 100644 index 00000000..58f3f447 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSome.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortBy.js new file mode 100644 index 00000000..a25c92ed --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortBy.js @@ -0,0 +1,21 @@ +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedIndex.js new file mode 100644 index 00000000..638c366c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedIndex.js @@ -0,0 +1,42 @@ +var baseSortedIndexBy = require('./_baseSortedIndexBy'), + identity = require('./identity'), + isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + +/** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); +} + +module.exports = baseSortedIndex; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedIndexBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedIndexBy.js new file mode 100644 index 00000000..bb22e36d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedIndexBy.js @@ -0,0 +1,64 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeMin = Math.min; + +/** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); +} + +module.exports = baseSortedIndexBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedUniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedUniq.js new file mode 100644 index 00000000..802159a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSortedUniq.js @@ -0,0 +1,30 @@ +var eq = require('./eq'); + +/** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; +} + +module.exports = baseSortedUniq; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSum.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSum.js new file mode 100644 index 00000000..a9e84c13 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseSum.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ +function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; +} + +module.exports = baseSum; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseTimes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseTimes.js new file mode 100644 index 00000000..0603fc37 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseTimes.js @@ -0,0 +1,20 @@ +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToNumber.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToNumber.js new file mode 100644 index 00000000..04859f39 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToNumber.js @@ -0,0 +1,24 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ +function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; +} + +module.exports = baseToNumber; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToPairs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToPairs.js new file mode 100644 index 00000000..bff19912 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToPairs.js @@ -0,0 +1,18 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToString.js new file mode 100644 index 00000000..ada6ad29 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseToString.js @@ -0,0 +1,37 @@ +var Symbol = require('./_Symbol'), + arrayMap = require('./_arrayMap'), + isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUnary.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUnary.js new file mode 100644 index 00000000..98639e92 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUnary.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUniq.js new file mode 100644 index 00000000..aea459dc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUniq.js @@ -0,0 +1,72 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + cacheHas = require('./_cacheHas'), + createSet = require('./_createSet'), + setToArray = require('./_setToArray'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseUniq; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUnset.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUnset.js new file mode 100644 index 00000000..eefc6e37 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUnset.js @@ -0,0 +1,20 @@ +var castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUpdate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUpdate.js new file mode 100644 index 00000000..92a62377 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseUpdate.js @@ -0,0 +1,18 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'); + +/** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); +} + +module.exports = baseUpdate; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseValues.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseValues.js new file mode 100644 index 00000000..b95faadc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseValues.js @@ -0,0 +1,19 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseWhile.js new file mode 100644 index 00000000..07eac61b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseWhile.js @@ -0,0 +1,26 @@ +var baseSlice = require('./_baseSlice'); + +/** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ +function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); +} + +module.exports = baseWhile; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseWrapperValue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseWrapperValue.js new file mode 100644 index 00000000..443e0df5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseWrapperValue.js @@ -0,0 +1,25 @@ +var LazyWrapper = require('./_LazyWrapper'), + arrayPush = require('./_arrayPush'), + arrayReduce = require('./_arrayReduce'); + +/** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ +function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); +} + +module.exports = baseWrapperValue; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseXor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseXor.js new file mode 100644 index 00000000..8e69338b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseXor.js @@ -0,0 +1,36 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseUniq = require('./_baseUniq'); + +/** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ +function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); +} + +module.exports = baseXor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseZipObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseZipObject.js new file mode 100644 index 00000000..401f85be --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_baseZipObject.js @@ -0,0 +1,23 @@ +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cacheHas.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cacheHas.js new file mode 100644 index 00000000..2dec8926 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cacheHas.js @@ -0,0 +1,13 @@ +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castArrayLikeObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castArrayLikeObject.js new file mode 100644 index 00000000..92c75fa1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castArrayLikeObject.js @@ -0,0 +1,14 @@ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castFunction.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castFunction.js new file mode 100644 index 00000000..98c91ae6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castFunction.js @@ -0,0 +1,14 @@ +var identity = require('./identity'); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castPath.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castPath.js new file mode 100644 index 00000000..017e4c1b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castPath.js @@ -0,0 +1,21 @@ +var isArray = require('./isArray'), + isKey = require('./_isKey'), + stringToPath = require('./_stringToPath'), + toString = require('./toString'); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castRest.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castRest.js new file mode 100644 index 00000000..213c66f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castRest.js @@ -0,0 +1,14 @@ +var baseRest = require('./_baseRest'); + +/** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +var castRest = baseRest; + +module.exports = castRest; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castSlice.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castSlice.js new file mode 100644 index 00000000..071faeba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_castSlice.js @@ -0,0 +1,18 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +module.exports = castSlice; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_charsEndIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_charsEndIndex.js new file mode 100644 index 00000000..07908ff3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_charsEndIndex.js @@ -0,0 +1,19 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsEndIndex; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_charsStartIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_charsStartIndex.js new file mode 100644 index 00000000..b17afd25 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_charsStartIndex.js @@ -0,0 +1,20 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ +function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsStartIndex; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneArrayBuffer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneArrayBuffer.js new file mode 100644 index 00000000..c3d8f6e3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneArrayBuffer.js @@ -0,0 +1,16 @@ +var Uint8Array = require('./_Uint8Array'); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneBuffer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneBuffer.js new file mode 100644 index 00000000..27c48109 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneBuffer.js @@ -0,0 +1,35 @@ +var root = require('./_root'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneDataView.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneDataView.js new file mode 100644 index 00000000..9c9b7b05 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneDataView.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneRegExp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneRegExp.js new file mode 100644 index 00000000..64a30dfb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneRegExp.js @@ -0,0 +1,17 @@ +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneSymbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneSymbol.js new file mode 100644 index 00000000..bede39f5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneSymbol.js @@ -0,0 +1,18 @@ +var Symbol = require('./_Symbol'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneTypedArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneTypedArray.js new file mode 100644 index 00000000..7aad84d4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_cloneTypedArray.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_compareAscending.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_compareAscending.js new file mode 100644 index 00000000..8dc27910 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_compareAscending.js @@ -0,0 +1,41 @@ +var isSymbol = require('./isSymbol'); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_compareMultiple.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_compareMultiple.js new file mode 100644 index 00000000..ad61f0fb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_compareMultiple.js @@ -0,0 +1,44 @@ +var compareAscending = require('./_compareAscending'); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_composeArgs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_composeArgs.js new file mode 100644 index 00000000..1ce40f4f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_composeArgs.js @@ -0,0 +1,39 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; +} + +module.exports = composeArgs; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_composeArgsRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_composeArgsRight.js new file mode 100644 index 00000000..8dc588d0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_composeArgsRight.js @@ -0,0 +1,41 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; +} + +module.exports = composeArgsRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copyArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copyArray.js new file mode 100644 index 00000000..cd94d5d0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copyArray.js @@ -0,0 +1,20 @@ +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copyObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copyObject.js new file mode 100644 index 00000000..2f2a5c23 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copyObject.js @@ -0,0 +1,40 @@ +var assignValue = require('./_assignValue'), + baseAssignValue = require('./_baseAssignValue'); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copySymbols.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copySymbols.js new file mode 100644 index 00000000..c35944ab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copySymbols.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbols = require('./_getSymbols'); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copySymbolsIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copySymbolsIn.js new file mode 100644 index 00000000..fdf20a73 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_copySymbolsIn.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbolsIn = require('./_getSymbolsIn'); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_coreJsData.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_coreJsData.js new file mode 100644 index 00000000..f8e5b4e3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_coreJsData.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_countHolders.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_countHolders.js new file mode 100644 index 00000000..718fcdaa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_countHolders.js @@ -0,0 +1,21 @@ +/** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ +function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; +} + +module.exports = countHolders; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createAggregator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createAggregator.js new file mode 100644 index 00000000..0be42c41 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createAggregator.js @@ -0,0 +1,23 @@ +var arrayAggregator = require('./_arrayAggregator'), + baseAggregator = require('./_baseAggregator'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ +function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; +} + +module.exports = createAggregator; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createAssigner.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createAssigner.js new file mode 100644 index 00000000..1f904c51 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createAssigner.js @@ -0,0 +1,37 @@ +var baseRest = require('./_baseRest'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBaseEach.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBaseEach.js new file mode 100644 index 00000000..d24fdd1b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBaseEach.js @@ -0,0 +1,32 @@ +var isArrayLike = require('./isArrayLike'); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBaseFor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBaseFor.js new file mode 100644 index 00000000..94cbf297 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBaseFor.js @@ -0,0 +1,25 @@ +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBind.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBind.js new file mode 100644 index 00000000..07cb99f4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createBind.js @@ -0,0 +1,28 @@ +var createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} + +module.exports = createBind; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCaseFirst.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCaseFirst.js new file mode 100644 index 00000000..fe8ea483 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCaseFirst.js @@ -0,0 +1,33 @@ +var castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringToArray = require('./_stringToArray'), + toString = require('./toString'); + +/** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ +function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; +} + +module.exports = createCaseFirst; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCompounder.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCompounder.js new file mode 100644 index 00000000..8d4cee2c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCompounder.js @@ -0,0 +1,24 @@ +var arrayReduce = require('./_arrayReduce'), + deburr = require('./deburr'), + words = require('./words'); + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]"; + +/** Used to match apostrophes. */ +var reApos = RegExp(rsApos, 'g'); + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; +} + +module.exports = createCompounder; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCtor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCtor.js new file mode 100644 index 00000000..9047aa5f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCtor.js @@ -0,0 +1,37 @@ +var baseCreate = require('./_baseCreate'), + isObject = require('./isObject'); + +/** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ +function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; +} + +module.exports = createCtor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCurry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCurry.js new file mode 100644 index 00000000..f06c2cdd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createCurry.js @@ -0,0 +1,46 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + createHybrid = require('./_createHybrid'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; +} + +module.exports = createCurry; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createFind.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createFind.js new file mode 100644 index 00000000..8859ff89 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createFind.js @@ -0,0 +1,25 @@ +var baseIteratee = require('./_baseIteratee'), + isArrayLike = require('./isArrayLike'), + keys = require('./keys'); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createFlow.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createFlow.js new file mode 100644 index 00000000..baaddbf5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createFlow.js @@ -0,0 +1,78 @@ +var LodashWrapper = require('./_LodashWrapper'), + flatRest = require('./_flatRest'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + isArray = require('./isArray'), + isLaziable = require('./_isLaziable'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ +function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); +} + +module.exports = createFlow; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createHybrid.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createHybrid.js new file mode 100644 index 00000000..b671bd11 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createHybrid.js @@ -0,0 +1,92 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + countHolders = require('./_countHolders'), + createCtor = require('./_createCtor'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + reorder = require('./_reorder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_ARY_FLAG = 128, + WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; +} + +module.exports = createHybrid; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createInverter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createInverter.js new file mode 100644 index 00000000..6c0c5629 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createInverter.js @@ -0,0 +1,17 @@ +var baseInverter = require('./_baseInverter'); + +/** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ +function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; +} + +module.exports = createInverter; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createMathOperation.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createMathOperation.js new file mode 100644 index 00000000..f1e238ac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createMathOperation.js @@ -0,0 +1,38 @@ +var baseToNumber = require('./_baseToNumber'), + baseToString = require('./_baseToString'); + +/** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ +function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; +} + +module.exports = createMathOperation; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createOver.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createOver.js new file mode 100644 index 00000000..3b945516 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createOver.js @@ -0,0 +1,27 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + baseUnary = require('./_baseUnary'), + flatRest = require('./_flatRest'); + +/** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ +function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); +} + +module.exports = createOver; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createPadding.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createPadding.js new file mode 100644 index 00000000..2124612b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createPadding.js @@ -0,0 +1,33 @@ +var baseRepeat = require('./_baseRepeat'), + baseToString = require('./_baseToString'), + castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringSize = require('./_stringSize'), + stringToArray = require('./_stringToArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +module.exports = createPadding; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createPartial.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createPartial.js new file mode 100644 index 00000000..e16c248b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createPartial.js @@ -0,0 +1,43 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ +function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; +} + +module.exports = createPartial; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRange.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRange.js new file mode 100644 index 00000000..9f52c779 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRange.js @@ -0,0 +1,30 @@ +var baseRange = require('./_baseRange'), + isIterateeCall = require('./_isIterateeCall'), + toFinite = require('./toFinite'); + +/** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ +function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; +} + +module.exports = createRange; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRecurry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRecurry.js new file mode 100644 index 00000000..eb29fb24 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRecurry.js @@ -0,0 +1,56 @@ +var isLaziable = require('./_isLaziable'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); +} + +module.exports = createRecurry; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRelationalOperation.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRelationalOperation.js new file mode 100644 index 00000000..a17c6b5e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRelationalOperation.js @@ -0,0 +1,20 @@ +var toNumber = require('./toNumber'); + +/** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ +function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; +} + +module.exports = createRelationalOperation; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRound.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRound.js new file mode 100644 index 00000000..bf9b713f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createRound.js @@ -0,0 +1,33 @@ +var toInteger = require('./toInteger'), + toNumber = require('./toNumber'), + toString = require('./toString'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; +} + +module.exports = createRound; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createSet.js new file mode 100644 index 00000000..0f644eea --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createSet.js @@ -0,0 +1,19 @@ +var Set = require('./_Set'), + noop = require('./noop'), + setToArray = require('./_setToArray'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +module.exports = createSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createToPairs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createToPairs.js new file mode 100644 index 00000000..568417af --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createToPairs.js @@ -0,0 +1,30 @@ +var baseToPairs = require('./_baseToPairs'), + getTag = require('./_getTag'), + mapToArray = require('./_mapToArray'), + setToPairs = require('./_setToPairs'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createWrap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createWrap.js new file mode 100644 index 00000000..33f0633e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_createWrap.js @@ -0,0 +1,106 @@ +var baseSetData = require('./_baseSetData'), + createBind = require('./_createBind'), + createCurry = require('./_createCurry'), + createHybrid = require('./_createHybrid'), + createPartial = require('./_createPartial'), + getData = require('./_getData'), + mergeData = require('./_mergeData'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'), + toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); +} + +module.exports = createWrap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customDefaultsAssignIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customDefaultsAssignIn.js new file mode 100644 index 00000000..1f49e6fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customDefaultsAssignIn.js @@ -0,0 +1,29 @@ +var eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ +function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; +} + +module.exports = customDefaultsAssignIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customDefaultsMerge.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customDefaultsMerge.js new file mode 100644 index 00000000..4cab3175 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customDefaultsMerge.js @@ -0,0 +1,28 @@ +var baseMerge = require('./_baseMerge'), + isObject = require('./isObject'); + +/** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ +function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; +} + +module.exports = customDefaultsMerge; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customOmitClone.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customOmitClone.js new file mode 100644 index 00000000..968db2ef --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_customOmitClone.js @@ -0,0 +1,16 @@ +var isPlainObject = require('./isPlainObject'); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_deburrLetter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_deburrLetter.js new file mode 100644 index 00000000..3e531edc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_deburrLetter.js @@ -0,0 +1,71 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map Latin Unicode letters to basic Latin letters. */ +var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' +}; + +/** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ +var deburrLetter = basePropertyOf(deburredLetters); + +module.exports = deburrLetter; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_defineProperty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_defineProperty.js new file mode 100644 index 00000000..b6116d92 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_defineProperty.js @@ -0,0 +1,11 @@ +var getNative = require('./_getNative'); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalArrays.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalArrays.js new file mode 100644 index 00000000..f6a3b7c9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalArrays.js @@ -0,0 +1,83 @@ +var SetCache = require('./_SetCache'), + arraySome = require('./_arraySome'), + cacheHas = require('./_cacheHas'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalByTag.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalByTag.js new file mode 100644 index 00000000..71919e86 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalByTag.js @@ -0,0 +1,112 @@ +var Symbol = require('./_Symbol'), + Uint8Array = require('./_Uint8Array'), + eq = require('./eq'), + equalArrays = require('./_equalArrays'), + mapToArray = require('./_mapToArray'), + setToArray = require('./_setToArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalObjects.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalObjects.js new file mode 100644 index 00000000..17421f37 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_equalObjects.js @@ -0,0 +1,89 @@ +var getAllKeys = require('./_getAllKeys'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_escapeHtmlChar.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_escapeHtmlChar.js new file mode 100644 index 00000000..7ca68ee6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_escapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map characters to HTML entities. */ +var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; + +/** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +var escapeHtmlChar = basePropertyOf(htmlEscapes); + +module.exports = escapeHtmlChar; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_escapeStringChar.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_escapeStringChar.js new file mode 100644 index 00000000..44eca96c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_escapeStringChar.js @@ -0,0 +1,22 @@ +/** Used to escape characters for inclusion in compiled string literals. */ +var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; +} + +module.exports = escapeStringChar; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_flatRest.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_flatRest.js new file mode 100644 index 00000000..94ab6cca --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_flatRest.js @@ -0,0 +1,16 @@ +var flatten = require('./flatten'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_freeGlobal.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_freeGlobal.js new file mode 100644 index 00000000..bbec998f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_freeGlobal.js @@ -0,0 +1,4 @@ +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getAllKeys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getAllKeys.js new file mode 100644 index 00000000..a9ce6995 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getAllKeys.js @@ -0,0 +1,16 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbols = require('./_getSymbols'), + keys = require('./keys'); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getAllKeysIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getAllKeysIn.js new file mode 100644 index 00000000..1b466784 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getAllKeysIn.js @@ -0,0 +1,17 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbolsIn = require('./_getSymbolsIn'), + keysIn = require('./keysIn'); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getData.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getData.js new file mode 100644 index 00000000..a1fe7b77 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getData.js @@ -0,0 +1,15 @@ +var metaMap = require('./_metaMap'), + noop = require('./noop'); + +/** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; + +module.exports = getData; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getFuncName.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getFuncName.js new file mode 100644 index 00000000..21e15b33 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getFuncName.js @@ -0,0 +1,31 @@ +var realNames = require('./_realNames'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ +function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; +} + +module.exports = getFuncName; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getHolder.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getHolder.js new file mode 100644 index 00000000..65e94b5c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getHolder.js @@ -0,0 +1,13 @@ +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getHolder(func) { + var object = func; + return object.placeholder; +} + +module.exports = getHolder; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getMapData.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getMapData.js new file mode 100644 index 00000000..17f63032 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getMapData.js @@ -0,0 +1,18 @@ +var isKeyable = require('./_isKeyable'); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getMatchData.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getMatchData.js new file mode 100644 index 00000000..2cc70f91 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getMatchData.js @@ -0,0 +1,24 @@ +var isStrictComparable = require('./_isStrictComparable'), + keys = require('./keys'); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getNative.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getNative.js new file mode 100644 index 00000000..97a622b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getNative.js @@ -0,0 +1,17 @@ +var baseIsNative = require('./_baseIsNative'), + getValue = require('./_getValue'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getPrototype.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getPrototype.js new file mode 100644 index 00000000..e8086121 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getPrototype.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getRawTag.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getRawTag.js new file mode 100644 index 00000000..49a95c9c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getRawTag.js @@ -0,0 +1,46 @@ +var Symbol = require('./_Symbol'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getSymbols.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getSymbols.js new file mode 100644 index 00000000..7d6eafeb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getSymbols.js @@ -0,0 +1,30 @@ +var arrayFilter = require('./_arrayFilter'), + stubArray = require('./stubArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getSymbolsIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getSymbolsIn.js new file mode 100644 index 00000000..cec0855a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getSymbolsIn.js @@ -0,0 +1,25 @@ +var arrayPush = require('./_arrayPush'), + getPrototype = require('./_getPrototype'), + getSymbols = require('./_getSymbols'), + stubArray = require('./stubArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getTag.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getTag.js new file mode 100644 index 00000000..deaf89d5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getTag.js @@ -0,0 +1,58 @@ +var DataView = require('./_DataView'), + Map = require('./_Map'), + Promise = require('./_Promise'), + Set = require('./_Set'), + WeakMap = require('./_WeakMap'), + baseGetTag = require('./_baseGetTag'), + toSource = require('./_toSource'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getValue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getValue.js new file mode 100644 index 00000000..5f7d7736 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getValue.js @@ -0,0 +1,13 @@ +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getView.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getView.js new file mode 100644 index 00000000..df1e5d44 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getView.js @@ -0,0 +1,33 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ +function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; +} + +module.exports = getView; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getWrapDetails.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getWrapDetails.js new file mode 100644 index 00000000..3bcc6e48 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_getWrapDetails.js @@ -0,0 +1,17 @@ +/** Used to match wrap detail comments. */ +var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + +/** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ +function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; +} + +module.exports = getWrapDetails; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasPath.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasPath.js new file mode 100644 index 00000000..93dbde15 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasPath.js @@ -0,0 +1,39 @@ +var castPath = require('./_castPath'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isIndex = require('./_isIndex'), + isLength = require('./isLength'), + toKey = require('./_toKey'); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasUnicode.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasUnicode.js new file mode 100644 index 00000000..cb6ca15f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasUnicode.js @@ -0,0 +1,26 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +module.exports = hasUnicode; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasUnicodeWord.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasUnicodeWord.js new file mode 100644 index 00000000..95d52c44 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hasUnicodeWord.js @@ -0,0 +1,15 @@ +/** Used to detect strings that need a more robust regexp to match words. */ +var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + +/** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ +function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); +} + +module.exports = hasUnicodeWord; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashClear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashClear.js new file mode 100644 index 00000000..5d4b70cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashClear.js @@ -0,0 +1,15 @@ +var nativeCreate = require('./_nativeCreate'); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashDelete.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashDelete.js new file mode 100644 index 00000000..ea9dabf1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashDelete.js @@ -0,0 +1,17 @@ +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashGet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashGet.js new file mode 100644 index 00000000..1fc2f34b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashGet.js @@ -0,0 +1,30 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashHas.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashHas.js new file mode 100644 index 00000000..281a5517 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashHas.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashSet.js new file mode 100644 index 00000000..e1055283 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_hashSet.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneArray.js new file mode 100644 index 00000000..078c15af --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneArray.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneByTag.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneByTag.js new file mode 100644 index 00000000..f69a008c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneByTag.js @@ -0,0 +1,77 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'), + cloneDataView = require('./_cloneDataView'), + cloneRegExp = require('./_cloneRegExp'), + cloneSymbol = require('./_cloneSymbol'), + cloneTypedArray = require('./_cloneTypedArray'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneObject.js new file mode 100644 index 00000000..5a13e64a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_initCloneObject.js @@ -0,0 +1,18 @@ +var baseCreate = require('./_baseCreate'), + getPrototype = require('./_getPrototype'), + isPrototype = require('./_isPrototype'); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_insertWrapDetails.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_insertWrapDetails.js new file mode 100644 index 00000000..e7908086 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_insertWrapDetails.js @@ -0,0 +1,23 @@ +/** Used to match wrap detail comments. */ +var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; + +/** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ +function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); +} + +module.exports = insertWrapDetails; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isFlattenable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isFlattenable.js new file mode 100644 index 00000000..4cc2c249 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isFlattenable.js @@ -0,0 +1,20 @@ +var Symbol = require('./_Symbol'), + isArguments = require('./isArguments'), + isArray = require('./isArray'); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isIndex.js new file mode 100644 index 00000000..061cd390 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isIndex.js @@ -0,0 +1,25 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isIterateeCall.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isIterateeCall.js new file mode 100644 index 00000000..a0bb5a9c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isIterateeCall.js @@ -0,0 +1,30 @@ +var eq = require('./eq'), + isArrayLike = require('./isArrayLike'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isKey.js new file mode 100644 index 00000000..ff08b068 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isKey.js @@ -0,0 +1,29 @@ +var isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isKeyable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isKeyable.js new file mode 100644 index 00000000..39f1828d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isKeyable.js @@ -0,0 +1,15 @@ +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isLaziable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isLaziable.js new file mode 100644 index 00000000..a57c4f2d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isLaziable.js @@ -0,0 +1,28 @@ +var LazyWrapper = require('./_LazyWrapper'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + lodash = require('./wrapperLodash'); + +/** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ +function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; +} + +module.exports = isLaziable; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isMaskable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isMaskable.js new file mode 100644 index 00000000..eb98d09f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isMaskable.js @@ -0,0 +1,14 @@ +var coreJsData = require('./_coreJsData'), + isFunction = require('./isFunction'), + stubFalse = require('./stubFalse'); + +/** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ +var isMaskable = coreJsData ? isFunction : stubFalse; + +module.exports = isMaskable; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isMasked.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isMasked.js new file mode 100644 index 00000000..4b0f21ba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isMasked.js @@ -0,0 +1,20 @@ +var coreJsData = require('./_coreJsData'); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isPrototype.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isPrototype.js new file mode 100644 index 00000000..0f29498d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isPrototype.js @@ -0,0 +1,18 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isStrictComparable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isStrictComparable.js new file mode 100644 index 00000000..b59f40b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_isStrictComparable.js @@ -0,0 +1,15 @@ +var isObject = require('./isObject'); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_iteratorToArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_iteratorToArray.js new file mode 100644 index 00000000..47685664 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_iteratorToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ +function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; +} + +module.exports = iteratorToArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyClone.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyClone.js new file mode 100644 index 00000000..d8a51f87 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ +function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; +} + +module.exports = lazyClone; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyReverse.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyReverse.js new file mode 100644 index 00000000..c5b52190 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyReverse.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'); + +/** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ +function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; +} + +module.exports = lazyReverse; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyValue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyValue.js new file mode 100644 index 00000000..371ca8d2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_lazyValue.js @@ -0,0 +1,69 @@ +var baseWrapperValue = require('./_baseWrapperValue'), + getView = require('./_getView'), + isArray = require('./isArray'); + +/** Used to indicate the type of lazy iteratees. */ +var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ +function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; +} + +module.exports = lazyValue; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheClear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheClear.js new file mode 100644 index 00000000..acbe39a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheClear.js @@ -0,0 +1,13 @@ +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheDelete.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheDelete.js new file mode 100644 index 00000000..b1384ade --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheDelete.js @@ -0,0 +1,35 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheGet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheGet.js new file mode 100644 index 00000000..f8192fc3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheGet.js @@ -0,0 +1,19 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheHas.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheHas.js new file mode 100644 index 00000000..2adf6714 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheHas.js @@ -0,0 +1,16 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheSet.js new file mode 100644 index 00000000..5855c95e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_listCacheSet.js @@ -0,0 +1,26 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheClear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheClear.js new file mode 100644 index 00000000..bc9ca204 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheClear.js @@ -0,0 +1,21 @@ +var Hash = require('./_Hash'), + ListCache = require('./_ListCache'), + Map = require('./_Map'); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheDelete.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheDelete.js new file mode 100644 index 00000000..946ca3c9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheDelete.js @@ -0,0 +1,18 @@ +var getMapData = require('./_getMapData'); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheGet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheGet.js new file mode 100644 index 00000000..f29f55cf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheGet.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheHas.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheHas.js new file mode 100644 index 00000000..a1214c02 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheHas.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheSet.js new file mode 100644 index 00000000..73468492 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapCacheSet.js @@ -0,0 +1,22 @@ +var getMapData = require('./_getMapData'); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapToArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapToArray.js new file mode 100644 index 00000000..fe3dd531 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mapToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_matchesStrictComparable.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_matchesStrictComparable.js new file mode 100644 index 00000000..f608af9e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_matchesStrictComparable.js @@ -0,0 +1,20 @@ +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_memoizeCapped.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_memoizeCapped.js new file mode 100644 index 00000000..7f71c8fb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_memoizeCapped.js @@ -0,0 +1,26 @@ +var memoize = require('./memoize'); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mergeData.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mergeData.js new file mode 100644 index 00000000..cb570f97 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_mergeData.js @@ -0,0 +1,90 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + replaceHolders = require('./_replaceHolders'); + +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ +function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; +} + +module.exports = mergeData; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_metaMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_metaMap.js new file mode 100644 index 00000000..0157a0b0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_metaMap.js @@ -0,0 +1,6 @@ +var WeakMap = require('./_WeakMap'); + +/** Used to store function metadata. */ +var metaMap = WeakMap && new WeakMap; + +module.exports = metaMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeCreate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeCreate.js new file mode 100644 index 00000000..c7aede85 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeCreate.js @@ -0,0 +1,6 @@ +var getNative = require('./_getNative'); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeKeys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeKeys.js new file mode 100644 index 00000000..479a104a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeKeys.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeKeysIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeKeysIn.js new file mode 100644 index 00000000..00ee5059 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nativeKeysIn.js @@ -0,0 +1,20 @@ +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nodeUtil.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nodeUtil.js new file mode 100644 index 00000000..983d78f7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_nodeUtil.js @@ -0,0 +1,30 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_objectToString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_objectToString.js new file mode 100644 index 00000000..c614ec09 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_objectToString.js @@ -0,0 +1,22 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_overArg.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_overArg.js new file mode 100644 index 00000000..651c5c55 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_overArg.js @@ -0,0 +1,15 @@ +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_overRest.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_overRest.js new file mode 100644 index 00000000..c7cdef33 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_overRest.js @@ -0,0 +1,36 @@ +var apply = require('./_apply'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_parent.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_parent.js new file mode 100644 index 00000000..f174328f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_parent.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'), + baseSlice = require('./_baseSlice'); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reEscape.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reEscape.js new file mode 100644 index 00000000..7f47eda6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reEscape.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEscape = /<%-([\s\S]+?)%>/g; + +module.exports = reEscape; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reEvaluate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reEvaluate.js new file mode 100644 index 00000000..6adfc312 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reEvaluate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEvaluate = /<%([\s\S]+?)%>/g; + +module.exports = reEvaluate; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reInterpolate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reInterpolate.js new file mode 100644 index 00000000..d02ff0b2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reInterpolate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reInterpolate = /<%=([\s\S]+?)%>/g; + +module.exports = reInterpolate; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_realNames.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_realNames.js new file mode 100644 index 00000000..aa0d5292 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_realNames.js @@ -0,0 +1,4 @@ +/** Used to lookup unminified function names. */ +var realNames = {}; + +module.exports = realNames; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reorder.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reorder.js new file mode 100644 index 00000000..a3502b05 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_reorder.js @@ -0,0 +1,29 @@ +var copyArray = require('./_copyArray'), + isIndex = require('./_isIndex'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ +function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; +} + +module.exports = reorder; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_replaceHolders.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_replaceHolders.js new file mode 100644 index 00000000..74360ec4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_replaceHolders.js @@ -0,0 +1,29 @@ +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ +function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; +} + +module.exports = replaceHolders; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_root.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_root.js new file mode 100644 index 00000000..d2852bed --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_root.js @@ -0,0 +1,9 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_safeGet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_safeGet.js new file mode 100644 index 00000000..411b0620 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_safeGet.js @@ -0,0 +1,17 @@ +/** + * Gets the value at `key`, unless `key` is "__proto__". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key == '__proto__') { + return; + } + + return object[key]; +} + +module.exports = safeGet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setCacheAdd.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setCacheAdd.js new file mode 100644 index 00000000..1081a744 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setCacheAdd.js @@ -0,0 +1,19 @@ +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setCacheHas.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setCacheHas.js new file mode 100644 index 00000000..9a492556 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setCacheHas.js @@ -0,0 +1,14 @@ +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setData.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setData.js new file mode 100644 index 00000000..e5cf3eb9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setData.js @@ -0,0 +1,20 @@ +var baseSetData = require('./_baseSetData'), + shortOut = require('./_shortOut'); + +/** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var setData = shortOut(baseSetData); + +module.exports = setData; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToArray.js new file mode 100644 index 00000000..b87f0741 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToPairs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToPairs.js new file mode 100644 index 00000000..36ad37a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToPairs.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToString.js new file mode 100644 index 00000000..6ca84196 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setToString.js @@ -0,0 +1,14 @@ +var baseSetToString = require('./_baseSetToString'), + shortOut = require('./_shortOut'); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setWrapToString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setWrapToString.js new file mode 100644 index 00000000..decdc449 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_setWrapToString.js @@ -0,0 +1,21 @@ +var getWrapDetails = require('./_getWrapDetails'), + insertWrapDetails = require('./_insertWrapDetails'), + setToString = require('./_setToString'), + updateWrapDetails = require('./_updateWrapDetails'); + +/** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ +function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); +} + +module.exports = setWrapToString; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_shortOut.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_shortOut.js new file mode 100644 index 00000000..3300a079 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_shortOut.js @@ -0,0 +1,37 @@ +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_shuffleSelf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_shuffleSelf.js new file mode 100644 index 00000000..8bcc4f5c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_shuffleSelf.js @@ -0,0 +1,28 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ +function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; +} + +module.exports = shuffleSelf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackClear.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackClear.js new file mode 100644 index 00000000..ce8e5a92 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackClear.js @@ -0,0 +1,15 @@ +var ListCache = require('./_ListCache'); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackDelete.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackDelete.js new file mode 100644 index 00000000..ff9887ab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackDelete.js @@ -0,0 +1,18 @@ +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackGet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackGet.js new file mode 100644 index 00000000..1cdf0040 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackGet.js @@ -0,0 +1,14 @@ +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackHas.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackHas.js new file mode 100644 index 00000000..16a3ad11 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackHas.js @@ -0,0 +1,14 @@ +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackSet.js new file mode 100644 index 00000000..b790ac5f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stackSet.js @@ -0,0 +1,34 @@ +var ListCache = require('./_ListCache'), + Map = require('./_Map'), + MapCache = require('./_MapCache'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_strictIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_strictIndexOf.js new file mode 100644 index 00000000..0486a495 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_strictIndexOf.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_strictLastIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_strictLastIndexOf.js new file mode 100644 index 00000000..d7310dcc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_strictLastIndexOf.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; +} + +module.exports = strictLastIndexOf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringSize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringSize.js new file mode 100644 index 00000000..17ef462a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringSize.js @@ -0,0 +1,18 @@ +var asciiSize = require('./_asciiSize'), + hasUnicode = require('./_hasUnicode'), + unicodeSize = require('./_unicodeSize'); + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); +} + +module.exports = stringSize; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringToArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringToArray.js new file mode 100644 index 00000000..d161158c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringToArray.js @@ -0,0 +1,18 @@ +var asciiToArray = require('./_asciiToArray'), + hasUnicode = require('./_hasUnicode'), + unicodeToArray = require('./_unicodeToArray'); + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +module.exports = stringToArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringToPath.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringToPath.js new file mode 100644 index 00000000..8f39f8a2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_stringToPath.js @@ -0,0 +1,27 @@ +var memoizeCapped = require('./_memoizeCapped'); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_toKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_toKey.js new file mode 100644 index 00000000..c6d645c4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_toKey.js @@ -0,0 +1,21 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_toSource.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_toSource.js new file mode 100644 index 00000000..a020b386 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_toSource.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unescapeHtmlChar.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unescapeHtmlChar.js new file mode 100644 index 00000000..a71fecb3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unescapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map HTML entities to characters. */ +var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; + +/** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ +var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + +module.exports = unescapeHtmlChar; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeSize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeSize.js new file mode 100644 index 00000000..68137ec2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeSize.js @@ -0,0 +1,44 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; +} + +module.exports = unicodeSize; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeToArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeToArray.js new file mode 100644 index 00000000..2a725c06 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeToArray.js @@ -0,0 +1,40 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +module.exports = unicodeToArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeWords.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeWords.js new file mode 100644 index 00000000..e72e6e0f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_unicodeWords.js @@ -0,0 +1,69 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]", + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; + +/** Used to match complex or compound words. */ +var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji +].join('|'), 'g'); + +/** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function unicodeWords(string) { + return string.match(reUnicodeWord) || []; +} + +module.exports = unicodeWords; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_updateWrapDetails.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_updateWrapDetails.js new file mode 100644 index 00000000..8759fbdf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_updateWrapDetails.js @@ -0,0 +1,46 @@ +var arrayEach = require('./_arrayEach'), + arrayIncludes = require('./_arrayIncludes'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + +/** Used to associate wrap methods with their bit flags. */ +var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] +]; + +/** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ +function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); +} + +module.exports = updateWrapDetails; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_wrapperClone.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_wrapperClone.js new file mode 100644 index 00000000..7bb58a2e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/_wrapperClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + LodashWrapper = require('./_LodashWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ +function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; +} + +module.exports = wrapperClone; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/add.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/add.js new file mode 100644 index 00000000..f0695156 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/add.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Adds two numbers. + * + * @static + * @memberOf _ + * @since 3.4.0 + * @category Math + * @param {number} augend The first number in an addition. + * @param {number} addend The second number in an addition. + * @returns {number} Returns the total. + * @example + * + * _.add(6, 4); + * // => 10 + */ +var add = createMathOperation(function(augend, addend) { + return augend + addend; +}, 0); + +module.exports = add; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/after.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/after.js new file mode 100644 index 00000000..3900c979 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/after.js @@ -0,0 +1,42 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ +function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; +} + +module.exports = after; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/array.js new file mode 100644 index 00000000..af688d3e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/array.js @@ -0,0 +1,67 @@ +module.exports = { + 'chunk': require('./chunk'), + 'compact': require('./compact'), + 'concat': require('./concat'), + 'difference': require('./difference'), + 'differenceBy': require('./differenceBy'), + 'differenceWith': require('./differenceWith'), + 'drop': require('./drop'), + 'dropRight': require('./dropRight'), + 'dropRightWhile': require('./dropRightWhile'), + 'dropWhile': require('./dropWhile'), + 'fill': require('./fill'), + 'findIndex': require('./findIndex'), + 'findLastIndex': require('./findLastIndex'), + 'first': require('./first'), + 'flatten': require('./flatten'), + 'flattenDeep': require('./flattenDeep'), + 'flattenDepth': require('./flattenDepth'), + 'fromPairs': require('./fromPairs'), + 'head': require('./head'), + 'indexOf': require('./indexOf'), + 'initial': require('./initial'), + 'intersection': require('./intersection'), + 'intersectionBy': require('./intersectionBy'), + 'intersectionWith': require('./intersectionWith'), + 'join': require('./join'), + 'last': require('./last'), + 'lastIndexOf': require('./lastIndexOf'), + 'nth': require('./nth'), + 'pull': require('./pull'), + 'pullAll': require('./pullAll'), + 'pullAllBy': require('./pullAllBy'), + 'pullAllWith': require('./pullAllWith'), + 'pullAt': require('./pullAt'), + 'remove': require('./remove'), + 'reverse': require('./reverse'), + 'slice': require('./slice'), + 'sortedIndex': require('./sortedIndex'), + 'sortedIndexBy': require('./sortedIndexBy'), + 'sortedIndexOf': require('./sortedIndexOf'), + 'sortedLastIndex': require('./sortedLastIndex'), + 'sortedLastIndexBy': require('./sortedLastIndexBy'), + 'sortedLastIndexOf': require('./sortedLastIndexOf'), + 'sortedUniq': require('./sortedUniq'), + 'sortedUniqBy': require('./sortedUniqBy'), + 'tail': require('./tail'), + 'take': require('./take'), + 'takeRight': require('./takeRight'), + 'takeRightWhile': require('./takeRightWhile'), + 'takeWhile': require('./takeWhile'), + 'union': require('./union'), + 'unionBy': require('./unionBy'), + 'unionWith': require('./unionWith'), + 'uniq': require('./uniq'), + 'uniqBy': require('./uniqBy'), + 'uniqWith': require('./uniqWith'), + 'unzip': require('./unzip'), + 'unzipWith': require('./unzipWith'), + 'without': require('./without'), + 'xor': require('./xor'), + 'xorBy': require('./xorBy'), + 'xorWith': require('./xorWith'), + 'zip': require('./zip'), + 'zipObject': require('./zipObject'), + 'zipObjectDeep': require('./zipObjectDeep'), + 'zipWith': require('./zipWith') +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/ary.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/ary.js new file mode 100644 index 00000000..70c87d09 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/ary.js @@ -0,0 +1,29 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_ARY_FLAG = 128; + +/** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ +function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); +} + +module.exports = ary; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assign.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assign.js new file mode 100644 index 00000000..909db26a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assign.js @@ -0,0 +1,58 @@ +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), + keys = require('./keys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignIn.js new file mode 100644 index 00000000..e663473a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignIn.js @@ -0,0 +1,40 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ +var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); +}); + +module.exports = assignIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignInWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignInWith.js new file mode 100644 index 00000000..68fcc0b0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignInWith.js @@ -0,0 +1,38 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); +}); + +module.exports = assignInWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignWith.js new file mode 100644 index 00000000..7dc6c761 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/assignWith.js @@ -0,0 +1,37 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keys = require('./keys'); + +/** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); +}); + +module.exports = assignWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/at.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/at.js new file mode 100644 index 00000000..781ee9e5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/at.js @@ -0,0 +1,23 @@ +var baseAt = require('./_baseAt'), + flatRest = require('./_flatRest'); + +/** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ +var at = flatRest(baseAt); + +module.exports = at; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/attempt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/attempt.js new file mode 100644 index 00000000..624d0152 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/attempt.js @@ -0,0 +1,35 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + isError = require('./isError'); + +/** + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the `func` result or error object. + * @example + * + * // Avoid throwing errors for invalid selectors. + * var elements = _.attempt(function(selector) { + * return document.querySelectorAll(selector); + * }, '>_>'); + * + * if (_.isError(elements)) { + * elements = []; + * } + */ +var attempt = baseRest(function(func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } +}); + +module.exports = attempt; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/before.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/before.js new file mode 100644 index 00000000..a3e0a16c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/before.js @@ -0,0 +1,40 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ +function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; +} + +module.exports = before; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bind.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bind.js new file mode 100644 index 00000000..b1076e93 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bind.js @@ -0,0 +1,57 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ +var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); +}); + +// Assign default placeholders. +bind.placeholder = {}; + +module.exports = bind; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bindAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bindAll.js new file mode 100644 index 00000000..a35706de --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bindAll.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseAssignValue = require('./_baseAssignValue'), + bind = require('./bind'), + flatRest = require('./_flatRest'), + toKey = require('./_toKey'); + +/** + * Binds methods of an object to the object itself, overwriting the existing + * method. + * + * **Note:** This method doesn't set the "length" property of bound functions. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} methodNames The object method names to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'click': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); + * // => Logs 'clicked docs' when clicked. + */ +var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { + key = toKey(key); + baseAssignValue(object, key, bind(object[key], object)); + }); + return object; +}); + +module.exports = bindAll; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bindKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bindKey.js new file mode 100644 index 00000000..f7fd64cd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/bindKey.js @@ -0,0 +1,68 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ +var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); +}); + +// Assign default placeholders. +bindKey.placeholder = {}; + +module.exports = bindKey; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/camelCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/camelCase.js new file mode 100644 index 00000000..d7390def --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/camelCase.js @@ -0,0 +1,29 @@ +var capitalize = require('./capitalize'), + createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ +var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); +}); + +module.exports = camelCase; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/capitalize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/capitalize.js new file mode 100644 index 00000000..3e1600e7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/capitalize.js @@ -0,0 +1,23 @@ +var toString = require('./toString'), + upperFirst = require('./upperFirst'); + +/** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ +function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); +} + +module.exports = capitalize; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/castArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/castArray.js new file mode 100644 index 00000000..e470bdb9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/castArray.js @@ -0,0 +1,44 @@ +var isArray = require('./isArray'); + +/** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ +function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; +} + +module.exports = castArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/ceil.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/ceil.js new file mode 100644 index 00000000..56c8722c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/ceil.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded up to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round up. + * @param {number} [precision=0] The precision to round up to. + * @returns {number} Returns the rounded up number. + * @example + * + * _.ceil(4.006); + * // => 5 + * + * _.ceil(6.004, 2); + * // => 6.01 + * + * _.ceil(6040, -2); + * // => 6100 + */ +var ceil = createRound('ceil'); + +module.exports = ceil; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/chain.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/chain.js new file mode 100644 index 00000000..f6cd6475 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/chain.js @@ -0,0 +1,38 @@ +var lodash = require('./wrapperLodash'); + +/** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ +function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; +} + +module.exports = chain; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/chunk.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/chunk.js new file mode 100644 index 00000000..5b562fef --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/chunk.js @@ -0,0 +1,50 @@ +var baseSlice = require('./_baseSlice'), + isIterateeCall = require('./_isIterateeCall'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ +function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; +} + +module.exports = chunk; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/clamp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/clamp.js new file mode 100644 index 00000000..91a72c97 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/clamp.js @@ -0,0 +1,39 @@ +var baseClamp = require('./_baseClamp'), + toNumber = require('./toNumber'); + +/** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ +function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); +} + +module.exports = clamp; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/clone.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/clone.js new file mode 100644 index 00000000..dd439d63 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/clone.js @@ -0,0 +1,36 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); +} + +module.exports = clone; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneDeep.js new file mode 100644 index 00000000..4425fbe8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneDeep.js @@ -0,0 +1,29 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); +} + +module.exports = cloneDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneDeepWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneDeepWith.js new file mode 100644 index 00000000..fd9c6c05 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneDeepWith.js @@ -0,0 +1,40 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ +function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneDeepWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneWith.js new file mode 100644 index 00000000..d2f4e756 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cloneWith.js @@ -0,0 +1,42 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ +function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/collection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/collection.js new file mode 100644 index 00000000..77fe837f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/collection.js @@ -0,0 +1,30 @@ +module.exports = { + 'countBy': require('./countBy'), + 'each': require('./each'), + 'eachRight': require('./eachRight'), + 'every': require('./every'), + 'filter': require('./filter'), + 'find': require('./find'), + 'findLast': require('./findLast'), + 'flatMap': require('./flatMap'), + 'flatMapDeep': require('./flatMapDeep'), + 'flatMapDepth': require('./flatMapDepth'), + 'forEach': require('./forEach'), + 'forEachRight': require('./forEachRight'), + 'groupBy': require('./groupBy'), + 'includes': require('./includes'), + 'invokeMap': require('./invokeMap'), + 'keyBy': require('./keyBy'), + 'map': require('./map'), + 'orderBy': require('./orderBy'), + 'partition': require('./partition'), + 'reduce': require('./reduce'), + 'reduceRight': require('./reduceRight'), + 'reject': require('./reject'), + 'sample': require('./sample'), + 'sampleSize': require('./sampleSize'), + 'shuffle': require('./shuffle'), + 'size': require('./size'), + 'some': require('./some'), + 'sortBy': require('./sortBy') +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/commit.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/commit.js new file mode 100644 index 00000000..fe4db717 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/commit.js @@ -0,0 +1,33 @@ +var LodashWrapper = require('./_LodashWrapper'); + +/** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ +function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); +} + +module.exports = wrapperCommit; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/compact.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/compact.js new file mode 100644 index 00000000..031fab4e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/compact.js @@ -0,0 +1,31 @@ +/** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ +function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = compact; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/concat.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/concat.js new file mode 100644 index 00000000..1da48a4f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/concat.js @@ -0,0 +1,43 @@ +var arrayPush = require('./_arrayPush'), + baseFlatten = require('./_baseFlatten'), + copyArray = require('./_copyArray'), + isArray = require('./isArray'); + +/** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ +function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); +} + +module.exports = concat; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cond.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cond.js new file mode 100644 index 00000000..64555986 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/cond.js @@ -0,0 +1,60 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ +function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, + toIteratee = baseIteratee; + + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + + return baseRest(function(args) { + var index = -1; + while (++index < length) { + var pair = pairs[index]; + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } + }); +} + +module.exports = cond; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/conforms.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/conforms.js new file mode 100644 index 00000000..5501a949 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/conforms.js @@ -0,0 +1,35 @@ +var baseClone = require('./_baseClone'), + baseConforms = require('./_baseConforms'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes the predicate properties of `source` with + * the corresponding property values of a given object, returning `true` if + * all predicates return truthy, else `false`. + * + * **Note:** The created function is equivalent to `_.conformsTo` with + * `source` partially applied. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } + * ]; + * + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] + */ +function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); +} + +module.exports = conforms; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/conformsTo.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/conformsTo.js new file mode 100644 index 00000000..b8a93ebf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/conformsTo.js @@ -0,0 +1,32 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ +function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); +} + +module.exports = conformsTo; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/constant.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/constant.js new file mode 100644 index 00000000..655ece3f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/constant.js @@ -0,0 +1,26 @@ +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/core.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/core.js new file mode 100644 index 00000000..e333c15b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/core.js @@ -0,0 +1,3854 @@ +/** + * @license + * Lodash (Custom Build) + * Build: `lodash core -o ./dist/lodash.core.js` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.11'; + + /** Error message constants. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + numberTag = '[object Number]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + + /** Used to match HTML entities and HTML characters. */ + var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /*--------------------------------------------------------------------------*/ + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + array.push.apply(array, values); + return array; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return baseMap(props, function(key) { + return object[key]; + }); + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Built-in value references. */ + var objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsFinite = root.isFinite, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + return value instanceof LodashWrapper + ? value + : new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + } + + LodashWrapper.prototype = baseCreate(lodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + object[key] = value; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !false) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return baseFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + return objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + var baseIsArguments = noop; + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : baseGetTag(object), + othTag = othIsArr ? arrayTag : baseGetTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + stack || (stack = []); + var objStack = find(stack, function(entry) { + return entry[0] == object; + }); + var othStack = find(stack, function(entry) { + return entry[0] == other; + }); + if (objStack && othStack) { + return objStack[1] == other; + } + stack.push([object, other]); + stack.push([other, object]); + if (isSameTag && !objIsObj) { + var result = (objIsArr) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + stack.pop(); + return result; + } + } + if (!isSameTag) { + return false; + } + var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(func) { + if (typeof func == 'function') { + return func; + } + if (func == null) { + return identity; + } + return (typeof func == 'object' ? baseMatches : baseProperty)(func); + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var props = nativeKeys(source); + return function(object) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length]; + if (!(key in object && + baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) + )) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return reduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source) { + return baseSlice(source, 0, source.length); + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + return reduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = false; + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = false; + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return fn.apply(isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + var compared; + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!baseSome(other, function(othValue, othIndex) { + if (!indexOf(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var result = true; + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + var compared; + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return func.apply(this, otherArgs); + }; + } + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = identity; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + return baseFilter(array, Boolean); + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; + } else { + fromIndex = 0; + } + var index = (fromIndex || 0) - 1, + isReflexive = value === value; + + while (++index < length) { + var other = array[index]; + if ((isReflexive ? other === value : other !== other)) { + return index; + } + } + return -1; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + start = start == null ? 0 : +start; + end = end === undefined ? length : +end; + return length ? baseSlice(array, start, end) : []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseEvery(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + return baseFilter(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return baseEach(collection, baseIteratee(iteratee)); + } + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + return baseMap(collection, baseIteratee(iteratee)); + } + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + collection = isArrayLike(collection) ? collection : nativeKeys(collection); + return collection.length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseSome(collection, baseIteratee(predicate)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + function sortBy(collection, iteratee) { + var index = 0; + iteratee = baseIteratee(iteratee); + + return baseMap(baseMap(collection, function(value, key, collection) { + return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; + }).sort(function(object, other) { + return compareAscending(object.criteria, other.criteria) || (object.index - other.index); + }), baseProperty('value')); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); + }); + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + if (!isObject(value)) { + return value; + } + return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = baseIsDate; + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || + isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + return !nativeKeys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = baseIsRegExp; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!isArrayLike(value)) { + return values(value); + } + return value.length ? copyArray(value) : []; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + var toInteger = Number; + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + var toNumber = Number; + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + if (typeof value == 'string') { + return value; + } + return value == null ? '' : (value + ''); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + copyObject(source, nativeKeys(source), object); + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, nativeKeysIn(source), object); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : assign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasOwnProperty.call(object, path); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = nativeKeys; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + var keysIn = nativeKeysIn; + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + var value = object == null ? undefined : object[path]; + if (value === undefined) { + value = defaultValue; + } + return isFunction(value) ? value.call(object) : value; + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /*------------------------------------------------------------------------*/ + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ + var iteratee = baseIteratee; + + /** + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; + * + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + */ + function matches(source) { + return baseMatches(assign({}, source)); + } + + /** + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. + * @example + * + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); + * } + * + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] + * + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] + */ + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && + !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + + baseEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + + return object; + } + + /** + * Reverts the `_` variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + return this; + } + + /** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ + function noop() { + // No operation performed. + } + + /** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + /*------------------------------------------------------------------------*/ + + /** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ + function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; + } + + /** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */ + function min(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseLt) + : undefined; + } + + /*------------------------------------------------------------------------*/ + + // Add methods that return wrapped values in chain sequences. + lodash.assignIn = assignIn; + lodash.before = before; + lodash.bind = bind; + lodash.chain = chain; + lodash.compact = compact; + lodash.concat = concat; + lodash.create = create; + lodash.defaults = defaults; + lodash.defer = defer; + lodash.delay = delay; + lodash.filter = filter; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.iteratee = iteratee; + lodash.keys = keys; + lodash.map = map; + lodash.matches = matches; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.once = once; + lodash.pick = pick; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.tap = tap; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.values = values; + + // Add aliases. + lodash.extend = assignIn; + + // Add methods to `lodash.prototype`. + mixin(lodash, lodash); + + /*------------------------------------------------------------------------*/ + + // Add methods that return unwrapped values in chain sequences. + lodash.clone = clone; + lodash.escape = escape; + lodash.every = every; + lodash.find = find; + lodash.forEach = forEach; + lodash.has = has; + lodash.head = head; + lodash.identity = identity; + lodash.indexOf = indexOf; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isBoolean = isBoolean; + lodash.isDate = isDate; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isNaN = isNaN; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isRegExp = isRegExp; + lodash.isString = isString; + lodash.isUndefined = isUndefined; + lodash.last = last; + lodash.max = max; + lodash.min = min; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.reduce = reduce; + lodash.result = result; + lodash.size = size; + lodash.some = some; + lodash.uniqueId = uniqueId; + + // Add aliases. + lodash.each = forEach; + lodash.first = head; + + mixin(lodash, (function() { + var source = {}; + baseForOwn(lodash, function(func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }()), { 'chain': false }); + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + // Add `Array` methods to `lodash.prototype`. + baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); + + lodash.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + return this[chainName](function(value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + + // Add chain sequence methods to the `lodash` wrapper. + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + + /*--------------------------------------------------------------------------*/ + + // Some AMD build optimizers, like r.js, check for condition patterns like: + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = lodash; + + // Define as an anonymous module so, through path mapping, it can be + // referenced as the "underscore" module. + define(function() { + return lodash; + }); + } + // Check for `exports` after `define` in case a build optimizer adds it. + else if (freeModule) { + // Export for Node.js. + (freeModule.exports = lodash)._ = lodash; + // Export for CommonJS support. + freeExports._ = lodash; + } + else { + // Export to the global object. + root._ = lodash; + } +}.call(this)); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/core.min.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/core.min.js new file mode 100644 index 00000000..bd1e5453 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/core.min.js @@ -0,0 +1,29 @@ +/** + * @license + * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash core -o ./dist/lodash.core.js` + */ +;(function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); +return setTimeout(function(){n.apply(Z,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!==n&&t!==t:y(n,t,r,e,b,u))}function y(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){ +return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, +r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?d:r)(n)}function _(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;for(var c=-1,f=true,a=2&r?[]:Z;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn)}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n), +function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&typeof n=="object"}function K(n){ +return typeof n=="number"||H(n)&&"[object Number]"==hn.call(n)}function L(n){return typeof n=="string"||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return null==n?[]:u(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__; +if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ +return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i; +var mn=function(n,t){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ +var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } +}); + +module.exports = countBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/create.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/create.js new file mode 100644 index 00000000..919edb85 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/create.js @@ -0,0 +1,43 @@ +var baseAssign = require('./_baseAssign'), + baseCreate = require('./_baseCreate'); + +/** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); +} + +module.exports = create; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/curry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/curry.js new file mode 100644 index 00000000..918db1a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/curry.js @@ -0,0 +1,57 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8; + +/** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; +} + +// Assign default placeholders. +curry.placeholder = {}; + +module.exports = curry; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/curryRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/curryRight.js new file mode 100644 index 00000000..c85b6f33 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/curryRight.js @@ -0,0 +1,54 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_RIGHT_FLAG = 16; + +/** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ +function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; +} + +// Assign default placeholders. +curryRight.placeholder = {}; + +module.exports = curryRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/date.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/date.js new file mode 100644 index 00000000..cbf5b410 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/date.js @@ -0,0 +1,3 @@ +module.exports = { + 'now': require('./now') +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/debounce.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/debounce.js new file mode 100644 index 00000000..205e49f3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/debounce.js @@ -0,0 +1,190 @@ +var isObject = require('./isObject'), + now = require('./now'), + toNumber = require('./toNumber'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/deburr.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/deburr.js new file mode 100644 index 00000000..f85e314a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/deburr.js @@ -0,0 +1,45 @@ +var deburrLetter = require('./_deburrLetter'), + toString = require('./toString'); + +/** Used to match Latin Unicode letters (excluding mathematical operators). */ +var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + +/** Used to compose unicode character classes. */ +var rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboRange + ']'; + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaultTo.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaultTo.js new file mode 100644 index 00000000..5b333592 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaultTo.js @@ -0,0 +1,25 @@ +/** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 + */ +function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; +} + +module.exports = defaultTo; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaults.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaults.js new file mode 100644 index 00000000..c74df044 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaults.js @@ -0,0 +1,64 @@ +var baseRest = require('./_baseRest'), + eq = require('./eq'), + isIterateeCall = require('./_isIterateeCall'), + keysIn = require('./keysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; +}); + +module.exports = defaults; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaultsDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaultsDeep.js new file mode 100644 index 00000000..9b5fa3ee --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defaultsDeep.js @@ -0,0 +1,30 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + customDefaultsMerge = require('./_customDefaultsMerge'), + mergeWith = require('./mergeWith'); + +/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ +var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); +}); + +module.exports = defaultsDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defer.js new file mode 100644 index 00000000..f6d6c6fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/defer.js @@ -0,0 +1,26 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'); + +/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ +var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); +}); + +module.exports = defer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/delay.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/delay.js new file mode 100644 index 00000000..bd554796 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/delay.js @@ -0,0 +1,28 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'), + toNumber = require('./toNumber'); + +/** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ +var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); +}); + +module.exports = delay; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/difference.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/difference.js new file mode 100644 index 00000000..fa28bb30 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/difference.js @@ -0,0 +1,33 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/differenceBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/differenceBy.js new file mode 100644 index 00000000..2cd63e7e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/differenceBy.js @@ -0,0 +1,44 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ +var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = differenceBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/differenceWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/differenceWith.js new file mode 100644 index 00000000..c0233f4b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/differenceWith.js @@ -0,0 +1,40 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ +var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; +}); + +module.exports = differenceWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/divide.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/divide.js new file mode 100644 index 00000000..8cae0cd1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/divide.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ +var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; +}, 1); + +module.exports = divide; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/drop.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/drop.js new file mode 100644 index 00000000..d5c3cbaa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/drop.js @@ -0,0 +1,38 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropRight.js new file mode 100644 index 00000000..441fe996 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropRight.js @@ -0,0 +1,39 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropRightWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropRightWhile.js new file mode 100644 index 00000000..9ad36a04 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropRightWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true, true) + : []; +} + +module.exports = dropRightWhile; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropWhile.js new file mode 100644 index 00000000..903ef568 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/dropWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true) + : []; +} + +module.exports = dropWhile; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/each.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/each.js new file mode 100644 index 00000000..8800f420 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/eachRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/eachRight.js new file mode 100644 index 00000000..3252b2ab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/endsWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/endsWith.js new file mode 100644 index 00000000..76fc866e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/endsWith.js @@ -0,0 +1,43 @@ +var baseClamp = require('./_baseClamp'), + baseToString = require('./_baseToString'), + toInteger = require('./toInteger'), + toString = require('./toString'); + +/** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ +function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; +} + +module.exports = endsWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/entries.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/entries.js new file mode 100644 index 00000000..7a88df20 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/entriesIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/entriesIn.js new file mode 100644 index 00000000..f6c6331c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/eq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/eq.js new file mode 100644 index 00000000..a9406880 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/eq.js @@ -0,0 +1,37 @@ +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/escape.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/escape.js new file mode 100644 index 00000000..9247e002 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/escape.js @@ -0,0 +1,43 @@ +var escapeHtmlChar = require('./_escapeHtmlChar'), + toString = require('./toString'); + +/** Used to match HTML entities and HTML characters. */ +var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + +/** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ +function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; +} + +module.exports = escape; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/escapeRegExp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/escapeRegExp.js new file mode 100644 index 00000000..0a58c69f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/escapeRegExp.js @@ -0,0 +1,32 @@ +var toString = require('./toString'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +module.exports = escapeRegExp; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/every.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/every.js new file mode 100644 index 00000000..25080dac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/every.js @@ -0,0 +1,56 @@ +var arrayEvery = require('./_arrayEvery'), + baseEvery = require('./_baseEvery'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = every; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/extend.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/extend.js new file mode 100644 index 00000000..e00166c2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/extendWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/extendWith.js new file mode 100644 index 00000000..dbdcb3b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fill.js new file mode 100644 index 00000000..ae13aa1c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fill.js @@ -0,0 +1,45 @@ +var baseFill = require('./_baseFill'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ +function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); +} + +module.exports = fill; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/filter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/filter.js new file mode 100644 index 00000000..52616be8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/filter.js @@ -0,0 +1,48 @@ +var arrayFilter = require('./_arrayFilter'), + baseFilter = require('./_baseFilter'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/find.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/find.js new file mode 100644 index 00000000..de732ccb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/find.js @@ -0,0 +1,42 @@ +var createFind = require('./_createFind'), + findIndex = require('./findIndex'); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findIndex.js new file mode 100644 index 00000000..4689069f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findIndex.js @@ -0,0 +1,55 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findKey.js new file mode 100644 index 00000000..cac0248a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwn = require('./_baseForOwn'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ +function findKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); +} + +module.exports = findKey; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLast.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLast.js new file mode 100644 index 00000000..70b4271d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLast.js @@ -0,0 +1,25 @@ +var createFind = require('./_createFind'), + findLastIndex = require('./findLastIndex'); + +/** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ +var findLast = createFind(findLastIndex); + +module.exports = findLast; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLastIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLastIndex.js new file mode 100644 index 00000000..7da3431f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLastIndex.js @@ -0,0 +1,59 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ +function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index, true); +} + +module.exports = findLastIndex; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLastKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLastKey.js new file mode 100644 index 00000000..66fb9fbc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/findLastKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwnRight = require('./_baseForOwnRight'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ +function findLastKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); +} + +module.exports = findLastKey; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/first.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/first.js new file mode 100644 index 00000000..53f4ad13 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMap.js new file mode 100644 index 00000000..e6685068 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMap.js @@ -0,0 +1,29 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); +} + +module.exports = flatMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMapDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMapDeep.js new file mode 100644 index 00000000..4653d603 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMapDeep.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); +} + +module.exports = flatMapDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMapDepth.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMapDepth.js new file mode 100644 index 00000000..6d72005c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatMapDepth.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'), + toInteger = require('./toInteger'); + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ +function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); +} + +module.exports = flatMapDepth; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatten.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatten.js new file mode 100644 index 00000000..3f09f7f7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flatten.js @@ -0,0 +1,22 @@ +var baseFlatten = require('./_baseFlatten'); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flattenDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flattenDeep.js new file mode 100644 index 00000000..8ad585cf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flattenDeep.js @@ -0,0 +1,25 @@ +var baseFlatten = require('./_baseFlatten'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ +function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; +} + +module.exports = flattenDeep; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flattenDepth.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flattenDepth.js new file mode 100644 index 00000000..441fdcc2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flattenDepth.js @@ -0,0 +1,33 @@ +var baseFlatten = require('./_baseFlatten'), + toInteger = require('./toInteger'); + +/** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); +} + +module.exports = flattenDepth; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flip.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flip.js new file mode 100644 index 00000000..c28dd789 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flip.js @@ -0,0 +1,28 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ +function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); +} + +module.exports = flip; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/floor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/floor.js new file mode 100644 index 00000000..ab6dfa28 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/floor.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded down to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round down. + * @param {number} [precision=0] The precision to round down to. + * @returns {number} Returns the rounded down number. + * @example + * + * _.floor(4.006); + * // => 4 + * + * _.floor(0.046, 2); + * // => 0.04 + * + * _.floor(4060, -2); + * // => 4000 + */ +var floor = createRound('floor'); + +module.exports = floor; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flow.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flow.js new file mode 100644 index 00000000..74b6b62d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flow.js @@ -0,0 +1,27 @@ +var createFlow = require('./_createFlow'); + +/** + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flowRight + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow([_.add, square]); + * addSquare(1, 2); + * // => 9 + */ +var flow = createFlow(); + +module.exports = flow; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flowRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flowRight.js new file mode 100644 index 00000000..11461410 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/flowRight.js @@ -0,0 +1,26 @@ +var createFlow = require('./_createFlow'); + +/** + * This method is like `_.flow` except that it creates a function that + * invokes the given functions from right to left. + * + * @static + * @since 3.0.0 + * @memberOf _ + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flow + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight([square, _.add]); + * addSquare(1, 2); + * // => 9 + */ +var flowRight = createFlow(true); + +module.exports = flowRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forEach.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forEach.js new file mode 100644 index 00000000..c64eaa73 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forEach.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseEach = require('./_baseEach'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forEachRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forEachRight.js new file mode 100644 index 00000000..7390ebaf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forEachRight.js @@ -0,0 +1,31 @@ +var arrayEachRight = require('./_arrayEachRight'), + baseEachRight = require('./_baseEachRight'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ +function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEachRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forIn.js new file mode 100644 index 00000000..583a5963 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forIn.js @@ -0,0 +1,39 @@ +var baseFor = require('./_baseFor'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ +function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, castFunction(iteratee), keysIn); +} + +module.exports = forIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forInRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forInRight.js new file mode 100644 index 00000000..4aedf58a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forInRight.js @@ -0,0 +1,37 @@ +var baseForRight = require('./_baseForRight'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ +function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, castFunction(iteratee), keysIn); +} + +module.exports = forInRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forOwn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forOwn.js new file mode 100644 index 00000000..94eed840 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forOwn.js @@ -0,0 +1,36 @@ +var baseForOwn = require('./_baseForOwn'), + castFunction = require('./_castFunction'); + +/** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} + +module.exports = forOwn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forOwnRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forOwnRight.js new file mode 100644 index 00000000..86f338f0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/forOwnRight.js @@ -0,0 +1,34 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + castFunction = require('./_castFunction'); + +/** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ +function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, castFunction(iteratee)); +} + +module.exports = forOwnRight; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp.js new file mode 100644 index 00000000..e372dbbd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp.js @@ -0,0 +1,2 @@ +var _ = require('./lodash.min').runInContext(); +module.exports = require('./fp/_baseConvert')(_, _); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/F.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/F.js new file mode 100644 index 00000000..a05a63ad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/F.js @@ -0,0 +1 @@ +module.exports = require('./stubFalse'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/T.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/T.js new file mode 100644 index 00000000..e2ba8ea5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/T.js @@ -0,0 +1 @@ +module.exports = require('./stubTrue'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/__.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/__.js new file mode 100644 index 00000000..4af98deb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/__.js @@ -0,0 +1 @@ +module.exports = require('./placeholder'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_baseConvert.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_baseConvert.js new file mode 100644 index 00000000..9baf8e19 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_baseConvert.js @@ -0,0 +1,569 @@ +var mapping = require('./_mapping'), + fallbackHolder = require('./placeholder'); + +/** Built-in value reference. */ +var push = Array.prototype.push; + +/** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ +function baseArity(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; +} + +/** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ +function baseAry(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; +} + +/** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ +function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; + } + return result; +} + +/** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ +function createCloner(func) { + return function(object) { + return func({}, object); + }; +} + +/** + * A specialized version of `_.spread` which flattens the spread array into + * the arguments of the invoked `func`. + * + * @private + * @param {Function} func The function to spread arguments over. + * @param {number} start The start position of the spread. + * @returns {Function} Returns the new function. + */ +function flatSpread(func, start) { + return function() { + var length = arguments.length, + lastIndex = length - 1, + args = Array(length); + + while (length--) { + args[length] = arguments[length]; + } + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + push.apply(otherArgs, array); + } + if (start != lastIndex) { + push.apply(otherArgs, args.slice(start + 1)); + } + return func.apply(this, otherArgs); + }; +} + +/** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ +function wrapImmutable(func, cloner) { + return function() { + var length = arguments.length; + if (!length) { + return; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; +} + +/** + * The base implementation of `convert` which accepts a `util` object of methods + * required to perform conversions. + * + * @param {Object} util The util object. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. + * @returns {Function|Object} Returns the converted function or object. + */ +function baseConvert(util, name, func, options) { + var isLib = typeof name == 'function', + isObj = name === Object(name); + + if (isObj) { + options = func; + func = name; + name = undefined; + } + if (func == null) { + throw new TypeError; + } + options || (options = {}); + + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var defaultHolder = isLib ? func : fallbackHolder, + forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + pristine = isLib ? func.runInContext() : undefined; + + var helpers = isLib ? func : { + 'ary': util.ary, + 'assign': util.assign, + 'clone': util.clone, + 'curry': util.curry, + 'forEach': util.forEach, + 'isArray': util.isArray, + 'isError': util.isError, + 'isFunction': util.isFunction, + 'isWeakMap': util.isWeakMap, + 'iteratee': util.iteratee, + 'keys': util.keys, + 'rearg': util.rearg, + 'toInteger': util.toInteger, + 'toPath': util.toPath + }; + + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isError = helpers.isError, + isFunction = helpers.isFunction, + isWeakMap = helpers.isWeakMap, + keys = helpers.keys, + rearg = helpers.rearg, + toInteger = helpers.toInteger, + toPath = helpers.toPath; + + var aryMethodKeys = keys(mapping.aryMethod); + + var wrappers = { + 'castArray': function(castArray) { + return function() { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, + 'iteratee': function(iteratee) { + return function() { + var func = arguments[0], + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; + + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); + } + return result; + }; + }, + 'mixin': function(mixin) { + return function(source) { + var func = this; + if (!isFunction(func)) { + return mixin(func, Object(source)); + } + var pairs = []; + each(keys(source), function(key) { + if (isFunction(source[key])) { + pairs.push([key, func.prototype[key]]); + } + }); + + mixin(func, Object(source)); + + each(pairs, function(pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; + } else { + delete func.prototype[pair[0]]; + } + }); + return func; + }; + }, + 'nthArg': function(nthArg) { + return function(n) { + var arity = n < 0 ? 1 : (toInteger(n) + 1); + return curry(nthArg(n), arity); + }; + }, + 'rearg': function(rearg) { + return function(func, indexes) { + var arity = indexes ? indexes.length : 0; + return curry(rearg(func, indexes), arity); + }; + }, + 'runInContext': function(runInContext) { + return function(context) { + return baseConvert(util, runInContext(context), options); + }; + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Casts `func` to a function with an arity capped iteratee if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @returns {Function} Returns the cast function. + */ + function castCap(name, func) { + if (config.cap) { + var indexes = mapping.iterateeRearg[name]; + if (indexes) { + return iterateeRearg(func, indexes); + } + var n = !isLib && mapping.iterateeAry[name]; + if (n) { + return iterateeAry(func, n); + } + } + return func; + } + + /** + * Casts `func` to a curried function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castCurry(name, func, n) { + return (forceCurry || (config.curry && n > 1)) + ? curry(func, n) + : func; + } + + /** + * Casts `func` to a fixed arity function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity cap. + * @returns {Function} Returns the cast function. + */ + function castFixed(name, func, n) { + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { + var data = mapping.methodSpread[name], + start = data && data.start; + + return start === undefined ? ary(func, n) : flatSpread(func, start); + } + return func; + } + + /** + * Casts `func` to an rearged function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castRearg(name, func, n) { + return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) + ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) + : func; + } + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null && + !(isFunction(value) || isError(value) || isWeakMap(value))) { + nested[key] = clone(index == lastIndex ? value : Object(value)); + } + nested = nested[key]; + } + return result; + } + + /** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var realName = mapping.aliasToReal[name] || name, + methodName = mapping.remap[realName] || realName, + oldOptions = options; + + return function(options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[methodName] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, realName, newFunc, newOptions); + }; + } + + /** + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. + * + * @private + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function iterateeAry(func, n) { + return overArg(func, function(func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); + } + + /** + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function() { + var length = arguments.length; + if (!length) { + return func(); + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); + }; + } + + /** + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. + * + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. + */ + function wrap(name, func, placeholder) { + var result, + realName = mapping.aliasToReal[name] || name, + wrapped = func, + wrapper = wrappers[realName]; + + if (wrapper) { + wrapped = wrapper(func); + } + else if (config.immutable) { + if (mapping.mutate.array[realName]) { + wrapped = wrapImmutable(func, cloneArray); + } + else if (mapping.mutate.object[realName]) { + wrapped = wrapImmutable(func, createCloner(func)); + } + else if (mapping.mutate.set[realName]) { + wrapped = wrapImmutable(func, cloneByPath); + } + } + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(otherName) { + if (realName == otherName) { + var data = mapping.methodSpread[realName], + afterRearg = data && data.afterRearg; + + result = afterRearg + ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) + : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); + + result = castCap(realName, result); + result = castCurry(realName, result, aryKey); + return false; + } + }); + return !result; + }); + + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function() { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(realName, func); + result.placeholder = func.placeholder = placeholder; + + return result; + } + + /*--------------------------------------------------------------------------*/ + + if (!isObj) { + return wrap(name, func, defaultHolder); + } + var _ = func; + + // Convert methods by ary cap. + var pairs = []; + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(key) { + var func = _[mapping.remap[key] || key]; + if (func) { + pairs.push([key, wrap(key, func, _)]); + } + }); + }); + + // Convert remaining methods. + each(keys(_), function(key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. + each(pairs, function(pair) { + _[pair[0]] = pair[1]; + }); + + _.convert = convertLib; + _.placeholder = _; + + // Assign aliases. + each(keys(_), function(key) { + each(mapping.realToAlias[key] || [], function(alias) { + _[alias] = _[key]; + }); + }); + + return _; +} + +module.exports = baseConvert; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_convertBrowser.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_convertBrowser.js new file mode 100644 index 00000000..bde030dc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_convertBrowser.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'); + +/** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Function} lodash The lodash function to convert. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ +function browserConvert(lodash, options) { + return baseConvert(lodash, lodash, options); +} + +if (typeof _ == 'function' && typeof _.runInContext == 'function') { + _ = browserConvert(_.runInContext()); +} +module.exports = browserConvert; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_falseOptions.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_falseOptions.js new file mode 100644 index 00000000..773235e3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_falseOptions.js @@ -0,0 +1,7 @@ +module.exports = { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_mapping.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_mapping.js new file mode 100644 index 00000000..a642ec05 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_mapping.js @@ -0,0 +1,358 @@ +/** Used to map aliases to their real names. */ +exports.aliasToReal = { + + // Lodash aliases. + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'entries': 'toPairs', + 'entriesIn': 'toPairsIn', + 'extend': 'assignIn', + 'extendAll': 'assignInAll', + 'extendAllWith': 'assignInAllWith', + 'extendWith': 'assignInWith', + 'first': 'head', + + // Methods that are curried variants of others. + 'conforms': 'conformsTo', + 'matches': 'isMatch', + 'property': 'get', + + // Ramda aliases. + '__': 'placeholder', + 'F': 'stubFalse', + 'T': 'stubTrue', + 'all': 'every', + 'allPass': 'overEvery', + 'always': 'constant', + 'any': 'some', + 'anyPass': 'overSome', + 'apply': 'spread', + 'assoc': 'set', + 'assocPath': 'set', + 'complement': 'negate', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'unset', + 'dissocPath': 'unset', + 'dropLast': 'dropRight', + 'dropLastWhile': 'dropRightWhile', + 'equals': 'isEqual', + 'identical': 'eq', + 'indexBy': 'keyBy', + 'init': 'initial', + 'invertObj': 'invert', + 'juxt': 'over', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'paths': 'at', + 'pickAll': 'pick', + 'pipe': 'flow', + 'pluck': 'map', + 'prop': 'get', + 'propEq': 'matchesProperty', + 'propOr': 'getOr', + 'props': 'at', + 'symmetricDifference': 'xor', + 'symmetricDifferenceBy': 'xorBy', + 'symmetricDifferenceWith': 'xorWith', + 'takeLast': 'takeRight', + 'takeLastWhile': 'takeRightWhile', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'where': 'conformsTo', + 'whereEq': 'isMatch', + 'zipObj': 'zipObject' +}; + +/** Used to map ary to method names. */ +exports.aryMethod = { + '1': [ + 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', + 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', + 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', + 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', + 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', + 'uniqueId', 'words', 'zipAll' + ], + '2': [ + 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', + 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', + 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', + 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', + 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', + 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', + 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', + 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', + 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', + 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', + 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', + 'zipObjectDeep' + ], + '3': [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', + 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', + 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', + 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', + 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', + 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', + 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', + 'xorWith', 'zipWith' + ], + '4': [ + 'fill', 'setWith', 'updateWith' + ] +}; + +/** Used to map ary to rearg configs. */ +exports.aryRearg = { + '2': [1, 0], + '3': [2, 0, 1], + '4': [3, 2, 0, 1] +}; + +/** Used to map method names to their iteratee ary. */ +exports.iterateeAry = { + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findFrom': 1, + 'findIndex': 1, + 'findIndexFrom': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastFrom': 1, + 'findLastIndex': 1, + 'findLastIndexFrom': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'flatMapDeep': 1, + 'flatMapDepth': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 +}; + +/** Used to map method names to iteratee rearg configs. */ +exports.iterateeRearg = { + 'mapKeys': [1], + 'reduceRight': [1, 0] +}; + +/** Used to map method names to rearg configs. */ +exports.methodRearg = { + 'assignInAllWith': [1, 0], + 'assignInWith': [1, 2, 0], + 'assignAllWith': [1, 0], + 'assignWith': [1, 2, 0], + 'differenceBy': [1, 2, 0], + 'differenceWith': [1, 2, 0], + 'getOr': [2, 1, 0], + 'intersectionBy': [1, 2, 0], + 'intersectionWith': [1, 2, 0], + 'isEqualWith': [1, 2, 0], + 'isMatchWith': [2, 1, 0], + 'mergeAllWith': [1, 0], + 'mergeWith': [1, 2, 0], + 'padChars': [2, 1, 0], + 'padCharsEnd': [2, 1, 0], + 'padCharsStart': [2, 1, 0], + 'pullAllBy': [2, 1, 0], + 'pullAllWith': [2, 1, 0], + 'rangeStep': [1, 2, 0], + 'rangeStepRight': [1, 2, 0], + 'setWith': [3, 1, 2, 0], + 'sortedIndexBy': [2, 1, 0], + 'sortedLastIndexBy': [2, 1, 0], + 'unionBy': [1, 2, 0], + 'unionWith': [1, 2, 0], + 'updateWith': [3, 1, 2, 0], + 'xorBy': [1, 2, 0], + 'xorWith': [1, 2, 0], + 'zipWith': [1, 2, 0] +}; + +/** Used to map method names to spread configs. */ +exports.methodSpread = { + 'assignAll': { 'start': 0 }, + 'assignAllWith': { 'start': 0 }, + 'assignInAll': { 'start': 0 }, + 'assignInAllWith': { 'start': 0 }, + 'defaultsAll': { 'start': 0 }, + 'defaultsDeepAll': { 'start': 0 }, + 'invokeArgs': { 'start': 2 }, + 'invokeArgsMap': { 'start': 2 }, + 'mergeAll': { 'start': 0 }, + 'mergeAllWith': { 'start': 0 }, + 'partial': { 'start': 1 }, + 'partialRight': { 'start': 1 }, + 'without': { 'start': 1 }, + 'zipAll': { 'start': 0 } +}; + +/** Used to identify methods which mutate arrays or objects. */ +exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAllWith': true, + 'pullAt': true, + 'remove': true, + 'reverse': true + }, + 'object': { + 'assign': true, + 'assignAll': true, + 'assignAllWith': true, + 'assignIn': true, + 'assignInAll': true, + 'assignInAllWith': true, + 'assignInWith': true, + 'assignWith': true, + 'defaults': true, + 'defaultsAll': true, + 'defaultsDeep': true, + 'defaultsDeepAll': true, + 'merge': true, + 'mergeAll': true, + 'mergeAllWith': true, + 'mergeWith': true, + }, + 'set': { + 'set': true, + 'setWith': true, + 'unset': true, + 'update': true, + 'updateWith': true + } +}; + +/** Used to map real names to their aliases. */ +exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + } + return result; +}()); + +/** Used to map method names to other names. */ +exports.remap = { + 'assignAll': 'assign', + 'assignAllWith': 'assignWith', + 'assignInAll': 'assignIn', + 'assignInAllWith': 'assignInWith', + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'defaultsAll': 'defaults', + 'defaultsDeepAll': 'defaultsDeep', + 'findFrom': 'find', + 'findIndexFrom': 'findIndex', + 'findLastFrom': 'findLast', + 'findLastIndexFrom': 'findLastIndex', + 'getOr': 'get', + 'includesFrom': 'includes', + 'indexOfFrom': 'indexOf', + 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', + 'lastIndexOfFrom': 'lastIndexOf', + 'mergeAll': 'merge', + 'mergeAllWith': 'mergeWith', + 'padChars': 'pad', + 'padCharsEnd': 'padEnd', + 'padCharsStart': 'padStart', + 'propertyOf': 'get', + 'rangeStep': 'range', + 'rangeStepRight': 'rangeRight', + 'restFrom': 'rest', + 'spreadFrom': 'spread', + 'trimChars': 'trim', + 'trimCharsEnd': 'trimEnd', + 'trimCharsStart': 'trimStart', + 'zipAll': 'zip' +}; + +/** Used to track methods that skip fixing their arity. */ +exports.skipFixed = { + 'castArray': true, + 'flow': true, + 'flowRight': true, + 'iteratee': true, + 'mixin': true, + 'rearg': true, + 'runInContext': true +}; + +/** Used to track methods that skip rearranging arguments. */ +exports.skipRearg = { + 'add': true, + 'assign': true, + 'assignIn': true, + 'bind': true, + 'bindKey': true, + 'concat': true, + 'difference': true, + 'divide': true, + 'eq': true, + 'gt': true, + 'gte': true, + 'isEqual': true, + 'lt': true, + 'lte': true, + 'matchesProperty': true, + 'merge': true, + 'multiply': true, + 'overArgs': true, + 'partial': true, + 'partialRight': true, + 'propertyOf': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'subtract': true, + 'zip': true, + 'zipObject': true, + 'zipObjectDeep': true +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_util.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_util.js new file mode 100644 index 00000000..1dbf36f5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/_util.js @@ -0,0 +1,16 @@ +module.exports = { + 'ary': require('../ary'), + 'assign': require('../_baseAssign'), + 'clone': require('../clone'), + 'curry': require('../curry'), + 'forEach': require('../_arrayEach'), + 'isArray': require('../isArray'), + 'isError': require('../isError'), + 'isFunction': require('../isFunction'), + 'isWeakMap': require('../isWeakMap'), + 'iteratee': require('../iteratee'), + 'keys': require('../_baseKeys'), + 'rearg': require('../rearg'), + 'toInteger': require('../toInteger'), + 'toPath': require('../toPath') +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/add.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/add.js new file mode 100644 index 00000000..816eeece --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/add.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('add', require('../add')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/after.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/after.js new file mode 100644 index 00000000..21a0167a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/after.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('after', require('../after')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/all.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/all.js new file mode 100644 index 00000000..d0839f77 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/all.js @@ -0,0 +1 @@ +module.exports = require('./every'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/allPass.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/allPass.js new file mode 100644 index 00000000..79b73ef8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/allPass.js @@ -0,0 +1 @@ +module.exports = require('./overEvery'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/always.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/always.js new file mode 100644 index 00000000..98877030 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/always.js @@ -0,0 +1 @@ +module.exports = require('./constant'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/any.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/any.js new file mode 100644 index 00000000..900ac25e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/any.js @@ -0,0 +1 @@ +module.exports = require('./some'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/anyPass.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/anyPass.js new file mode 100644 index 00000000..2774ab37 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/anyPass.js @@ -0,0 +1 @@ +module.exports = require('./overSome'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/apply.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/apply.js new file mode 100644 index 00000000..2b757129 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/apply.js @@ -0,0 +1 @@ +module.exports = require('./spread'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/array.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/array.js new file mode 100644 index 00000000..fe939c2c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/array.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../array')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/ary.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/ary.js new file mode 100644 index 00000000..8edf1877 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/ary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ary', require('../ary')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assign.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assign.js new file mode 100644 index 00000000..23f47af1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assign.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assign', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignAll.js new file mode 100644 index 00000000..b1d36c7e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAll', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignAllWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignAllWith.js new file mode 100644 index 00000000..21e836e6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAllWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignIn.js new file mode 100644 index 00000000..6e7c65fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignIn', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInAll.js new file mode 100644 index 00000000..7ba75dba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAll', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInAllWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInAllWith.js new file mode 100644 index 00000000..e766903d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAllWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInWith.js new file mode 100644 index 00000000..acb59236 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignInWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignWith.js new file mode 100644 index 00000000..eb925212 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assignWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assoc.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assoc.js new file mode 100644 index 00000000..7648820c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assoc.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assocPath.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assocPath.js new file mode 100644 index 00000000..7648820c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/assocPath.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/at.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/at.js new file mode 100644 index 00000000..cc39d257 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/at.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('at', require('../at')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/attempt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/attempt.js new file mode 100644 index 00000000..26ca42ea --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/attempt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('attempt', require('../attempt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/before.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/before.js new file mode 100644 index 00000000..7a2de65d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/before.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('before', require('../before')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bind.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bind.js new file mode 100644 index 00000000..5cbe4f30 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bind.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bind', require('../bind')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bindAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bindAll.js new file mode 100644 index 00000000..6b4a4a0f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bindAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindAll', require('../bindAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bindKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bindKey.js new file mode 100644 index 00000000..6a46c6b1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/bindKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindKey', require('../bindKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/camelCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/camelCase.js new file mode 100644 index 00000000..87b77b49 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/camelCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('camelCase', require('../camelCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/capitalize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/capitalize.js new file mode 100644 index 00000000..cac74e14 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/capitalize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('capitalize', require('../capitalize'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/castArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/castArray.js new file mode 100644 index 00000000..8681c099 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/castArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('castArray', require('../castArray')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/ceil.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/ceil.js new file mode 100644 index 00000000..f416b729 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/ceil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ceil', require('../ceil')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/chain.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/chain.js new file mode 100644 index 00000000..604fe398 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/chain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chain', require('../chain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/chunk.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/chunk.js new file mode 100644 index 00000000..871ab085 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/chunk.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chunk', require('../chunk')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/clamp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/clamp.js new file mode 100644 index 00000000..3b06c01c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/clamp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clamp', require('../clamp')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/clone.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/clone.js new file mode 100644 index 00000000..cadb59c9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/clone.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clone', require('../clone'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneDeep.js new file mode 100644 index 00000000..a6107aac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneDeepWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneDeepWith.js new file mode 100644 index 00000000..6f01e44a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneDeepWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeepWith', require('../cloneDeepWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneWith.js new file mode 100644 index 00000000..aa885781 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cloneWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneWith', require('../cloneWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/collection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/collection.js new file mode 100644 index 00000000..fc8b328a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/collection.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../collection')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/commit.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/commit.js new file mode 100644 index 00000000..130a894f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/commit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('commit', require('../commit'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/compact.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/compact.js new file mode 100644 index 00000000..ce8f7a1a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/compact.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('compact', require('../compact'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/complement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/complement.js new file mode 100644 index 00000000..93eb462b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/complement.js @@ -0,0 +1 @@ +module.exports = require('./negate'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/compose.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/compose.js new file mode 100644 index 00000000..1954e942 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/compose.js @@ -0,0 +1 @@ +module.exports = require('./flowRight'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/concat.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/concat.js new file mode 100644 index 00000000..e59346ad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/concat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('concat', require('../concat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cond.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cond.js new file mode 100644 index 00000000..6a0120ef --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/cond.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cond', require('../cond'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/conforms.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/conforms.js new file mode 100644 index 00000000..3247f64a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/conforms.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/conformsTo.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/conformsTo.js new file mode 100644 index 00000000..aa7f41ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/conformsTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('conformsTo', require('../conformsTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/constant.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/constant.js new file mode 100644 index 00000000..9e406fc0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/constant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('constant', require('../constant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/contains.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/contains.js new file mode 100644 index 00000000..594722af --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/contains.js @@ -0,0 +1 @@ +module.exports = require('./includes'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/convert.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/convert.js new file mode 100644 index 00000000..4795dc42 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/convert.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'), + util = require('./_util'); + +/** + * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. If `name` is an object its methods + * will be converted. + * + * @param {string} name The name of the function to wrap. + * @param {Function} [func] The function to wrap. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function|Object} Returns the converted function or object. + */ +function convert(name, func, options) { + return baseConvert(util, name, func, options); +} + +module.exports = convert; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/countBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/countBy.js new file mode 100644 index 00000000..dfa46432 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/countBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('countBy', require('../countBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/create.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/create.js new file mode 100644 index 00000000..752025fb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/create.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('create', require('../create')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curry.js new file mode 100644 index 00000000..b0b4168c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curry.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curry', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryN.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryN.js new file mode 100644 index 00000000..2ae7d00a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryN', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryRight.js new file mode 100644 index 00000000..cb619eb5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRight', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryRightN.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryRightN.js new file mode 100644 index 00000000..2495afc8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/curryRightN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRightN', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/date.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/date.js new file mode 100644 index 00000000..82cb952b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/date.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../date')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/debounce.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/debounce.js new file mode 100644 index 00000000..26122293 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/debounce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('debounce', require('../debounce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/deburr.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/deburr.js new file mode 100644 index 00000000..96463ab8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/deburr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('deburr', require('../deburr'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultTo.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultTo.js new file mode 100644 index 00000000..d6b52a44 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultTo', require('../defaultTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaults.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaults.js new file mode 100644 index 00000000..e1a8e6e7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaults.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaults', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsAll.js new file mode 100644 index 00000000..238fcc3c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsAll', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsDeep.js new file mode 100644 index 00000000..1f172ff9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeep', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsDeepAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsDeepAll.js new file mode 100644 index 00000000..6835f2f0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defaultsDeepAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeepAll', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defer.js new file mode 100644 index 00000000..ec7990fe --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/defer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defer', require('../defer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/delay.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/delay.js new file mode 100644 index 00000000..556dbd56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/delay.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('delay', require('../delay')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/difference.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/difference.js new file mode 100644 index 00000000..2d037654 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/difference.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('difference', require('../difference')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/differenceBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/differenceBy.js new file mode 100644 index 00000000..2f914910 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/differenceBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceBy', require('../differenceBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/differenceWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/differenceWith.js new file mode 100644 index 00000000..bcf5ad2e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/differenceWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceWith', require('../differenceWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dissoc.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dissoc.js new file mode 100644 index 00000000..7ec7be19 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dissoc.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dissocPath.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dissocPath.js new file mode 100644 index 00000000..7ec7be19 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dissocPath.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/divide.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/divide.js new file mode 100644 index 00000000..82048c5e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/divide.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('divide', require('../divide')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/drop.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/drop.js new file mode 100644 index 00000000..2fa9b4fa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/drop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('drop', require('../drop')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropLast.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropLast.js new file mode 100644 index 00000000..174e5255 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropLast.js @@ -0,0 +1 @@ +module.exports = require('./dropRight'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropLastWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropLastWhile.js new file mode 100644 index 00000000..be2a9d24 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./dropRightWhile'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropRight.js new file mode 100644 index 00000000..e98881fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRight', require('../dropRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropRightWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropRightWhile.js new file mode 100644 index 00000000..cacaa701 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRightWhile', require('../dropRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropWhile.js new file mode 100644 index 00000000..285f864d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/dropWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropWhile', require('../dropWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/each.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/each.js new file mode 100644 index 00000000..8800f420 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/eachRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/eachRight.js new file mode 100644 index 00000000..3252b2ab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/endsWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/endsWith.js new file mode 100644 index 00000000..17dc2a49 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/endsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('endsWith', require('../endsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/entries.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/entries.js new file mode 100644 index 00000000..7a88df20 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/entriesIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/entriesIn.js new file mode 100644 index 00000000..f6c6331c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/eq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/eq.js new file mode 100644 index 00000000..9a3d21bf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/eq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('eq', require('../eq')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/equals.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/equals.js new file mode 100644 index 00000000..e6a5ce0c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/equals.js @@ -0,0 +1 @@ +module.exports = require('./isEqual'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/escape.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/escape.js new file mode 100644 index 00000000..52c1fbba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/escape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escape', require('../escape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/escapeRegExp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/escapeRegExp.js new file mode 100644 index 00000000..369b2eff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/escapeRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/every.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/every.js new file mode 100644 index 00000000..95c2776c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/every.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('every', require('../every')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extend.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extend.js new file mode 100644 index 00000000..e00166c2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendAll.js new file mode 100644 index 00000000..cc55b64f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendAll.js @@ -0,0 +1 @@ +module.exports = require('./assignInAll'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendAllWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendAllWith.js new file mode 100644 index 00000000..6679d208 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendAllWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInAllWith'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendWith.js new file mode 100644 index 00000000..dbdcb3b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/fill.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/fill.js new file mode 100644 index 00000000..b2d47e84 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/fill.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fill', require('../fill')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/filter.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/filter.js new file mode 100644 index 00000000..796d501c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/filter.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('filter', require('../filter')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/find.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/find.js new file mode 100644 index 00000000..f805d336 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/find.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('find', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findFrom.js new file mode 100644 index 00000000..da8275e8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findFrom', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findIndex.js new file mode 100644 index 00000000..8c15fd11 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndex', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findIndexFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findIndexFrom.js new file mode 100644 index 00000000..32e98cb9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndexFrom', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findKey.js new file mode 100644 index 00000000..475bcfa8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findKey', require('../findKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLast.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLast.js new file mode 100644 index 00000000..093fe94e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLast.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLast', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastFrom.js new file mode 100644 index 00000000..76c38fba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastFrom', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastIndex.js new file mode 100644 index 00000000..36986df0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndex', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastIndexFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastIndexFrom.js new file mode 100644 index 00000000..34c8176c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndexFrom', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastKey.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastKey.js new file mode 100644 index 00000000..5f81b604 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/findLastKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastKey', require('../findLastKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/first.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/first.js new file mode 100644 index 00000000..53f4ad13 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMap.js new file mode 100644 index 00000000..d01dc4d0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMap', require('../flatMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMapDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMapDeep.js new file mode 100644 index 00000000..569c42eb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMapDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDeep', require('../flatMapDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMapDepth.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMapDepth.js new file mode 100644 index 00000000..6eb68fde --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatMapDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDepth', require('../flatMapDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatten.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatten.js new file mode 100644 index 00000000..30425d89 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flatten.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatten', require('../flatten'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flattenDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flattenDeep.js new file mode 100644 index 00000000..aed5db27 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flattenDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flattenDepth.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flattenDepth.js new file mode 100644 index 00000000..ad65e378 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flattenDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDepth', require('../flattenDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flip.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flip.js new file mode 100644 index 00000000..0547e7b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flip', require('../flip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/floor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/floor.js new file mode 100644 index 00000000..a6cf3358 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/floor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('floor', require('../floor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flow.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flow.js new file mode 100644 index 00000000..cd83677a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flow.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flow', require('../flow')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flowRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flowRight.js new file mode 100644 index 00000000..972a5b9b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/flowRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flowRight', require('../flowRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forEach.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forEach.js new file mode 100644 index 00000000..2f494521 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forEach.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEach', require('../forEach')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forEachRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forEachRight.js new file mode 100644 index 00000000..3ff97336 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forEachRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEachRight', require('../forEachRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forIn.js new file mode 100644 index 00000000..9341749b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forIn', require('../forIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forInRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forInRight.js new file mode 100644 index 00000000..cecf8bbf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forInRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forInRight', require('../forInRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forOwn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forOwn.js new file mode 100644 index 00000000..246449e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forOwn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwn', require('../forOwn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forOwnRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forOwnRight.js new file mode 100644 index 00000000..c5e826e0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/forOwnRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwnRight', require('../forOwnRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/fromPairs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/fromPairs.js new file mode 100644 index 00000000..f8cc5968 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/fromPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fromPairs', require('../fromPairs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/function.js new file mode 100644 index 00000000..dfe69b1f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/function.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../function')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/functions.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/functions.js new file mode 100644 index 00000000..09d1bb1b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/functions.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functions', require('../functions'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/functionsIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/functionsIn.js new file mode 100644 index 00000000..2cfeb83e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/functionsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/get.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/get.js new file mode 100644 index 00000000..6d3a3286 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/get.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('get', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/getOr.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/getOr.js new file mode 100644 index 00000000..7dbf771f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/getOr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('getOr', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/groupBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/groupBy.js new file mode 100644 index 00000000..fc0bc78a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/groupBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('groupBy', require('../groupBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/gt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/gt.js new file mode 100644 index 00000000..9e57c808 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/gt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gt', require('../gt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/gte.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/gte.js new file mode 100644 index 00000000..45847863 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/gte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gte', require('../gte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/has.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/has.js new file mode 100644 index 00000000..b9012983 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/has.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('has', require('../has')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/hasIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/hasIn.js new file mode 100644 index 00000000..b3c3d1a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/hasIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('hasIn', require('../hasIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/head.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/head.js new file mode 100644 index 00000000..2694f0a2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/head.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('head', require('../head'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/identical.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/identical.js new file mode 100644 index 00000000..85563f4a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/identical.js @@ -0,0 +1 @@ +module.exports = require('./eq'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/identity.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/identity.js new file mode 100644 index 00000000..096415a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/identity.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('identity', require('../identity'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/inRange.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/inRange.js new file mode 100644 index 00000000..202d940b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/inRange.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('inRange', require('../inRange')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/includes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/includes.js new file mode 100644 index 00000000..11467805 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/includes.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includes', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/includesFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/includesFrom.js new file mode 100644 index 00000000..683afdb4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/includesFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includesFrom', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexBy.js new file mode 100644 index 00000000..7e64bc0f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexBy.js @@ -0,0 +1 @@ +module.exports = require('./keyBy'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexOf.js new file mode 100644 index 00000000..524658eb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOf', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexOfFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexOfFrom.js new file mode 100644 index 00000000..d99c822f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/indexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOfFrom', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/init.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/init.js new file mode 100644 index 00000000..2f88d8b0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/init.js @@ -0,0 +1 @@ +module.exports = require('./initial'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/initial.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/initial.js new file mode 100644 index 00000000..b732ba0b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/initial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('initial', require('../initial'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersection.js new file mode 100644 index 00000000..52936d56 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersection.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersection', require('../intersection')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersectionBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersectionBy.js new file mode 100644 index 00000000..72629f27 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersectionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionBy', require('../intersectionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersectionWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersectionWith.js new file mode 100644 index 00000000..e064f400 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/intersectionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionWith', require('../intersectionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invert.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invert.js new file mode 100644 index 00000000..2d5d1f0d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invert.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invert', require('../invert')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invertBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invertBy.js new file mode 100644 index 00000000..63ca97ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invertBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invertBy', require('../invertBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invertObj.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invertObj.js new file mode 100644 index 00000000..f1d842e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invertObj.js @@ -0,0 +1 @@ +module.exports = require('./invert'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invoke.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invoke.js new file mode 100644 index 00000000..fcf17f0d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invoke.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invoke', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeArgs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeArgs.js new file mode 100644 index 00000000..d3f2953f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgs', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeArgsMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeArgsMap.js new file mode 100644 index 00000000..eaa9f84f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeArgsMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgsMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeMap.js new file mode 100644 index 00000000..6515fd73 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/invokeMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArguments.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArguments.js new file mode 100644 index 00000000..1d93c9e5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArguments.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArguments', require('../isArguments'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArray.js new file mode 100644 index 00000000..ba7ade8d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArray', require('../isArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayBuffer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayBuffer.js new file mode 100644 index 00000000..5088513f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayLike.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayLike.js new file mode 100644 index 00000000..8f1856bf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayLikeObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayLikeObject.js new file mode 100644 index 00000000..21084984 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isArrayLikeObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isBoolean.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isBoolean.js new file mode 100644 index 00000000..9339f75b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isBoolean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isBuffer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isBuffer.js new file mode 100644 index 00000000..e60b1238 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isDate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isDate.js new file mode 100644 index 00000000..dc41d089 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isDate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isDate', require('../isDate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isElement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isElement.js new file mode 100644 index 00000000..18ee039a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isElement.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isElement', require('../isElement'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEmpty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEmpty.js new file mode 100644 index 00000000..0f4ae841 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEmpty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEqual.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEqual.js new file mode 100644 index 00000000..41383865 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEqual.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqual', require('../isEqual')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEqualWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEqualWith.js new file mode 100644 index 00000000..029ff5cd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isEqualWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqualWith', require('../isEqualWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isError.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isError.js new file mode 100644 index 00000000..3dfd81cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isError.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isError', require('../isError'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isFinite.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isFinite.js new file mode 100644 index 00000000..0b647b84 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFinite', require('../isFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isFunction.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isFunction.js new file mode 100644 index 00000000..ff8e5c45 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isFunction.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFunction', require('../isFunction'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isInteger.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isInteger.js new file mode 100644 index 00000000..67af4ff6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isInteger', require('../isInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isLength.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isLength.js new file mode 100644 index 00000000..fc101c5a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isLength', require('../isLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMap.js new file mode 100644 index 00000000..a209aa66 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMap', require('../isMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMatch.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMatch.js new file mode 100644 index 00000000..6264ca17 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMatch.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatch', require('../isMatch')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMatchWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMatchWith.js new file mode 100644 index 00000000..d95f3193 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isMatchWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatchWith', require('../isMatchWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNaN.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNaN.js new file mode 100644 index 00000000..66a978f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNaN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNaN', require('../isNaN'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNative.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNative.js new file mode 100644 index 00000000..3d775ba9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNative.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNative', require('../isNative'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNil.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNil.js new file mode 100644 index 00000000..5952c028 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNil', require('../isNil'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNull.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNull.js new file mode 100644 index 00000000..f201a354 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNull', require('../isNull'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNumber.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNumber.js new file mode 100644 index 00000000..a2b5fa04 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNumber', require('../isNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isObject.js new file mode 100644 index 00000000..231ace03 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObject', require('../isObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isObjectLike.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isObjectLike.js new file mode 100644 index 00000000..f16082e6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isObjectLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isPlainObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isPlainObject.js new file mode 100644 index 00000000..b5bea90d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isRegExp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isRegExp.js new file mode 100644 index 00000000..12a1a3d7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSafeInteger.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSafeInteger.js new file mode 100644 index 00000000..7230f552 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSet.js new file mode 100644 index 00000000..35c01f6f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSet', require('../isSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isString.js new file mode 100644 index 00000000..1fd0679e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isString', require('../isString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSymbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSymbol.js new file mode 100644 index 00000000..38676956 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isSymbol.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isTypedArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isTypedArray.js new file mode 100644 index 00000000..85679538 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isTypedArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isUndefined.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isUndefined.js new file mode 100644 index 00000000..ddbca31c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isUndefined.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isWeakMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isWeakMap.js new file mode 100644 index 00000000..ef60c613 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isWeakMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isWeakSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isWeakSet.js new file mode 100644 index 00000000..c99bfaa6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/isWeakSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/iteratee.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/iteratee.js new file mode 100644 index 00000000..9f0f7173 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/iteratee.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('iteratee', require('../iteratee')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/join.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/join.js new file mode 100644 index 00000000..a220e003 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/join.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('join', require('../join')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/juxt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/juxt.js new file mode 100644 index 00000000..f71e04e0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/juxt.js @@ -0,0 +1 @@ +module.exports = require('./over'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/kebabCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/kebabCase.js new file mode 100644 index 00000000..60737f17 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/kebabCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keyBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keyBy.js new file mode 100644 index 00000000..9a6a85d4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keyBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keyBy', require('../keyBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keys.js new file mode 100644 index 00000000..e12bb07f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keys', require('../keys'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keysIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keysIn.js new file mode 100644 index 00000000..f3eb36a8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/keysIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keysIn', require('../keysIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lang.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lang.js new file mode 100644 index 00000000..08cc9c14 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lang.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../lang')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/last.js new file mode 100644 index 00000000..0f716993 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/last.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('last', require('../last'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lastIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lastIndexOf.js new file mode 100644 index 00000000..ddf39c30 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOf', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lastIndexOfFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lastIndexOfFrom.js new file mode 100644 index 00000000..1ff6a0b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lastIndexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOfFrom', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lowerCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lowerCase.js new file mode 100644 index 00000000..ea64bc15 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lowerCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lowerFirst.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lowerFirst.js new file mode 100644 index 00000000..539720a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lowerFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lt.js new file mode 100644 index 00000000..a31d21ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lt', require('../lt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lte.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lte.js new file mode 100644 index 00000000..d795d10e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/lte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lte', require('../lte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/map.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/map.js new file mode 100644 index 00000000..cf987943 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/map.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('map', require('../map')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mapKeys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mapKeys.js new file mode 100644 index 00000000..16845870 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mapKeys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapKeys', require('../mapKeys')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mapValues.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mapValues.js new file mode 100644 index 00000000..40049727 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mapValues.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapValues', require('../mapValues')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/matches.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/matches.js new file mode 100644 index 00000000..29d1e1e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/matches.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/matchesProperty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/matchesProperty.js new file mode 100644 index 00000000..4575bd24 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/matchesProperty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('matchesProperty', require('../matchesProperty')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/math.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/math.js new file mode 100644 index 00000000..e8f50f79 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/math.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../math')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/max.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/max.js new file mode 100644 index 00000000..a66acac2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/max.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('max', require('../max'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/maxBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/maxBy.js new file mode 100644 index 00000000..d083fd64 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/maxBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('maxBy', require('../maxBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mean.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mean.js new file mode 100644 index 00000000..31172460 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mean', require('../mean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/meanBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/meanBy.js new file mode 100644 index 00000000..556f25ed --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/meanBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('meanBy', require('../meanBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/memoize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/memoize.js new file mode 100644 index 00000000..638eec63 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/memoize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('memoize', require('../memoize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/merge.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/merge.js new file mode 100644 index 00000000..ac66adde --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/merge.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('merge', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeAll.js new file mode 100644 index 00000000..a3674d67 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAll', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeAllWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeAllWith.js new file mode 100644 index 00000000..4bd4206d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAllWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeWith.js new file mode 100644 index 00000000..00d44d5e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mergeWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/method.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/method.js new file mode 100644 index 00000000..f4060c68 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/method.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('method', require('../method')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/methodOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/methodOf.js new file mode 100644 index 00000000..61399056 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/methodOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('methodOf', require('../methodOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/min.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/min.js new file mode 100644 index 00000000..d12c6b40 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/min.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('min', require('../min'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/minBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/minBy.js new file mode 100644 index 00000000..fdb9e24d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/minBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('minBy', require('../minBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mixin.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mixin.js new file mode 100644 index 00000000..332e6fbf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/mixin.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mixin', require('../mixin')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/multiply.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/multiply.js new file mode 100644 index 00000000..4dcf0b0d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/multiply.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('multiply', require('../multiply')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nAry.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nAry.js new file mode 100644 index 00000000..f262a76c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nAry.js @@ -0,0 +1 @@ +module.exports = require('./ary'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/negate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/negate.js new file mode 100644 index 00000000..8b6dc7c5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/negate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('negate', require('../negate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/next.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/next.js new file mode 100644 index 00000000..140155e2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/next.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('next', require('../next'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/noop.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/noop.js new file mode 100644 index 00000000..b9e32cc8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/noop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('noop', require('../noop'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/now.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/now.js new file mode 100644 index 00000000..6de2068a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/now.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('now', require('../now'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nth.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nth.js new file mode 100644 index 00000000..da4fda74 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nth', require('../nth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nthArg.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nthArg.js new file mode 100644 index 00000000..fce31659 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/nthArg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nthArg', require('../nthArg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/number.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/number.js new file mode 100644 index 00000000..5c10b884 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/number.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../number')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/object.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/object.js new file mode 100644 index 00000000..ae39a134 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/object.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../object')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omit.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omit.js new file mode 100644 index 00000000..fd685291 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omit', require('../omit')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omitAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omitAll.js new file mode 100644 index 00000000..144cf4b9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omitAll.js @@ -0,0 +1 @@ +module.exports = require('./omit'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omitBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omitBy.js new file mode 100644 index 00000000..90df7380 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/omitBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omitBy', require('../omitBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/once.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/once.js new file mode 100644 index 00000000..f8f0a5c7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/once.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('once', require('../once'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/orderBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/orderBy.js new file mode 100644 index 00000000..848e2107 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/orderBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('orderBy', require('../orderBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/over.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/over.js new file mode 100644 index 00000000..01eba7b9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/over.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('over', require('../over')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overArgs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overArgs.js new file mode 100644 index 00000000..738556f0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overArgs', require('../overArgs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overEvery.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overEvery.js new file mode 100644 index 00000000..9f5a032d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overEvery.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overEvery', require('../overEvery')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overSome.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overSome.js new file mode 100644 index 00000000..15939d58 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/overSome.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overSome', require('../overSome')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pad.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pad.js new file mode 100644 index 00000000..f1dea4a9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pad.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pad', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padChars.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padChars.js new file mode 100644 index 00000000..d6e0804c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padChars', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padCharsEnd.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padCharsEnd.js new file mode 100644 index 00000000..d4ab79ad --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padCharsStart.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padCharsStart.js new file mode 100644 index 00000000..a08a3000 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padEnd.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padEnd.js new file mode 100644 index 00000000..a8522ec3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padStart.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padStart.js new file mode 100644 index 00000000..f4ca79d4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/padStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/parseInt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/parseInt.js new file mode 100644 index 00000000..27314ccb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/parseInt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('parseInt', require('../parseInt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partial.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partial.js new file mode 100644 index 00000000..5d460159 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partial', require('../partial')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partialRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partialRight.js new file mode 100644 index 00000000..7f05fed0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partialRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partialRight', require('../partialRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partition.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partition.js new file mode 100644 index 00000000..2ebcacc1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/partition.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partition', require('../partition')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/path.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/path.js new file mode 100644 index 00000000..b29cfb21 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/path.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pathEq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pathEq.js new file mode 100644 index 00000000..36c027a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pathEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pathOr.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pathOr.js new file mode 100644 index 00000000..4ab58209 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pathOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/paths.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/paths.js new file mode 100644 index 00000000..1eb7950a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/paths.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pick.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pick.js new file mode 100644 index 00000000..197393de --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pick.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pick', require('../pick')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pickAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pickAll.js new file mode 100644 index 00000000..a8ecd461 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pickAll.js @@ -0,0 +1 @@ +module.exports = require('./pick'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pickBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pickBy.js new file mode 100644 index 00000000..d832d16b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pickBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pickBy', require('../pickBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pipe.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pipe.js new file mode 100644 index 00000000..b2e1e2cc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pipe.js @@ -0,0 +1 @@ +module.exports = require('./flow'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/placeholder.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/placeholder.js new file mode 100644 index 00000000..1ce17393 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/placeholder.js @@ -0,0 +1,6 @@ +/** + * The default argument placeholder value for methods. + * + * @type {Object} + */ +module.exports = {}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/plant.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/plant.js new file mode 100644 index 00000000..eca8f32b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/plant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('plant', require('../plant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pluck.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pluck.js new file mode 100644 index 00000000..0d1e1abf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pluck.js @@ -0,0 +1 @@ +module.exports = require('./map'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/prop.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/prop.js new file mode 100644 index 00000000..b29cfb21 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/prop.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propEq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propEq.js new file mode 100644 index 00000000..36c027a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propOr.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propOr.js new file mode 100644 index 00000000..4ab58209 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/property.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/property.js new file mode 100644 index 00000000..b29cfb21 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/property.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propertyOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propertyOf.js new file mode 100644 index 00000000..f6273ee4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/propertyOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('propertyOf', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/props.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/props.js new file mode 100644 index 00000000..1eb7950a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/props.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pull.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pull.js new file mode 100644 index 00000000..8d7084f0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pull', require('../pull')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAll.js new file mode 100644 index 00000000..98d5c9a7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAll', require('../pullAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAllBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAllBy.js new file mode 100644 index 00000000..876bc3bf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAllBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllBy', require('../pullAllBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAllWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAllWith.js new file mode 100644 index 00000000..f71ba4d7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllWith', require('../pullAllWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAt.js new file mode 100644 index 00000000..e8b3bb61 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/pullAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAt', require('../pullAt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/random.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/random.js new file mode 100644 index 00000000..99d852e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/random.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('random', require('../random')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/range.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/range.js new file mode 100644 index 00000000..a6bb5911 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/range.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('range', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeRight.js new file mode 100644 index 00000000..fdb712f9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeStep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeStep.js new file mode 100644 index 00000000..d72dfc20 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeStep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStep', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeStepRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeStepRight.js new file mode 100644 index 00000000..8b2a67bc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rangeStepRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStepRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rearg.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rearg.js new file mode 100644 index 00000000..678e02a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rearg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rearg', require('../rearg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reduce.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reduce.js new file mode 100644 index 00000000..4cef0a00 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reduce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduce', require('../reduce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reduceRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reduceRight.js new file mode 100644 index 00000000..caf5bb51 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reduceRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduceRight', require('../reduceRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reject.js new file mode 100644 index 00000000..c1632738 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reject', require('../reject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/remove.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/remove.js new file mode 100644 index 00000000..e9d13273 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/remove.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('remove', require('../remove')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/repeat.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/repeat.js new file mode 100644 index 00000000..08470f24 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/repeat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('repeat', require('../repeat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/replace.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/replace.js new file mode 100644 index 00000000..2227db62 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/replace.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('replace', require('../replace')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rest.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rest.js new file mode 100644 index 00000000..c1f3d64b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/rest.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rest', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/restFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/restFrom.js new file mode 100644 index 00000000..714e42b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/restFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('restFrom', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/result.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/result.js new file mode 100644 index 00000000..f86ce071 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/result.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('result', require('../result')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reverse.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reverse.js new file mode 100644 index 00000000..07c9f5e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/reverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reverse', require('../reverse')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/round.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/round.js new file mode 100644 index 00000000..4c0e5c82 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/round.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('round', require('../round')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sample.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sample.js new file mode 100644 index 00000000..6bea1254 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sample.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sample', require('../sample'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sampleSize.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sampleSize.js new file mode 100644 index 00000000..359ed6fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sampleSize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sampleSize', require('../sampleSize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/seq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/seq.js new file mode 100644 index 00000000..d8f42b0a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/seq.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../seq')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/set.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/set.js new file mode 100644 index 00000000..0b56a56c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/set.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('set', require('../set')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/setWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/setWith.js new file mode 100644 index 00000000..0b584952 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/setWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('setWith', require('../setWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/shuffle.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/shuffle.js new file mode 100644 index 00000000..aa3a1ca5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/shuffle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('shuffle', require('../shuffle'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/size.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/size.js new file mode 100644 index 00000000..7490136e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/size.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('size', require('../size'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/slice.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/slice.js new file mode 100644 index 00000000..15945d32 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/slice.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('slice', require('../slice')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/snakeCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/snakeCase.js new file mode 100644 index 00000000..a0ff7808 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/snakeCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/some.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/some.js new file mode 100644 index 00000000..a4fa2d00 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/some.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('some', require('../some')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortBy.js new file mode 100644 index 00000000..e0790ad5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortBy', require('../sortBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndex.js new file mode 100644 index 00000000..364a0543 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndex', require('../sortedIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndexBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndexBy.js new file mode 100644 index 00000000..9593dbd1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexBy', require('../sortedIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndexOf.js new file mode 100644 index 00000000..c9084cab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexOf', require('../sortedIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndex.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndex.js new file mode 100644 index 00000000..47fe241a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndex', require('../sortedLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndexBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndexBy.js new file mode 100644 index 00000000..0f9a3473 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndexOf.js new file mode 100644 index 00000000..0d4d9327 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedLastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedUniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedUniq.js new file mode 100644 index 00000000..882d2837 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedUniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedUniqBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedUniqBy.js new file mode 100644 index 00000000..033db91c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sortedUniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniqBy', require('../sortedUniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/split.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/split.js new file mode 100644 index 00000000..14de1a7e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/split.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('split', require('../split')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/spread.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/spread.js new file mode 100644 index 00000000..2d11b707 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/spread.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spread', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/spreadFrom.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/spreadFrom.js new file mode 100644 index 00000000..0b630df1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/spreadFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spreadFrom', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/startCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/startCase.js new file mode 100644 index 00000000..ada98c94 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/startCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startCase', require('../startCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/startsWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/startsWith.js new file mode 100644 index 00000000..985e2f29 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/startsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startsWith', require('../startsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/string.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/string.js new file mode 100644 index 00000000..773b0370 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/string.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../string')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubArray.js new file mode 100644 index 00000000..cd604cb4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubArray', require('../stubArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubFalse.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubFalse.js new file mode 100644 index 00000000..32966645 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubFalse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubFalse', require('../stubFalse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubObject.js new file mode 100644 index 00000000..c6c8ec47 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubObject', require('../stubObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubString.js new file mode 100644 index 00000000..701051e8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubString', require('../stubString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubTrue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubTrue.js new file mode 100644 index 00000000..9249082c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/stubTrue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/subtract.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/subtract.js new file mode 100644 index 00000000..d32b16d4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/subtract.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('subtract', require('../subtract')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sum.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sum.js new file mode 100644 index 00000000..5cce12b3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sum.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sum', require('../sum'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sumBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sumBy.js new file mode 100644 index 00000000..c8826565 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/sumBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sumBy', require('../sumBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifference.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifference.js new file mode 100644 index 00000000..78c16add --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifference.js @@ -0,0 +1 @@ +module.exports = require('./xor'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifferenceBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifferenceBy.js new file mode 100644 index 00000000..298fc7ff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifferenceBy.js @@ -0,0 +1 @@ +module.exports = require('./xorBy'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifferenceWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifferenceWith.js new file mode 100644 index 00000000..70bc6faf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/symmetricDifferenceWith.js @@ -0,0 +1 @@ +module.exports = require('./xorWith'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/tail.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/tail.js new file mode 100644 index 00000000..f122f0ac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/tail.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tail', require('../tail'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/take.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/take.js new file mode 100644 index 00000000..9af98a7b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/take.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('take', require('../take')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeLast.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeLast.js new file mode 100644 index 00000000..e98c84a1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeLast.js @@ -0,0 +1 @@ +module.exports = require('./takeRight'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeLastWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeLastWhile.js new file mode 100644 index 00000000..5367968a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./takeRightWhile'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeRight.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeRight.js new file mode 100644 index 00000000..b82950a6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRight', require('../takeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeRightWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeRightWhile.js new file mode 100644 index 00000000..8ffb0a28 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRightWhile', require('../takeRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeWhile.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeWhile.js new file mode 100644 index 00000000..28136644 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/takeWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeWhile', require('../takeWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/tap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/tap.js new file mode 100644 index 00000000..d33ad6ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/tap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tap', require('../tap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/template.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/template.js new file mode 100644 index 00000000..74857e1c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/template.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('template', require('../template')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/templateSettings.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/templateSettings.js new file mode 100644 index 00000000..7bcc0a82 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/templateSettings.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/throttle.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/throttle.js new file mode 100644 index 00000000..77fff142 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/throttle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('throttle', require('../throttle')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/thru.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/thru.js new file mode 100644 index 00000000..d42b3b1d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/thru.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('thru', require('../thru')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/times.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/times.js new file mode 100644 index 00000000..0dab06da --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/times.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('times', require('../times')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toArray.js new file mode 100644 index 00000000..f0c360ac --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toArray', require('../toArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toFinite.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toFinite.js new file mode 100644 index 00000000..3a47687d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toFinite', require('../toFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toInteger.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toInteger.js new file mode 100644 index 00000000..e0af6a75 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toInteger', require('../toInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toIterator.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toIterator.js new file mode 100644 index 00000000..65e6baa9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toIterator.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toIterator', require('../toIterator'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toJSON.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toJSON.js new file mode 100644 index 00000000..2d718d0b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toJSON.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toJSON', require('../toJSON'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toLength.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toLength.js new file mode 100644 index 00000000..b97cdd93 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLength', require('../toLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toLower.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toLower.js new file mode 100644 index 00000000..616ef36a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toLower.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLower', require('../toLower'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toNumber.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toNumber.js new file mode 100644 index 00000000..d0c6f4d3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toNumber', require('../toNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPairs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPairs.js new file mode 100644 index 00000000..af783786 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairs', require('../toPairs'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPairsIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPairsIn.js new file mode 100644 index 00000000..66504abf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPairsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPath.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPath.js new file mode 100644 index 00000000..b4d5e50f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPath.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPath', require('../toPath'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPlainObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPlainObject.js new file mode 100644 index 00000000..278bb863 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toSafeInteger.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toSafeInteger.js new file mode 100644 index 00000000..367a26fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toString.js new file mode 100644 index 00000000..cec4f8e2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toString', require('../toString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toUpper.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toUpper.js new file mode 100644 index 00000000..54f9a560 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/toUpper.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toUpper', require('../toUpper'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/transform.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/transform.js new file mode 100644 index 00000000..759d088f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/transform.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('transform', require('../transform')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trim.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trim.js new file mode 100644 index 00000000..e6319a74 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trim.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trim', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimChars.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimChars.js new file mode 100644 index 00000000..c9294de4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimChars', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimCharsEnd.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimCharsEnd.js new file mode 100644 index 00000000..284bc2f8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimCharsStart.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimCharsStart.js new file mode 100644 index 00000000..ff0ee65d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimEnd.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimEnd.js new file mode 100644 index 00000000..71908805 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimStart.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimStart.js new file mode 100644 index 00000000..fda902c3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/trimStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/truncate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/truncate.js new file mode 100644 index 00000000..d265c1de --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/truncate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('truncate', require('../truncate')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unapply.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unapply.js new file mode 100644 index 00000000..c5dfe779 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unapply.js @@ -0,0 +1 @@ +module.exports = require('./rest'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unary.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unary.js new file mode 100644 index 00000000..286c945f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unary', require('../unary'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unescape.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unescape.js new file mode 100644 index 00000000..fddcb46e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unescape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unescape', require('../unescape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/union.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/union.js new file mode 100644 index 00000000..ef8228d7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/union.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('union', require('../union')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unionBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unionBy.js new file mode 100644 index 00000000..603687a1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionBy', require('../unionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unionWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unionWith.js new file mode 100644 index 00000000..65bb3a79 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionWith', require('../unionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniq.js new file mode 100644 index 00000000..bc185249 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniq', require('../uniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqBy.js new file mode 100644 index 00000000..634c6a8b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqBy', require('../uniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqWith.js new file mode 100644 index 00000000..0ec601a9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqWith', require('../uniqWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqueId.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqueId.js new file mode 100644 index 00000000..aa8fc2f7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/uniqueId.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqueId', require('../uniqueId')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unnest.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unnest.js new file mode 100644 index 00000000..5d34060a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unnest.js @@ -0,0 +1 @@ +module.exports = require('./flatten'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unset.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unset.js new file mode 100644 index 00000000..ea203a0f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unset.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unset', require('../unset')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unzip.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unzip.js new file mode 100644 index 00000000..cc364b3c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unzip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzip', require('../unzip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unzipWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unzipWith.js new file mode 100644 index 00000000..182eaa10 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/unzipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzipWith', require('../unzipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/update.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/update.js new file mode 100644 index 00000000..b8ce2cc9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/update.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('update', require('../update')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/updateWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/updateWith.js new file mode 100644 index 00000000..d5e8282d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/updateWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('updateWith', require('../updateWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/upperCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/upperCase.js new file mode 100644 index 00000000..c886f202 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/upperCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperCase', require('../upperCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/upperFirst.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/upperFirst.js new file mode 100644 index 00000000..d8c04df5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/upperFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/useWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/useWith.js new file mode 100644 index 00000000..d8b3df5a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/useWith.js @@ -0,0 +1 @@ +module.exports = require('./overArgs'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/util.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/util.js new file mode 100644 index 00000000..18c00bae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/util.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../util')); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/value.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/value.js new file mode 100644 index 00000000..555eec7a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/value.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('value', require('../value'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/valueOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/valueOf.js new file mode 100644 index 00000000..f968807d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/valueOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valueOf', require('../valueOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/values.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/values.js new file mode 100644 index 00000000..2dfc5613 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/values.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('values', require('../values'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/valuesIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/valuesIn.js new file mode 100644 index 00000000..a1b2bb87 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/valuesIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/where.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/where.js new file mode 100644 index 00000000..3247f64a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/where.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/whereEq.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/whereEq.js new file mode 100644 index 00000000..29d1e1e4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/whereEq.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/without.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/without.js new file mode 100644 index 00000000..bad9e125 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/without.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('without', require('../without')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/words.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/words.js new file mode 100644 index 00000000..4a901414 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/words.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('words', require('../words')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrap.js new file mode 100644 index 00000000..e93bd8a1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrap', require('../wrap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperAt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperAt.js new file mode 100644 index 00000000..8f0a310f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperChain.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperChain.js new file mode 100644 index 00000000..2a48ea2b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperChain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperLodash.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperLodash.js new file mode 100644 index 00000000..a7162d08 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperLodash.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperReverse.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperReverse.js new file mode 100644 index 00000000..e1481aab --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperReverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperValue.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperValue.js new file mode 100644 index 00000000..8eb9112f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/wrapperValue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xor.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xor.js new file mode 100644 index 00000000..29e28194 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xor', require('../xor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xorBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xorBy.js new file mode 100644 index 00000000..b355686d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xorBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorBy', require('../xorBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xorWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xorWith.js new file mode 100644 index 00000000..8e05739a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/xorWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorWith', require('../xorWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zip.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zip.js new file mode 100644 index 00000000..69e147a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zip', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipAll.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipAll.js new file mode 100644 index 00000000..efa8ccbf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipAll', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObj.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObj.js new file mode 100644 index 00000000..f4a34531 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObj.js @@ -0,0 +1 @@ +module.exports = require('./zipObject'); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObject.js new file mode 100644 index 00000000..462dbb68 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObject', require('../zipObject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObjectDeep.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObjectDeep.js new file mode 100644 index 00000000..53a5d338 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipObjectDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObjectDeep', require('../zipObjectDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipWith.js new file mode 100644 index 00000000..c5cf9e21 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fp/zipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipWith', require('../zipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fromPairs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fromPairs.js new file mode 100644 index 00000000..ee7940d2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/fromPairs.js @@ -0,0 +1,28 @@ +/** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ +function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; +} + +module.exports = fromPairs; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/function.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/function.js new file mode 100644 index 00000000..b0fc6d93 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/function.js @@ -0,0 +1,25 @@ +module.exports = { + 'after': require('./after'), + 'ary': require('./ary'), + 'before': require('./before'), + 'bind': require('./bind'), + 'bindKey': require('./bindKey'), + 'curry': require('./curry'), + 'curryRight': require('./curryRight'), + 'debounce': require('./debounce'), + 'defer': require('./defer'), + 'delay': require('./delay'), + 'flip': require('./flip'), + 'memoize': require('./memoize'), + 'negate': require('./negate'), + 'once': require('./once'), + 'overArgs': require('./overArgs'), + 'partial': require('./partial'), + 'partialRight': require('./partialRight'), + 'rearg': require('./rearg'), + 'rest': require('./rest'), + 'spread': require('./spread'), + 'throttle': require('./throttle'), + 'unary': require('./unary'), + 'wrap': require('./wrap') +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/functions.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/functions.js new file mode 100644 index 00000000..9722928f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/functions.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keys = require('./keys'); + +/** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ +function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); +} + +module.exports = functions; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/functionsIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/functionsIn.js new file mode 100644 index 00000000..f00345d0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/functionsIn.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keysIn = require('./keysIn'); + +/** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ +function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); +} + +module.exports = functionsIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/get.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/get.js new file mode 100644 index 00000000..8805ff92 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/get.js @@ -0,0 +1,33 @@ +var baseGet = require('./_baseGet'); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/groupBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/groupBy.js new file mode 100644 index 00000000..babf4f6b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/groupBy.js @@ -0,0 +1,41 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ +var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } +}); + +module.exports = groupBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/gt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/gt.js new file mode 100644 index 00000000..3a662828 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/gt.js @@ -0,0 +1,29 @@ +var baseGt = require('./_baseGt'), + createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ +var gt = createRelationalOperation(baseGt); + +module.exports = gt; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/gte.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/gte.js new file mode 100644 index 00000000..4180a687 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/gte.js @@ -0,0 +1,30 @@ +var createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ +var gte = createRelationalOperation(function(value, other) { + return value >= other; +}); + +module.exports = gte; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/has.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/has.js new file mode 100644 index 00000000..34df55e8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/has.js @@ -0,0 +1,35 @@ +var baseHas = require('./_baseHas'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ +function has(object, path) { + return object != null && hasPath(object, path, baseHas); +} + +module.exports = has; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/hasIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/hasIn.js new file mode 100644 index 00000000..06a36865 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/hasIn.js @@ -0,0 +1,34 @@ +var baseHasIn = require('./_baseHasIn'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/head.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/head.js new file mode 100644 index 00000000..dee9d1f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/head.js @@ -0,0 +1,23 @@ +/** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ +function head(array) { + return (array && array.length) ? array[0] : undefined; +} + +module.exports = head; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/identity.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/identity.js new file mode 100644 index 00000000..2d5d963c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/identity.js @@ -0,0 +1,21 @@ +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/inRange.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/inRange.js new file mode 100644 index 00000000..f20728d9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/inRange.js @@ -0,0 +1,55 @@ +var baseInRange = require('./_baseInRange'), + toFinite = require('./toFinite'), + toNumber = require('./toNumber'); + +/** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ +function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); +} + +module.exports = inRange; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/includes.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/includes.js new file mode 100644 index 00000000..ae0deedc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/includes.js @@ -0,0 +1,53 @@ +var baseIndexOf = require('./_baseIndexOf'), + isArrayLike = require('./isArrayLike'), + isString = require('./isString'), + toInteger = require('./toInteger'), + values = require('./values'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/index.js new file mode 100644 index 00000000..5d063e21 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/index.js @@ -0,0 +1 @@ +module.exports = require('./lodash'); \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/indexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/indexOf.js new file mode 100644 index 00000000..3c644af2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/indexOf.js @@ -0,0 +1,42 @@ +var baseIndexOf = require('./_baseIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ +function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); +} + +module.exports = indexOf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/initial.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/initial.js new file mode 100644 index 00000000..f47fc509 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/initial.js @@ -0,0 +1,22 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; +} + +module.exports = initial; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersection.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersection.js new file mode 100644 index 00000000..a94c1351 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersection.js @@ -0,0 +1,30 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersectionBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersectionBy.js new file mode 100644 index 00000000..31461aae --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersectionBy.js @@ -0,0 +1,45 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ +var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = intersectionBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersectionWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersectionWith.js new file mode 100644 index 00000000..63cabfaa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/intersectionWith.js @@ -0,0 +1,41 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ +var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; +}); + +module.exports = intersectionWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invert.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invert.js new file mode 100644 index 00000000..8c479509 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invert.js @@ -0,0 +1,42 @@ +var constant = require('./constant'), + createInverter = require('./_createInverter'), + identity = require('./identity'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ +var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; +}, constant(identity)); + +module.exports = invert; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invertBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invertBy.js new file mode 100644 index 00000000..3f4f7e53 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invertBy.js @@ -0,0 +1,56 @@ +var baseIteratee = require('./_baseIteratee'), + createInverter = require('./_createInverter'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ +var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } +}, baseIteratee); + +module.exports = invertBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invoke.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invoke.js new file mode 100644 index 00000000..97d51eb5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invoke.js @@ -0,0 +1,24 @@ +var baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'); + +/** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ +var invoke = baseRest(baseInvoke); + +module.exports = invoke; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invokeMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invokeMap.js new file mode 100644 index 00000000..8da5126c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/invokeMap.js @@ -0,0 +1,41 @@ +var apply = require('./_apply'), + baseEach = require('./_baseEach'), + baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'), + isArrayLike = require('./isArrayLike'); + +/** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ +var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; +}); + +module.exports = invokeMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArguments.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArguments.js new file mode 100644 index 00000000..8b9ed66c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArguments.js @@ -0,0 +1,36 @@ +var baseIsArguments = require('./_baseIsArguments'), + isObjectLike = require('./isObjectLike'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArray.js new file mode 100644 index 00000000..88ab55fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArray.js @@ -0,0 +1,26 @@ +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayBuffer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayBuffer.js new file mode 100644 index 00000000..12904a64 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayBuffer.js @@ -0,0 +1,27 @@ +var baseIsArrayBuffer = require('./_baseIsArrayBuffer'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer; + +/** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ +var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + +module.exports = isArrayBuffer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayLike.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayLike.js new file mode 100644 index 00000000..0f966805 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayLike.js @@ -0,0 +1,33 @@ +var isFunction = require('./isFunction'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayLikeObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayLikeObject.js new file mode 100644 index 00000000..6c4812a8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isArrayLikeObject.js @@ -0,0 +1,33 @@ +var isArrayLike = require('./isArrayLike'), + isObjectLike = require('./isObjectLike'); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isBoolean.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isBoolean.js new file mode 100644 index 00000000..a43ed4b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isBoolean.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]'; + +/** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ +function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); +} + +module.exports = isBoolean; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isBuffer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isBuffer.js new file mode 100644 index 00000000..c103cc74 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isBuffer.js @@ -0,0 +1,38 @@ +var root = require('./_root'), + stubFalse = require('./stubFalse'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isDate.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isDate.js new file mode 100644 index 00000000..7f0209fc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isDate.js @@ -0,0 +1,27 @@ +var baseIsDate = require('./_baseIsDate'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsDate = nodeUtil && nodeUtil.isDate; + +/** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ +var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + +module.exports = isDate; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isElement.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isElement.js new file mode 100644 index 00000000..76ae29c3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isElement.js @@ -0,0 +1,25 @@ +var isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ +function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); +} + +module.exports = isElement; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEmpty.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEmpty.js new file mode 100644 index 00000000..3597294a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEmpty.js @@ -0,0 +1,77 @@ +var baseKeys = require('./_baseKeys'), + getTag = require('./_getTag'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLike = require('./isArrayLike'), + isBuffer = require('./isBuffer'), + isPrototype = require('./_isPrototype'), + isTypedArray = require('./isTypedArray'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEqual.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEqual.js new file mode 100644 index 00000000..5e23e76c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEqual.js @@ -0,0 +1,35 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEqualWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEqualWith.js new file mode 100644 index 00000000..21bdc7ff --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isEqualWith.js @@ -0,0 +1,41 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ +function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; +} + +module.exports = isEqualWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isError.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isError.js new file mode 100644 index 00000000..b4f41e00 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isError.js @@ -0,0 +1,36 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** `Object#toString` result references. */ +var domExcTag = '[object DOMException]', + errorTag = '[object Error]'; + +/** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ +function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); +} + +module.exports = isError; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isFinite.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isFinite.js new file mode 100644 index 00000000..601842bc --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isFinite.js @@ -0,0 +1,36 @@ +var root = require('./_root'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite; + +/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ +function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); +} + +module.exports = isFinite; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isFunction.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isFunction.js new file mode 100644 index 00000000..907a8cd8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isFunction.js @@ -0,0 +1,37 @@ +var baseGetTag = require('./_baseGetTag'), + isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isInteger.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isInteger.js new file mode 100644 index 00000000..66aa87d5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isInteger.js @@ -0,0 +1,33 @@ +var toInteger = require('./toInteger'); + +/** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ +function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); +} + +module.exports = isInteger; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isLength.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isLength.js new file mode 100644 index 00000000..3a95caa9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isLength.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMap.js new file mode 100644 index 00000000..44f8517e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMap.js @@ -0,0 +1,27 @@ +var baseIsMap = require('./_baseIsMap'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMatch.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMatch.js new file mode 100644 index 00000000..9773a18c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMatch.js @@ -0,0 +1,36 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ +function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); +} + +module.exports = isMatch; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMatchWith.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMatchWith.js new file mode 100644 index 00000000..187b6a61 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isMatchWith.js @@ -0,0 +1,41 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ +function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); +} + +module.exports = isMatchWith; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNaN.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNaN.js new file mode 100644 index 00000000..7d0d783b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNaN.js @@ -0,0 +1,38 @@ +var isNumber = require('./isNumber'); + +/** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ +function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; +} + +module.exports = isNaN; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNative.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNative.js new file mode 100644 index 00000000..f0cb8d58 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNative.js @@ -0,0 +1,40 @@ +var baseIsNative = require('./_baseIsNative'), + isMaskable = require('./_isMaskable'); + +/** Error message constants. */ +var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.'; + +/** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); +} + +module.exports = isNative; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNil.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNil.js new file mode 100644 index 00000000..79f05052 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNil.js @@ -0,0 +1,25 @@ +/** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ +function isNil(value) { + return value == null; +} + +module.exports = isNil; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNull.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNull.js new file mode 100644 index 00000000..c0a374d7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNull.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNumber.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNumber.js new file mode 100644 index 00000000..cd34ee46 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isNumber.js @@ -0,0 +1,38 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; + +/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); +} + +module.exports = isNumber; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isObject.js new file mode 100644 index 00000000..1dc89391 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isObject.js @@ -0,0 +1,31 @@ +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isObjectLike.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isObjectLike.js new file mode 100644 index 00000000..301716b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isObjectLike.js @@ -0,0 +1,29 @@ +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isPlainObject.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isPlainObject.js new file mode 100644 index 00000000..23873731 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isPlainObject.js @@ -0,0 +1,62 @@ +var baseGetTag = require('./_baseGetTag'), + getPrototype = require('./_getPrototype'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isRegExp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isRegExp.js new file mode 100644 index 00000000..76c9b6e9 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isRegExp.js @@ -0,0 +1,27 @@ +var baseIsRegExp = require('./_baseIsRegExp'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; + +/** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ +var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + +module.exports = isRegExp; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSafeInteger.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSafeInteger.js new file mode 100644 index 00000000..2a48526e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSafeInteger.js @@ -0,0 +1,37 @@ +var isInteger = require('./isInteger'); + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ +function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; +} + +module.exports = isSafeInteger; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSet.js new file mode 100644 index 00000000..ab88bdf8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSet.js @@ -0,0 +1,27 @@ +var baseIsSet = require('./_baseIsSet'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isString.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isString.js new file mode 100644 index 00000000..627eb9c3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isString.js @@ -0,0 +1,30 @@ +var baseGetTag = require('./_baseGetTag'), + isArray = require('./isArray'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSymbol.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSymbol.js new file mode 100644 index 00000000..dfb60b97 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isSymbol.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isTypedArray.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isTypedArray.js new file mode 100644 index 00000000..da3f8dd1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isTypedArray.js @@ -0,0 +1,27 @@ +var baseIsTypedArray = require('./_baseIsTypedArray'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isUndefined.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isUndefined.js new file mode 100644 index 00000000..377d121a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isUndefined.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isWeakMap.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isWeakMap.js new file mode 100644 index 00000000..8d36f663 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isWeakMap.js @@ -0,0 +1,28 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakMapTag = '[object WeakMap]'; + +/** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ +function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; +} + +module.exports = isWeakMap; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isWeakSet.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isWeakSet.js new file mode 100644 index 00000000..e628b261 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/isWeakSet.js @@ -0,0 +1,28 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakSetTag = '[object WeakSet]'; + +/** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ +function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; +} + +module.exports = isWeakSet; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/iteratee.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/iteratee.js new file mode 100644 index 00000000..61b73a8c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/iteratee.js @@ -0,0 +1,53 @@ +var baseClone = require('./_baseClone'), + baseIteratee = require('./_baseIteratee'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ +function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); +} + +module.exports = iteratee; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/join.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/join.js new file mode 100644 index 00000000..45de079f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/join.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeJoin = arrayProto.join; + +/** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ +function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); +} + +module.exports = join; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/kebabCase.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/kebabCase.js new file mode 100644 index 00000000..8a52be64 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/kebabCase.js @@ -0,0 +1,28 @@ +var createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ +var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); +}); + +module.exports = kebabCase; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keyBy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keyBy.js new file mode 100644 index 00000000..acc007a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keyBy.js @@ -0,0 +1,36 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ +var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); +}); + +module.exports = keyBy; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keys.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keys.js new file mode 100644 index 00000000..d143c718 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keys.js @@ -0,0 +1,37 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeys = require('./_baseKeys'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keysIn.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keysIn.js new file mode 100644 index 00000000..a62308f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/keysIn.js @@ -0,0 +1,32 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeysIn = require('./_baseKeysIn'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lang.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lang.js new file mode 100644 index 00000000..a3962169 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lang.js @@ -0,0 +1,58 @@ +module.exports = { + 'castArray': require('./castArray'), + 'clone': require('./clone'), + 'cloneDeep': require('./cloneDeep'), + 'cloneDeepWith': require('./cloneDeepWith'), + 'cloneWith': require('./cloneWith'), + 'conformsTo': require('./conformsTo'), + 'eq': require('./eq'), + 'gt': require('./gt'), + 'gte': require('./gte'), + 'isArguments': require('./isArguments'), + 'isArray': require('./isArray'), + 'isArrayBuffer': require('./isArrayBuffer'), + 'isArrayLike': require('./isArrayLike'), + 'isArrayLikeObject': require('./isArrayLikeObject'), + 'isBoolean': require('./isBoolean'), + 'isBuffer': require('./isBuffer'), + 'isDate': require('./isDate'), + 'isElement': require('./isElement'), + 'isEmpty': require('./isEmpty'), + 'isEqual': require('./isEqual'), + 'isEqualWith': require('./isEqualWith'), + 'isError': require('./isError'), + 'isFinite': require('./isFinite'), + 'isFunction': require('./isFunction'), + 'isInteger': require('./isInteger'), + 'isLength': require('./isLength'), + 'isMap': require('./isMap'), + 'isMatch': require('./isMatch'), + 'isMatchWith': require('./isMatchWith'), + 'isNaN': require('./isNaN'), + 'isNative': require('./isNative'), + 'isNil': require('./isNil'), + 'isNull': require('./isNull'), + 'isNumber': require('./isNumber'), + 'isObject': require('./isObject'), + 'isObjectLike': require('./isObjectLike'), + 'isPlainObject': require('./isPlainObject'), + 'isRegExp': require('./isRegExp'), + 'isSafeInteger': require('./isSafeInteger'), + 'isSet': require('./isSet'), + 'isString': require('./isString'), + 'isSymbol': require('./isSymbol'), + 'isTypedArray': require('./isTypedArray'), + 'isUndefined': require('./isUndefined'), + 'isWeakMap': require('./isWeakMap'), + 'isWeakSet': require('./isWeakSet'), + 'lt': require('./lt'), + 'lte': require('./lte'), + 'toArray': require('./toArray'), + 'toFinite': require('./toFinite'), + 'toInteger': require('./toInteger'), + 'toLength': require('./toLength'), + 'toNumber': require('./toNumber'), + 'toPlainObject': require('./toPlainObject'), + 'toSafeInteger': require('./toSafeInteger'), + 'toString': require('./toString') +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/last.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/last.js new file mode 100644 index 00000000..cad1eafa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/last.js @@ -0,0 +1,20 @@ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lastIndexOf.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lastIndexOf.js new file mode 100644 index 00000000..dabfb613 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lastIndexOf.js @@ -0,0 +1,46 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictLastIndexOf = require('./_strictLastIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ +function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); +} + +module.exports = lastIndexOf; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lodash.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lodash.js new file mode 100644 index 00000000..cb139dd8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/lodash/lodash.js @@ -0,0 +1,17107 @@ +/** + * @license + * Lodash + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.11'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + + return result; + } + + if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + + return result; + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' + + + +``` + +Your broker should accept websocket connection (see [MQTT over Websockets](https://github.com/mcollina/mosca/wiki/MQTT-over-Websockets) to setup [Mosca](http://mcollina.github.io/mosca/)). + + +### Signed WebSocket Urls + +If you need to sign an url, for example for [AWS IoT](http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html#mqtt-ws), +then you can pass in a `transformWsUrl` function to the mqtt.connect() options +This is needed because signed urls have an expiry and eventually upon reconnects, a new signed url needs to be created: + +```js +// This module doesn't actually exist, just an example +var awsIotUrlSigner = require('awsIotUrlSigner') +mqtt.connect('wss://a2ukbzaqo9vbpb.iot.ap-southeast-1.amazonaws.com/mqtt', { + transformWsUrl: function (url, options, client) { + // It's possible to inspect some state on options(pre parsed url components) + // and the client (reconnect state etc) + return awsIotUrlSigner(url) + } +}) + +// Now every time a new WebSocket connection is opened (hopefully not that +// often) we get a freshly signed url + +``` + + +## About QoS + +Here is how QoS works: + +* QoS 0 : received **at most once** : The packet is sent, and that's it. There is no validation about whether it has been received. +* QoS 1 : received **at least once** : The packet is sent and stored as long as the client has not received a confirmation from the server. MQTT ensures that it *will* be received, but there can be duplicates. +* QoS 2 : received **exactly once** : Same as QoS 1 but there is no duplicates. + +About data consumption, obviously, QoS 2 > QoS 1 > QoS 0, if that's a concern to you. + + +## Usage with TypeScript +This repo bundles TypeScript definition files for use in TypeScript projects and to support tools that can read `.d.ts` files. + +### Pre-requisites +Before you can begin using these TypeScript definitions with your project, you need to make sure your project meets a few of these requirements: + * TypeScript >= 2.1 + * Set tsconfig.json: `{"compilerOptions" : {"moduleResolution" : "node"}, ...}` + * Includes the TypeScript definitions for node. You can use npm to install this by typing the following into a terminal window: + `npm install --save-dev @types/node` + + +## Contributing + +MQTT.js is an **OPEN Open Source Project**. This means that: + +> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. + +See the [CONTRIBUTING.md](https://github.com/mqttjs/MQTT.js/blob/master/CONTRIBUTING.md) file for more details. + +### Contributors + +MQTT.js is only possible due to the excellent work of the following contributors: + + + + + +
Adam RuddGitHub/adamvrTwitter/@adam_vr
Matteo CollinaGitHub/mcollinaTwitter/@matteocollina
Maxime AgorGitHub/4rzaelTwitter/@4rzael
+ + +## License + +MIT diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/bin/pub.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/bin/pub.js new file mode 100755 index 00000000..94b066b4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/bin/pub.js @@ -0,0 +1,146 @@ +#!/usr/bin/env node + +'use strict' + +var mqtt = require('../') +var pump = require('pump') +var path = require('path') +var fs = require('fs') +var concat = require('concat-stream') +var Writable = require('readable-stream').Writable +var helpMe = require('help-me')({ + dir: path.join(__dirname, '..', 'doc') +}) +var minimist = require('minimist') +var split2 = require('split2') + +function send (args) { + var client = mqtt.connect(args) + client.on('connect', function () { + client.publish(args.topic, args.message, args, function (err) { + if (err) { + console.warn(err) + } + client.end() + }) + }) + client.on('error', function (err) { + console.warn(err) + client.end() + }) +} + +function multisend (args) { + var client = mqtt.connect(args) + var sender = new Writable({ + objectMode: true + }) + sender._write = function (line, enc, cb) { + client.publish(args.topic, line.trim(), args, cb) + } + + client.on('connect', function () { + pump(process.stdin, split2(), sender, function (err) { + client.end() + if (err) { + throw err + } + }) + }) +} + +function start (args) { + args = minimist(args, { + string: ['hostname', 'username', 'password', 'key', 'cert', 'ca', 'message', 'clientId', 'i', 'id'], + boolean: ['stdin', 'retain', 'help', 'insecure', 'multiline'], + alias: { + port: 'p', + hostname: ['h', 'host'], + topic: 't', + message: 'm', + qos: 'q', + clientId: ['i', 'id'], + retain: 'r', + username: 'u', + password: 'P', + stdin: 's', + multiline: 'M', + protocol: ['C', 'l'], + help: 'H', + ca: 'cafile' + }, + default: { + host: 'localhost', + qos: 0, + retain: false, + topic: '', + message: '' + } + }) + + if (args.help) { + return helpMe.toStdout('publish') + } + + if (args.key) { + args.key = fs.readFileSync(args.key) + } + + if (args.cert) { + args.cert = fs.readFileSync(args.cert) + } + + if (args.ca) { + args.ca = fs.readFileSync(args.ca) + } + + if (args.key && args.cert && !args.protocol) { + args.protocol = 'mqtts' + } + + if (args.port) { + if (typeof args.port !== 'number') { + console.warn('# Port: number expected, \'%s\' was given.', typeof args.port) + return + } + } + + if (args['will-topic']) { + args.will = {} + args.will.topic = args['will-topic'] + args.will.payload = args['will-message'] + args.will.qos = args['will-qos'] + args.will.retain = args['will-retain'] + } + + if (args.insecure) { + args.rejectUnauthorized = false + } + + args.topic = (args.topic || args._.shift()).toString() + args.message = (args.message || args._.shift()).toString() + + if (!args.topic) { + console.error('missing topic\n') + return helpMe.toStdout('publish') + } + + if (args.stdin) { + if (args.multiline) { + multisend(args) + } else { + process.stdin.pipe(concat(function (data) { + args.message = data + send(args) + })) + } + } else { + send(args) + } +} + +module.exports = start + +if (require.main === module) { + start(process.argv.slice(2)) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/bin/sub.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/bin/sub.js new file mode 100755 index 00000000..14bc5745 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/bin/sub.js @@ -0,0 +1,123 @@ +#!/usr/bin/env node + +var mqtt = require('../') +var path = require('path') +var fs = require('fs') +var helpMe = require('help-me')({ + dir: path.join(__dirname, '..', 'doc') +}) +var minimist = require('minimist') + +function start (args) { + args = minimist(args, { + string: ['hostname', 'username', 'password', 'key', 'cert', 'ca', 'clientId', 'i', 'id'], + boolean: ['stdin', 'help', 'clean', 'insecure'], + alias: { + port: 'p', + hostname: ['h', 'host'], + topic: 't', + qos: 'q', + clean: 'c', + keepalive: 'k', + clientId: ['i', 'id'], + username: 'u', + password: 'P', + protocol: ['C', 'l'], + verbose: 'v', + help: '-H', + ca: 'cafile' + }, + default: { + host: 'localhost', + qos: 0, + retain: false, + clean: true, + keepAlive: 30 // 30 sec + } + }) + + if (args.help) { + return helpMe.toStdout('subscribe') + } + + args.topic = args.topic || args._.shift() + + if (!args.topic) { + console.error('missing topic\n') + return helpMe.toStdout('subscribe') + } + + if (args.key) { + args.key = fs.readFileSync(args.key) + } + + if (args.cert) { + args.cert = fs.readFileSync(args.cert) + } + + if (args.ca) { + args.ca = fs.readFileSync(args.ca) + } + + if (args.key && args.cert && !args.protocol) { + args.protocol = 'mqtts' + } + + if (args.insecure) { + args.rejectUnauthorized = false + } + + if (args.port) { + if (typeof args.port !== 'number') { + console.warn('# Port: number expected, \'%s\' was given.', typeof args.port) + return + } + } + + if (args['will-topic']) { + args.will = {} + args.will.topic = args['will-topic'] + args.will.payload = args['will-message'] + args.will.qos = args['will-qos'] + args.will.retain = args['will-retain'] + } + + args.keepAlive = args['keep-alive'] + + var client = mqtt.connect(args) + + client.on('connect', function () { + client.subscribe(args.topic, { qos: args.qos }, function (err, result) { + if (err) { + console.error(err) + process.exit(1) + } + + result.forEach(function (sub) { + if (sub.qos > 2) { + console.error('subscription negated to', sub.topic, 'with code', sub.qos) + process.exit(1) + } + }) + }) + }) + + client.on('message', function (topic, payload) { + if (args.verbose) { + console.log(topic, payload.toString()) + } else { + console.log(payload.toString()) + } + }) + + client.on('error', function (err) { + console.warn(err) + client.end() + }) +} + +module.exports = start + +if (require.main === module) { + start(process.argv.slice(2)) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/help.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/help.txt new file mode 100644 index 00000000..55473e3d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/help.txt @@ -0,0 +1,8 @@ +MQTT.js command line interface, available commands are: + + * publish publish a message to the broker + * subscribe subscribe for updates from the broker + * version the current MQTT.js version + * help help about commands + +Launch 'mqtt help [command]' to know more about the commands. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/publish.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/publish.txt new file mode 100644 index 00000000..58398980 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/publish.txt @@ -0,0 +1,26 @@ +Usage: mqtt publish [opts] topic [message] + +Available options: + + -h/--hostname HOST the broker host + -p/--port PORT the broker port + -i/--client-id ID the client id + -q/--qos 0/1/2 the QoS of the message + -t/--topic TOPIC the message topic + -m/--message MSG the message body + -r/--retain send a retained message + -s/--stdin read the message body from stdin + -M/--multiline read lines from stdin as multiple messages + -u/--username USER the username + -P/--password PASS the password + -C/--protocol PROTO the protocol to use, 'mqtt', + 'mqtts', 'ws' or 'wss' + --key PATH path to the key file + --cert PATH path to the cert file + --ca PATH path to the ca certificate + --insecure do not verify the server certificate + --will-topic TOPIC the will topic + --will-payload BODY the will message + --will-qos 0/1/2 the will qos + --will-retain send a will retained message + -H/--help show this diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/subscribe.txt b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/subscribe.txt new file mode 100644 index 00000000..7933cc3e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/doc/subscribe.txt @@ -0,0 +1,26 @@ +Usage: mqtt subscribe [opts] [topic] + +Available options: + + -h/--hostname HOST the broker host + -p/--port PORT the broker port + -i/--client-id ID the client id + -q/--qos 0/1/2 the QoS of the message + --no-clean do not discard any pending message for + the given id + -t/--topic TOPIC the message topic + -k/--keepalive SEC send a ping every SEC seconds + -u/--username USER the username + -P/--password PASS the password + -l/--protocol PROTO the protocol to use, 'mqtt', + 'mqtts', 'ws' or 'wss' + --key PATH path to the key file + --cert PATH path to the cert file + --ca PATH path to the ca certificate + --insecure do not verify the server certificate + --will-topic TOPIC the will topic + --will-message BODY the will message + --will-qos 0/1/2 the will qos + --will-retain send a will retained message + -v/--verbose print the topic before the message + -H/--help show this diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/secure-client.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/secure-client.js new file mode 100644 index 00000000..bf9b6f09 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/secure-client.js @@ -0,0 +1,24 @@ +'use strict' + +var mqtt = require('../..') +var path = require('path') +var fs = require('fs') +var KEY = fs.readFileSync(path.join(__dirname, '..', '..', 'test', 'helpers', 'tls-key.pem')) +var CERT = fs.readFileSync(path.join(__dirname, '..', '..', 'test', 'helpers', 'tls-cert.pem')) + +var PORT = 8443 + +var options = { + port: PORT, + key: KEY, + cert: CERT, + rejectUnauthorized: false +} + +var client = mqtt.connect(options) + +client.subscribe('messages') +client.publish('messages', 'Current time is: ' + new Date()) +client.on('message', function (topic, message) { + console.log(message) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-both.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-both.js new file mode 100644 index 00000000..8e9268b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-both.js @@ -0,0 +1,13 @@ +'use strict' + +var mqtt = require('../..') +var client = mqtt.connect() + +// or var client = mqtt.connect({ port: 1883, host: '192.168.1.100', keepalive: 10000}); + +client.subscribe('presence') +client.publish('presence', 'bin hier') +client.on('message', function (topic, message) { + console.log(message) +}) +client.end() diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-publish.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-publish.js new file mode 100644 index 00000000..a8b0f89b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-publish.js @@ -0,0 +1,7 @@ +'use strict' + +var mqtt = require('../..') +var client = mqtt.connect() + +client.publish('presence', 'hello!') +client.end() diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-subscribe.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-subscribe.js new file mode 100644 index 00000000..7989b9c2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/client/simple-subscribe.js @@ -0,0 +1,9 @@ +'use strict' + +var mqtt = require('../..') +var client = mqtt.connect() + +client.subscribe('presence') +client.on('message', function (topic, message) { + console.log(message) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/crt.ca.cg.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/crt.ca.cg.pem new file mode 100644 index 00000000..b5920808 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/crt.ca.cg.pem @@ -0,0 +1,34 @@ +-----BEGIN CERTIFICATE----- +MIIF7zCCA9egAwIBAgIJAOeJR1p1PU3qMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYD +VQQGEwJFUzERMA8GA1UECAwIWmFyYWdvemExETAPBgNVBAcMCFphcmFnb3phMRkw +FwYDVQQKDBBNUVRUIGZvciBub2RlLmpzMRAwDgYDVQQLDAdNUVRULmpzMQ0wCwYD +VQQDDARtcXR0MRwwGgYJKoZIhvcNAQkBFg1mYWtlQG1haWwuY29tMB4XDTEzMDgz +MDEzMDIwNVoXDTIzMDgyODEzMDIwNVowgY0xCzAJBgNVBAYTAkVTMREwDwYDVQQI +DAhaYXJhZ296YTERMA8GA1UEBwwIWmFyYWdvemExGTAXBgNVBAoMEE1RVFQgZm9y +IG5vZGUuanMxEDAOBgNVBAsMB01RVFQuanMxDTALBgNVBAMMBG1xdHQxHDAaBgkq +hkiG9w0BCQEWDWZha2VAbWFpbC5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQC7Of6OppOE+xwPdPcsT0w3keCa5k4ufZCqUAHex7+mLlrpjfCjQ2z6 +Rm0XBiCu9vy+xvLtbGDh5e/gocjAkkEywjbtrRMiFq5i41BNT3dzEWb9cCXvMWYa +RxQgIqouJUz5r+TbaP1bm4gAWTHmp09ccoIs9Tykxhyc1nZxXVrEsHF4aBmuw5NJ +ZwxK1tJTgP4m5H38Ms7ahGpByPsnMg6GBRs/Yen0mGhOsG+MU4TFiQb4bwIxg8Eu +ntGP1gARvtmyTkkTDhfksRs+muEV17uPtdhGNS/0CGRWaZ2mjEYyD70Ijl2grLd4 +6Vz27uPaqUvbgntPNadKqFN+jEHTtptou3k6V9C8CeLHIq+5N6abfPVHBzaqyNqg +QelzpSgQQBJ1H0CYREjzAs9uLfeep5ejW99Ik4YwtL6UrTVUyGzGgAl9mevZN5a4 +7mEY7MNUFdwigq0ZpbZmzYiuOURGYnoiy5o64balG5XH6Zh6B1WWhK7CArPVosz8 +eoQacj1WEM5d2Ivg1OLlEdD8FZDABv5CMTmRvnoFQuuIDzWVfrhdcZQ2tQuNLWrz +YDKheCunPkAIFOlGi70Xv3DVrTCr6kixwL2p9MHTzF4xiWWtiOv41ZXHTMG0t2I3 +YmA45FEO5JawebPgUoGhoc2vgIw5Jo9dcGtwLCqBHSnCojPoTipVhQIDAQABo1Aw +TjAdBgNVHQ4EFgQU1yVv/ezoDLs+qjbx0O4KiHpC41swHwYDVR0jBBgwFoAU1yVv +/ezoDLs+qjbx0O4KiHpC41swDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOC +AgEAScnfOewEk59DgfICJJ2vhcI33wqqn54zhJ1pi8SX3e7PLv26UEUXZaddIqeZ +JzA/IWF+GCBQFAL7Z+sI4djXx/UpZp5ptCQBFc0tinHk1CGlC0E+LI3JS/cnFf+2 +L8VKZHbSf4ua2f/VMJo7uoyrw/gQHgUToAlYYWpGcIKKm7d0JYQE60wlHk9TXgCc +s9XAwI+bP9VKNQkZCeooODG/5VcxdJafZSU3rW1WniFcD/R+ZNq7FZYbM+2u2mRt +Qm7Hh/FjrN4Hnmf3xdNUE0NLHznwk4CD6EeQukN12yP2ccubnG6Z7HFFdV0g9fEP +AVMsgY/9E9Te/BBoQKjhIg8c274ozIOsCHODx15Mn52848sq0LIQjyeOH4rtuWLL +1dFE1ysY2gzSMUtrP+on+r6F1GkndFszxfDrBcZMXs85VAy3eKfY/jzUMrdfn0YJ +36Wz7F40vnOUd2ni24kaOfnRodbu3lOEYD6l5fDGP79kfITyy+dtL6ExTLZQmEn+ +xKsWM9bBkV4STpFiTF61tJwzlcAL1ZDLqDaSwsM8UDZopnDgvklNoJK9XzdLwD1X +PofOtUe08G4tq5cBDVURLKif+7EfCyAqvUptQ3MJarhoXzhDy9CjtN8TmWexKC1q +kB5DBML0Y4NnqTEnfYCs/XFPosaS+0GximGySJcg08ay6ZA= +-----END CERTIFICATE----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/mqttclient.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/mqttclient.js new file mode 100644 index 00000000..392fcb39 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/mqttclient.js @@ -0,0 +1,48 @@ +'use strict' + +/** ************************** IMPORTANT NOTE *********************************** + + The certificate used on this example has been generated for a host named stark. + So as host we SHOULD use stark if we want the server to be authorized. + For testing this we should add on the computer running this example a line on + the hosts file: + /etc/hosts [UNIX] + OR + \System32\drivers\etc\hosts [Windows] + + The line to add on the file should be as follows: + stark + *******************************************************************************/ + +var mqtt = require('mqtt') +var fs = require('fs') +var path = require('path') +var KEY = fs.readFileSync(path.join(__dirname, '/tls-key.pem')) +var CERT = fs.readFileSync(path.join(__dirname, '/tls-cert.pem')) +var TRUSTED_CA_LIST = fs.readFileSync(path.join(__dirname, '/crt.ca.cg.pem')) + +var PORT = 1883 +var HOST = 'stark' + +var options = { + port: PORT, + host: HOST, + key: KEY, + cert: CERT, + rejectUnauthorized: true, + // The CA list will be used to determine if server is authorized + ca: TRUSTED_CA_LIST, + protocol: 'mqtts' +} + +var client = mqtt.connect(options) + +client.subscribe('messages') +client.publish('messages', 'Current time is: ' + new Date()) +client.on('message', function (topic, message) { + console.log(message) +}) + +client.on('connect', function () { + console.log('Connected') +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/tls-cert.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/tls-cert.pem new file mode 100644 index 00000000..ee7458d4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/tls-cert.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIICATCCAWoCCQC2pNY4sfld/jANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB +VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMB4XDTEzMDgyNzEyNTU0NVoXDTEzMDkyNjEyNTU0NVowRTELMAkG +A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 +IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzXGU +1mZUBqLwoP1fWkiZeypiKgWICUdNm+d2JHXnpQMEVBxSvsaRGOnzWVvgbMVxmD7n +5/p9qQGTj8FY/+t2NHpbt1I9lGV0+BlZxGJvyvHikEAXPD85EEFhqSbDwgkVuMqa +w08njqhJJ37fbd2ux6w4woRrDTN4r9CNMhFb9QECAwEAATANBgkqhkiG9w0BAQUF +AAOBgQBIlZYo1rf8GlISuV1haSBm8U/uiyjIX/pTE5Cs7Kb84SPzKB0tHnGGCa2t +Lu+TEwetF3NatuI1biqYuevQSfmEM75zsRSwt1P40sJ2y9B1XRTdamHOHCYCJG/b +rti7WJYjvO8JsCUeB6M+5jFodbmvjsGgAHLLUINXrxOqYe+PWg== +-----END CERTIFICATE----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/tls-key.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/tls-key.pem new file mode 100644 index 00000000..bd852d5d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/tls client/tls-key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDNcZTWZlQGovCg/V9aSJl7KmIqBYgJR02b53YkdeelAwRUHFK+ +xpEY6fNZW+BsxXGYPufn+n2pAZOPwVj/63Y0elu3Uj2UZXT4GVnEYm/K8eKQQBc8 +PzkQQWGpJsPCCRW4yprDTyeOqEknft9t3a7HrDjChGsNM3iv0I0yEVv1AQIDAQAB +AoGBALv9P+WEE0VTWf7mepdBsXfbi6HKF/Xtkh2kCh5I6WO8Q/y3Qhwh1OnIQg41 +nUHK1iwq+8fxFYVN1PoJQWhEzI6JdBCrn88oADo/aVm1mGN5CWr3pwn92SAVMhbw +442AWWG81RStrr2uPhLBNE6U/4P835qM8uG4rCP+5Z5SzX7VAkEA+TptuSc0TEkL +5B/Nml2fYNfbQvRGVzyCbdCXdgkeZt5xuSuwDgC4GvWgjL+SAN1fjTek/Iez5NnL +xHa5w93j2wJBANMGmRTaTxvpGdkUi/utTPtCp6GXL7hS9v41LClmQTYBOYscPn2b +Dny2fyZPp29sZ7+AvXHWZxw7QtH+jO2Xz1MCQCI7vlqSYgKgffulyq4LchrxS3LU +7tyIuTmwTz2tXvmuUFyo/ZPO0XsShi0PG1T3E2roW8c8NJ+Ysv6XeEjJL8UCQG0Z +/S0tzTa15no4SEM/jwxcosRFoRNgOXimTwW8azybl3+Xg6t27h+GTuikyAEwf9cf +nVJssfSDowFk5MG1+icCQQCqBOTXEukcJRXZixkpfEuuvS3RNzOYwG4ReKjpvWPy +EvsfHoCsO1Sz9qz8DXpwl3GEWUGGTfWwBfereX6HLXj+ +-----END RSA PRIVATE KEY----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/wss/client.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/wss/client.js new file mode 100644 index 00000000..f294598f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/wss/client.js @@ -0,0 +1,49 @@ +'use strict' + +var mqtt = require('mqtt') + +var clientId = 'mqttjs_' + Math.random().toString(16).substr(2, 8) + +var host = 'wss://localhost:3001/Mosca' + +var options = { + keepalive: 10, + clientId: clientId, + protocolId: 'MQTT', + protocolVersion: 4, + clean: true, + reconnectPeriod: 1000, + connectTimeout: 30 * 1000, + will: { + topic: 'WillMsg', + payload: 'Connection Closed abnormally..!', + qos: 0, + retain: false + }, + username: 'demo', + password: 'demo', + rejectUnauthorized: false +} + +var client = mqtt.connect(host, options) + +client.on('error', function (err) { + console.log(err) + client.end() +}) + +client.on('connect', function () { + console.log('client connected:' + clientId) +}) + +client.subscribe('topic', { qos: 0 }) + +client.publish('topic', 'wss secure connection demo...!', { qos: 0, retain: false }) + +client.on('message', function (topic, message, packet) { + console.log('Received Message:= ' + message.toString() + '\nOn topic:= ' + topic) +}) + +client.on('close', function () { + console.log(clientId + ' disconnected') +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/wss/client_with_proxy.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/wss/client_with_proxy.js new file mode 100644 index 00000000..a91e53d3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/examples/wss/client_with_proxy.js @@ -0,0 +1,58 @@ +'use strict' + +var mqtt = require('mqtt') +var HttpsProxyAgent = require('https-proxy-agent') +var url = require('url') +/* +host: host of the endpoint you want to connect e.g. my.mqqt.host.com +path: path to you endpoint e.g. '/foo/bar/mqtt' +*/ +var endpoint = 'wss://' +/* create proxy agent +proxy: your proxy e.g. proxy.foo.bar.com +port: http proxy port e.g. 8080 +*/ +var proxy = process.env.http_proxy || 'http://:' +var parsed = url.parse(endpoint) +var proxyOpts = url.parse(proxy) +// true for wss +proxyOpts.secureEndpoint = parsed.protocol ? parsed.protocol === 'wss:' : true +var agent = new HttpsProxyAgent(proxyOpts) +var wsOptions = { + agent: agent + // other wsOptions + // foo:'bar' +} +var mqttOptions = { + keepalive: 60, + reschedulePings: true, + protocolId: 'MQTT', + protocolVersion: 4, + reconnectPeriod: 1000, + connectTimeout: 30 * 1000, + clean: true, + clientId: 'testClient', + wsOptions: wsOptions +} + +var client = mqtt.connect(parsed, mqttOptions) + +client.on('connect', function () { + console.log('connected') +}) + +client.on('error', function (a) { + console.log('error!' + a) +}) + +client.on('offline', function (a) { + console.log('lost connection!' + a) +}) + +client.on('close', function (a) { + console.log('connection closed!' + a) +}) + +client.on('message', function (topic, message) { + console.log(message.toString()) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/client.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/client.js new file mode 100644 index 00000000..81ab1ae0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/client.js @@ -0,0 +1,1129 @@ +'use strict' + +/** + * Module dependencies + */ +var events = require('events') +var Store = require('./store') +var eos = require('end-of-stream') +var mqttPacket = require('mqtt-packet') +var Writable = require('readable-stream').Writable +var inherits = require('inherits') +var reInterval = require('reinterval') +var validations = require('./validations') +var xtend = require('xtend') +var setImmediate = global.setImmediate || function (callback) { + // works in node v0.8 + process.nextTick(callback) +} +var defaultConnectOptions = { + keepalive: 60, + reschedulePings: true, + protocolId: 'MQTT', + protocolVersion: 4, + reconnectPeriod: 1000, + connectTimeout: 30 * 1000, + clean: true, + resubscribe: true +} + +function defaultId () { + return 'mqttjs_' + Math.random().toString(16).substr(2, 8) +} + +function sendPacket (client, packet, cb) { + client.emit('packetsend', packet) + + var result = mqttPacket.writeToStream(packet, client.stream) + + if (!result && cb) { + client.stream.once('drain', cb) + } else if (cb) { + cb() + } +} + +function flush (queue) { + if (queue) { + Object.keys(queue).forEach(function (messageId) { + if (typeof queue[messageId] === 'function') { + queue[messageId](new Error('Connection closed')) + delete queue[messageId] + } + }) + } +} + +function storeAndSend (client, packet, cb) { + client.outgoingStore.put(packet, function storedPacket (err) { + if (err) { + return cb && cb(err) + } + sendPacket(client, packet, cb) + }) +} + +function nop () {} + +/** + * MqttClient constructor + * + * @param {Stream} stream - stream + * @param {Object} [options] - connection options + * (see Connection#connect) + */ +function MqttClient (streamBuilder, options) { + var k + var that = this + + if (!(this instanceof MqttClient)) { + return new MqttClient(streamBuilder, options) + } + + this.options = options || {} + + // Defaults + for (k in defaultConnectOptions) { + if (typeof this.options[k] === 'undefined') { + this.options[k] = defaultConnectOptions[k] + } else { + this.options[k] = options[k] + } + } + + this.options.clientId = (typeof this.options.clientId === 'string') ? this.options.clientId : defaultId() + + this.streamBuilder = streamBuilder + + // Inflight message storages + this.outgoingStore = this.options.outgoingStore || new Store() + this.incomingStore = this.options.incomingStore || new Store() + + // Should QoS zero messages be queued when the connection is broken? + this.queueQoSZero = this.options.queueQoSZero === undefined ? true : this.options.queueQoSZero + + // map of subscribed topics to support reconnection + this._resubscribeTopics = {} + + // map of a subscribe messageId and a topic + this.messageIdToTopic = {} + + // Ping timer, setup in _setupPingTimer + this.pingTimer = null + // Is the client connected? + this.connected = false + // Are we disconnecting? + this.disconnecting = false + // Packet queue + this.queue = [] + // connack timer + this.connackTimer = null + // Reconnect timer + this.reconnectTimer = null + /** + * MessageIDs starting with 1 + * ensure that nextId is min. 1, see https://github.com/mqttjs/MQTT.js/issues/810 + */ + this.nextId = Math.max(1, Math.floor(Math.random() * 65535)) + + // Inflight callbacks + this.outgoing = {} + + // Mark connected on connect + this.on('connect', function () { + if (this.disconnected) { + return + } + + this.connected = true + var outStore = this.outgoingStore.createStream() + + this.once('close', remove) + outStore.on('end', function () { + that.removeListener('close', remove) + }) + outStore.on('error', function (err) { + that.removeListener('close', remove) + that.emit('error', err) + }) + + function remove () { + outStore.destroy() + outStore = null + } + + function storeDeliver () { + // edge case, we wrapped this twice + if (!outStore) { + return + } + + var packet = outStore.read(1) + var cb + + if (!packet) { + // read when data is available in the future + outStore.once('readable', storeDeliver) + return + } + + // Avoid unnecessary stream read operations when disconnected + if (!that.disconnecting && !that.reconnectTimer) { + cb = that.outgoing[packet.messageId] + that.outgoing[packet.messageId] = function (err, status) { + // Ensure that the original callback passed in to publish gets invoked + if (cb) { + cb(err, status) + } + + storeDeliver() + } + that._sendPacket(packet) + } else if (outStore.destroy) { + outStore.destroy() + } + } + + // start flowing + storeDeliver() + }) + + // Mark disconnected on stream close + this.on('close', function () { + this.connected = false + clearTimeout(this.connackTimer) + }) + + // Setup ping timer + this.on('connect', this._setupPingTimer) + + // Send queued packets + this.on('connect', function () { + var queue = this.queue + + function deliver () { + var entry = queue.shift() + var packet = null + + if (!entry) { + return + } + + packet = entry.packet + + that._sendPacket( + packet, + function (err) { + if (entry.cb) { + entry.cb(err) + } + deliver() + } + ) + } + + deliver() + }) + + var firstConnection = true + // resubscribe + this.on('connect', function () { + if (!firstConnection && + this.options.clean && + Object.keys(this._resubscribeTopics).length > 0) { + if (this.options.resubscribe) { + this._resubscribeTopics.resubscribe = true + this.subscribe(this._resubscribeTopics) + } else { + this._resubscribeTopics = {} + } + } + + firstConnection = false + }) + + // Clear ping timer + this.on('close', function () { + if (that.pingTimer !== null) { + that.pingTimer.clear() + that.pingTimer = null + } + }) + + // Setup reconnect timer on disconnect + this.on('close', this._setupReconnect) + + events.EventEmitter.call(this) + + this._setupStream() +} +inherits(MqttClient, events.EventEmitter) + +/** + * setup the event handlers in the inner stream. + * + * @api private + */ +MqttClient.prototype._setupStream = function () { + var connectPacket + var that = this + var writable = new Writable() + var parser = mqttPacket.parser(this.options) + var completeParse = null + var packets = [] + + this._clearReconnect() + + this.stream = this.streamBuilder(this) + + parser.on('packet', function (packet) { + packets.push(packet) + }) + + function nextTickWork () { + process.nextTick(work) + } + + function work () { + var packet = packets.shift() + var done = completeParse + + if (packet) { + that._handlePacket(packet, nextTickWork) + } else { + completeParse = null + done() + } + } + + writable._write = function (buf, enc, done) { + completeParse = done + parser.parse(buf) + work() + } + + this.stream.pipe(writable) + + // Suppress connection errors + this.stream.on('error', nop) + + // Echo stream close + eos(this.stream, this.emit.bind(this, 'close')) + + // Send a connect packet + connectPacket = Object.create(this.options) + connectPacket.cmd = 'connect' + // avoid message queue + sendPacket(this, connectPacket) + + // Echo connection errors + parser.on('error', this.emit.bind(this, 'error')) + + // many drain listeners are needed for qos 1 callbacks if the connection is intermittent + this.stream.setMaxListeners(1000) + + clearTimeout(this.connackTimer) + this.connackTimer = setTimeout(function () { + that._cleanUp(true) + }, this.options.connectTimeout) +} + +MqttClient.prototype._handlePacket = function (packet, done) { + this.emit('packetreceive', packet) + + switch (packet.cmd) { + case 'publish': + this._handlePublish(packet, done) + break + case 'puback': + case 'pubrec': + case 'pubcomp': + case 'suback': + case 'unsuback': + this._handleAck(packet) + done() + break + case 'pubrel': + this._handlePubrel(packet, done) + break + case 'connack': + this._handleConnack(packet) + done() + break + case 'pingresp': + this._handlePingresp(packet) + done() + break + default: + // do nothing + // maybe we should do an error handling + // or just log it + break + } +} + +MqttClient.prototype._checkDisconnecting = function (callback) { + if (this.disconnecting) { + if (callback) { + callback(new Error('client disconnecting')) + } else { + this.emit('error', new Error('client disconnecting')) + } + } + return this.disconnecting +} + +/** + * publish - publish to + * + * @param {String} topic - topic to publish to + * @param {String, Buffer} message - message to publish + * @param {Object} [opts] - publish options, includes: + * {Number} qos - qos level to publish on + * {Boolean} retain - whether or not to retain the message + * {Boolean} dup - whether or not mark a message as duplicate + * @param {Function} [callback] - function(err){} + * called when publish succeeds or fails + * @returns {MqttClient} this - for chaining + * @api public + * + * @example client.publish('topic', 'message'); + * @example + * client.publish('topic', 'message', {qos: 1, retain: true, dup: true}); + * @example client.publish('topic', 'message', console.log); + */ +MqttClient.prototype.publish = function (topic, message, opts, callback) { + var packet + + // .publish(topic, payload, cb); + if (typeof opts === 'function') { + callback = opts + opts = null + } + + // default opts + var defaultOpts = {qos: 0, retain: false, dup: false} + opts = xtend(defaultOpts, opts) + + if (this._checkDisconnecting(callback)) { + return this + } + + packet = { + cmd: 'publish', + topic: topic, + payload: message, + qos: opts.qos, + retain: opts.retain, + messageId: this._nextId(), + dup: opts.dup + } + + switch (opts.qos) { + case 1: + case 2: + + // Add to callbacks + this.outgoing[packet.messageId] = callback || nop + this._sendPacket(packet) + break + default: + this._sendPacket(packet, callback) + break + } + + return this +} + +/** + * subscribe - subscribe to + * + * @param {String, Array, Object} topic - topic(s) to subscribe to, supports objects in the form {'topic': qos} + * @param {Object} [opts] - optional subscription options, includes: + * {Number} qos - subscribe qos level + * @param {Function} [callback] - function(err, granted){} where: + * {Error} err - subscription error (none at the moment!) + * {Array} granted - array of {topic: 't', qos: 0} + * @returns {MqttClient} this - for chaining + * @api public + * @example client.subscribe('topic'); + * @example client.subscribe('topic', {qos: 1}); + * @example client.subscribe({'topic': 0, 'topic2': 1}, console.log); + * @example client.subscribe('topic', console.log); + */ +MqttClient.prototype.subscribe = function () { + var packet + var args = Array.prototype.slice.call(arguments) + var subs = [] + var obj = args.shift() + var resubscribe = obj.resubscribe + var callback = args.pop() || nop + var opts = args.pop() + var invalidTopic + var that = this + + delete obj.resubscribe + + if (typeof obj === 'string') { + obj = [obj] + } + + if (typeof callback !== 'function') { + opts = callback + callback = nop + } + + invalidTopic = validations.validateTopics(obj) + if (invalidTopic !== null) { + setImmediate(callback, new Error('Invalid topic ' + invalidTopic)) + return this + } + + if (this._checkDisconnecting(callback)) { + return this + } + + var defaultOpts = { qos: 0 } + opts = xtend(defaultOpts, opts) + + if (Array.isArray(obj)) { + obj.forEach(function (topic) { + if (that._resubscribeTopics[topic] < opts.qos || + !that._resubscribeTopics.hasOwnProperty(topic) || + resubscribe) { + subs.push({ + topic: topic, + qos: opts.qos + }) + } + }) + } else { + Object + .keys(obj) + .forEach(function (k) { + if (that._resubscribeTopics[k] < obj[k] || + !that._resubscribeTopics.hasOwnProperty(k) || + resubscribe) { + subs.push({ + topic: k, + qos: obj[k] + }) + } + }) + } + + packet = { + cmd: 'subscribe', + subscriptions: subs, + qos: 1, + retain: false, + dup: false, + messageId: this._nextId() + } + + if (!subs.length) { + callback(null, []) + return + } + + // subscriptions to resubscribe to in case of disconnect + if (this.options.resubscribe) { + var topics = [] + subs.forEach(function (sub) { + if (that.options.reconnectPeriod > 0) { + that._resubscribeTopics[sub.topic] = sub.qos + topics.push(sub.topic) + } + }) + that.messageIdToTopic[packet.messageId] = topics + } + + this.outgoing[packet.messageId] = function (err, packet) { + if (!err) { + var granted = packet.granted + for (var i = 0; i < granted.length; i += 1) { + subs[i].qos = granted[i] + } + } + + callback(err, subs) + } + + this._sendPacket(packet) + + return this +} + +/** + * unsubscribe - unsubscribe from topic(s) + * + * @param {String, Array} topic - topics to unsubscribe from + * @param {Function} [callback] - callback fired on unsuback + * @returns {MqttClient} this - for chaining + * @api public + * @example client.unsubscribe('topic'); + * @example client.unsubscribe('topic', console.log); + */ +MqttClient.prototype.unsubscribe = function (topic, callback) { + var packet = { + cmd: 'unsubscribe', + qos: 1, + messageId: this._nextId() + } + var that = this + + callback = callback || nop + + if (this._checkDisconnecting(callback)) { + return this + } + + if (typeof topic === 'string') { + packet.unsubscriptions = [topic] + } else if (typeof topic === 'object' && topic.length) { + packet.unsubscriptions = topic + } + + if (this.options.resubscribe) { + packet.unsubscriptions.forEach(function (topic) { + delete that._resubscribeTopics[topic] + }) + } + + this.outgoing[packet.messageId] = callback + + this._sendPacket(packet) + + return this +} + +/** + * end - close connection + * + * @returns {MqttClient} this - for chaining + * @param {Boolean} force - do not wait for all in-flight messages to be acked + * @param {Function} cb - called when the client has been closed + * + * @api public + */ +MqttClient.prototype.end = function (force, cb) { + var that = this + + if (typeof force === 'function') { + cb = force + force = false + } + + function closeStores () { + that.disconnected = true + that.incomingStore.close(function () { + that.outgoingStore.close(function () { + if (cb) { + cb.apply(null, arguments) + } + that.emit('end') + }) + }) + if (that._deferredReconnect) { + that._deferredReconnect() + } + } + + function finish () { + // defer closesStores of an I/O cycle, + // just to make sure things are + // ok for websockets + that._cleanUp(force, setImmediate.bind(null, closeStores)) + } + + if (this.disconnecting) { + return this + } + + this._clearReconnect() + + this.disconnecting = true + + if (!force && Object.keys(this.outgoing).length > 0) { + // wait 10ms, just to be sure we received all of it + this.once('outgoingEmpty', setTimeout.bind(null, finish, 10)) + } else { + finish() + } + + return this +} + +/** + * removeOutgoingMessage - remove a message in outgoing store + * the outgoing callback will be called withe Error('Message removed') if the message is removed + * + * @param {Number} mid - messageId to remove message + * @returns {MqttClient} this - for chaining + * @api public + * + * @example client.removeOutgoingMessage(client.getLastMessageId()); + */ +MqttClient.prototype.removeOutgoingMessage = function (mid) { + var cb = this.outgoing[mid] + delete this.outgoing[mid] + this.outgoingStore.del({messageId: mid}, function () { + cb(new Error('Message removed')) + }) + return this +} + +/** + * reconnect - connect again using the same options as connect() + * + * @param {Object} [opts] - optional reconnect options, includes: + * {Store} incomingStore - a store for the incoming packets + * {Store} outgoingStore - a store for the outgoing packets + * if opts is not given, current stores are used + * @returns {MqttClient} this - for chaining + * + * @api public + */ +MqttClient.prototype.reconnect = function (opts) { + var that = this + var f = function () { + if (opts) { + that.options.incomingStore = opts.incomingStore + that.options.outgoingStore = opts.outgoingStore + } else { + that.options.incomingStore = null + that.options.outgoingStore = null + } + that.incomingStore = that.options.incomingStore || new Store() + that.outgoingStore = that.options.outgoingStore || new Store() + that.disconnecting = false + that.disconnected = false + that._deferredReconnect = null + that._reconnect() + } + + if (this.disconnecting && !this.disconnected) { + this._deferredReconnect = f + } else { + f() + } + return this +} + +/** + * _reconnect - implement reconnection + * @api privateish + */ +MqttClient.prototype._reconnect = function () { + this.emit('reconnect') + this._setupStream() +} + +/** + * _setupReconnect - setup reconnect timer + */ +MqttClient.prototype._setupReconnect = function () { + var that = this + + if (!that.disconnecting && !that.reconnectTimer && (that.options.reconnectPeriod > 0)) { + if (!this.reconnecting) { + this.emit('offline') + this.reconnecting = true + } + that.reconnectTimer = setInterval(function () { + that._reconnect() + }, that.options.reconnectPeriod) + } +} + +/** + * _clearReconnect - clear the reconnect timer + */ +MqttClient.prototype._clearReconnect = function () { + if (this.reconnectTimer) { + clearInterval(this.reconnectTimer) + this.reconnectTimer = null + } +} + +/** + * _cleanUp - clean up on connection end + * @api private + */ +MqttClient.prototype._cleanUp = function (forced, done) { + if (done) { + this.stream.on('close', done) + } + + if (forced) { + if ((this.options.reconnectPeriod === 0) && this.options.clean) { + flush(this.outgoing) + } + this.stream.destroy() + } else { + this._sendPacket( + { cmd: 'disconnect' }, + setImmediate.bind( + null, + this.stream.end.bind(this.stream) + ) + ) + } + + if (!this.disconnecting) { + this._clearReconnect() + this._setupReconnect() + } + + if (this.pingTimer !== null) { + this.pingTimer.clear() + this.pingTimer = null + } + + if (done && !this.connected) { + this.stream.removeListener('close', done) + done() + } +} + +/** + * _sendPacket - send or queue a packet + * @param {String} type - packet type (see `protocol`) + * @param {Object} packet - packet options + * @param {Function} cb - callback when the packet is sent + * @api private + */ +MqttClient.prototype._sendPacket = function (packet, cb) { + if (!this.connected) { + if (((packet.qos || 0) === 0 && this.queueQoSZero) || packet.cmd !== 'publish') { + this.queue.push({ packet: packet, cb: cb }) + } else if (packet.qos > 0) { + cb = this.outgoing[packet.messageId] + this.outgoingStore.put(packet, function (err) { + if (err) { + return cb && cb(err) + } + }) + } else if (cb) { + cb(new Error('No connection to broker')) + } + + return + } + + // When sending a packet, reschedule the ping timer + this._shiftPingInterval() + + switch (packet.cmd) { + case 'publish': + break + case 'pubrel': + storeAndSend(this, packet, cb) + return + default: + sendPacket(this, packet, cb) + return + } + + switch (packet.qos) { + case 2: + case 1: + storeAndSend(this, packet, cb) + break + /** + * no need of case here since it will be caught by default + * and jshint comply that before default it must be a break + * anyway it will result in -1 evaluation + */ + case 0: + /* falls through */ + default: + sendPacket(this, packet, cb) + break + } +} + +/** + * _setupPingTimer - setup the ping timer + * + * @api private + */ +MqttClient.prototype._setupPingTimer = function () { + var that = this + + if (!this.pingTimer && this.options.keepalive) { + this.pingResp = true + this.pingTimer = reInterval(function () { + that._checkPing() + }, this.options.keepalive * 1000) + } +} + +/** + * _shiftPingInterval - reschedule the ping interval + * + * @api private + */ +MqttClient.prototype._shiftPingInterval = function () { + if (this.pingTimer && this.options.keepalive && this.options.reschedulePings) { + this.pingTimer.reschedule(this.options.keepalive * 1000) + } +} +/** + * _checkPing - check if a pingresp has come back, and ping the server again + * + * @api private + */ +MqttClient.prototype._checkPing = function () { + if (this.pingResp) { + this.pingResp = false + this._sendPacket({ cmd: 'pingreq' }) + } else { + // do a forced cleanup since socket will be in bad shape + this._cleanUp(true) + } +} + +/** + * _handlePingresp - handle a pingresp + * + * @api private + */ +MqttClient.prototype._handlePingresp = function () { + this.pingResp = true +} + +/** + * _handleConnack + * + * @param {Object} packet + * @api private + */ + +MqttClient.prototype._handleConnack = function (packet) { + var rc = packet.returnCode + var errors = [ + '', + 'Unacceptable protocol version', + 'Identifier rejected', + 'Server unavailable', + 'Bad username or password', + 'Not authorized' + ] + + clearTimeout(this.connackTimer) + + if (rc === 0) { + this.reconnecting = false + this.emit('connect', packet) + } else if (rc > 0) { + var err = new Error('Connection refused: ' + errors[rc]) + err.code = rc + this.emit('error', err) + } +} + +/** + * _handlePublish + * + * @param {Object} packet + * @api private + */ +/* +those late 2 case should be rewrite to comply with coding style: + +case 1: +case 0: + // do not wait sending a puback + // no callback passed + if (1 === qos) { + this._sendPacket({ + cmd: 'puback', + messageId: mid + }); + } + // emit the message event for both qos 1 and 0 + this.emit('message', topic, message, packet); + this.handleMessage(packet, done); + break; +default: + // do nothing but every switch mus have a default + // log or throw an error about unknown qos + break; + +for now i just suppressed the warnings +*/ +MqttClient.prototype._handlePublish = function (packet, done) { + done = typeof done !== 'undefined' ? done : nop + var topic = packet.topic.toString() + var message = packet.payload + var qos = packet.qos + var mid = packet.messageId + var that = this + + switch (qos) { + case 2: + this.incomingStore.put(packet, function (err) { + if (err) { + return done(err) + } + that._sendPacket({cmd: 'pubrec', messageId: mid}, done) + }) + break + case 1: + // emit the message event + this.emit('message', topic, message, packet) + this.handleMessage(packet, function (err) { + if (err) { + return done(err) + } + // send 'puback' if the above 'handleMessage' method executed + // successfully. + that._sendPacket({cmd: 'puback', messageId: mid}, done) + }) + break + case 0: + // emit the message event + this.emit('message', topic, message, packet) + this.handleMessage(packet, done) + break + default: + // do nothing + // log or throw an error about unknown qos + break + } +} + +/** + * Handle messages with backpressure support, one at a time. + * Override at will. + * + * @param Packet packet the packet + * @param Function callback call when finished + * @api public + */ +MqttClient.prototype.handleMessage = function (packet, callback) { + callback() +} + +/** + * _handleAck + * + * @param {Object} packet + * @api private + */ + +MqttClient.prototype._handleAck = function (packet) { + /* eslint no-fallthrough: "off" */ + var mid = packet.messageId + var type = packet.cmd + var response = null + var cb = this.outgoing[mid] + var that = this + + if (!cb) { + // Server sent an ack in error, ignore it. + return + } + + // Process + switch (type) { + case 'pubcomp': + // same thing as puback for QoS 2 + case 'puback': + // Callback - we're done + delete this.outgoing[mid] + this.outgoingStore.del(packet, cb) + break + case 'pubrec': + response = { + cmd: 'pubrel', + qos: 2, + messageId: mid + } + + this._sendPacket(response) + break + case 'suback': + delete this.outgoing[mid] + if (packet.granted.length === 1 && (packet.granted[0] & 0x80) !== 0) { + // suback with Failure status + var topics = this.messageIdToTopic[mid] + if (topics) { + topics.forEach(function (topic) { + delete that._resubscribeTopics[topic] + }) + } + } + cb(null, packet) + break + case 'unsuback': + delete this.outgoing[mid] + cb(null) + break + default: + that.emit('error', new Error('unrecognized packet type')) + } + + if (this.disconnecting && + Object.keys(this.outgoing).length === 0) { + this.emit('outgoingEmpty') + } +} + +/** + * _handlePubrel + * + * @param {Object} packet + * @api private + */ +MqttClient.prototype._handlePubrel = function (packet, callback) { + callback = typeof callback !== 'undefined' ? callback : nop + var mid = packet.messageId + var that = this + + var comp = {cmd: 'pubcomp', messageId: mid} + + that.incomingStore.get(packet, function (err, pub) { + if (!err && pub.cmd !== 'pubrel') { + that.emit('message', pub.topic, pub.payload, pub) + that.incomingStore.put(packet, function (err) { + if (err) { + return callback(err) + } + that.handleMessage(pub, function (err) { + if (err) { + return callback(err) + } + that._sendPacket(comp, callback) + }) + }) + } else { + that._sendPacket(comp, callback) + } + }) +} + +/** + * _nextId + * @return unsigned int + */ +MqttClient.prototype._nextId = function () { + // id becomes current state of this.nextId and increments afterwards + var id = this.nextId++ + // Ensure 16 bit unsigned int (max 65535, nextId got one higher) + if (this.nextId === 65536) { + this.nextId = 1 + } + return id +} + +/** + * getLastMessageId + * @return unsigned int + */ +MqttClient.prototype.getLastMessageId = function () { + return (this.nextId === 1) ? 65535 : (this.nextId - 1) +} + +module.exports = MqttClient diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/index.js new file mode 100644 index 00000000..5ec9c3b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/index.js @@ -0,0 +1,149 @@ +'use strict' + +var MqttClient = require('../client') +var Store = require('../store') +var url = require('url') +var xtend = require('xtend') +var protocols = {} + +if (process.title !== 'browser') { + protocols.mqtt = require('./tcp') + protocols.tcp = require('./tcp') + protocols.ssl = require('./tls') + protocols.tls = require('./tls') + protocols.mqtts = require('./tls') +} else { + protocols.wx = require('./wx') + protocols.wxs = require('./wx') +} + +protocols.ws = require('./ws') +protocols.wss = require('./ws') + +/** + * Parse the auth attribute and merge username and password in the options object. + * + * @param {Object} [opts] option object + */ +function parseAuthOptions (opts) { + var matches + if (opts.auth) { + matches = opts.auth.match(/^(.+):(.+)$/) + if (matches) { + opts.username = matches[1] + opts.password = matches[2] + } else { + opts.username = opts.auth + } + } +} + +/** + * connect - connect to an MQTT broker. + * + * @param {String} [brokerUrl] - url of the broker, optional + * @param {Object} opts - see MqttClient#constructor + */ +function connect (brokerUrl, opts) { + if ((typeof brokerUrl === 'object') && !opts) { + opts = brokerUrl + brokerUrl = null + } + + opts = opts || {} + + if (brokerUrl) { + var parsed = url.parse(brokerUrl, true) + if (parsed.port != null) { + parsed.port = Number(parsed.port) + } + + opts = xtend(parsed, opts) + + if (opts.protocol === null) { + throw new Error('Missing protocol') + } + opts.protocol = opts.protocol.replace(/:$/, '') + } + + // merge in the auth options if supplied + parseAuthOptions(opts) + + // support clientId passed in the query string of the url + if (opts.query && typeof opts.query.clientId === 'string') { + opts.clientId = opts.query.clientId + } + + if (opts.cert && opts.key) { + if (opts.protocol) { + if (['mqtts', 'wss', 'wxs'].indexOf(opts.protocol) === -1) { + switch (opts.protocol) { + case 'mqtt': + opts.protocol = 'mqtts' + break + case 'ws': + opts.protocol = 'wss' + break + case 'wx': + opts.protocol = 'wxs' + break + default: + throw new Error('Unknown protocol for secure connection: "' + opts.protocol + '"!') + } + } + } else { + // don't know what protocol he want to use, mqtts or wss + throw new Error('Missing secure protocol key') + } + } + + if (!protocols[opts.protocol]) { + var isSecure = ['mqtts', 'wss'].indexOf(opts.protocol) !== -1 + opts.protocol = [ + 'mqtt', + 'mqtts', + 'ws', + 'wss', + 'wx', + 'wxs' + ].filter(function (key, index) { + if (isSecure && index % 2 === 0) { + // Skip insecure protocols when requesting a secure one. + return false + } + return (typeof protocols[key] === 'function') + })[0] + } + + if (opts.clean === false && !opts.clientId) { + throw new Error('Missing clientId for unclean clients') + } + + if (opts.protocol) { + opts.defaultProtocol = opts.protocol + } + + function wrapper (client) { + if (opts.servers) { + if (!client._reconnectCount || client._reconnectCount === opts.servers.length) { + client._reconnectCount = 0 + } + + opts.host = opts.servers[client._reconnectCount].host + opts.port = opts.servers[client._reconnectCount].port + opts.protocol = (!opts.servers[client._reconnectCount].protocol ? opts.defaultProtocol : opts.servers[client._reconnectCount].protocol) + opts.hostname = opts.host + + client._reconnectCount++ + } + + return protocols[opts.protocol](client, opts) + } + + return new MqttClient(wrapper, opts) +} + +module.exports = connect +module.exports.connect = connect +module.exports.MqttClient = MqttClient +module.exports.Store = Store diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/tcp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/tcp.js new file mode 100644 index 00000000..b47770db --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/tcp.js @@ -0,0 +1,19 @@ +'use strict' +var net = require('net') + +/* + variables port and host can be removed since + you have all required information in opts object +*/ +function buildBuilder (client, opts) { + var port, host + opts.port = opts.port || 1883 + opts.hostname = opts.hostname || opts.host || 'localhost' + + port = opts.port + host = opts.hostname + + return net.createConnection(port, host) +} + +module.exports = buildBuilder diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/tls.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/tls.js new file mode 100644 index 00000000..eda78be5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/tls.js @@ -0,0 +1,41 @@ +'use strict' +var tls = require('tls') + +function buildBuilder (mqttClient, opts) { + var connection + opts.port = opts.port || 8883 + opts.host = opts.hostname || opts.host || 'localhost' + + opts.rejectUnauthorized = opts.rejectUnauthorized !== false + + delete opts.path + + connection = tls.connect(opts) + /* eslint no-use-before-define: [2, "nofunc"] */ + connection.on('secureConnect', function () { + if (opts.rejectUnauthorized && !connection.authorized) { + connection.emit('error', new Error('TLS not authorized')) + } else { + connection.removeListener('error', handleTLSerrors) + } + }) + + function handleTLSerrors (err) { + // How can I get verify this error is a tls error? + if (opts.rejectUnauthorized) { + mqttClient.emit('error', err) + } + + // close this connection to match the behaviour of net + // otherwise all we get is an error from the connection + // and close event doesn't fire. This is a work around + // to enable the reconnect code to work the same as with + // net.createConnection + connection.end() + } + + connection.on('error', handleTLSerrors) + return connection +} + +module.exports = buildBuilder diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/ws.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/ws.js new file mode 100644 index 00000000..65e25e3a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/ws.js @@ -0,0 +1,92 @@ +'use strict' + +var websocket = require('websocket-stream') +var urlModule = require('url') +var WSS_OPTIONS = [ + 'rejectUnauthorized', + 'ca', + 'cert', + 'key', + 'pfx', + 'passphrase' +] +var IS_BROWSER = process.title === 'browser' + +function buildUrl (opts, client) { + var url = opts.protocol + '://' + opts.hostname + ':' + opts.port + opts.path + if (typeof (opts.transformWsUrl) === 'function') { + url = opts.transformWsUrl(url, opts, client) + } + return url +} + +function setDefaultOpts (opts) { + if (!opts.hostname) { + opts.hostname = 'localhost' + } + if (!opts.port) { + if (opts.protocol === 'wss') { + opts.port = 443 + } else { + opts.port = 80 + } + } + if (!opts.path) { + opts.path = '/' + } + + if (!opts.wsOptions) { + opts.wsOptions = {} + } + if (!IS_BROWSER && opts.protocol === 'wss') { + // Add cert/key/ca etc options + WSS_OPTIONS.forEach(function (prop) { + if (opts.hasOwnProperty(prop) && !opts.wsOptions.hasOwnProperty(prop)) { + opts.wsOptions[prop] = opts[prop] + } + }) + } +} + +function createWebSocket (client, opts) { + var websocketSubProtocol = + (opts.protocolId === 'MQIsdp') && (opts.protocolVersion === 3) + ? 'mqttv3.1' + : 'mqtt' + + setDefaultOpts(opts) + var url = buildUrl(opts, client) + return websocket(url, [websocketSubProtocol], opts.wsOptions) +} + +function buildBuilder (client, opts) { + return createWebSocket(client, opts) +} + +function buildBuilderBrowser (client, opts) { + if (!opts.hostname) { + opts.hostname = opts.host + } + + if (!opts.hostname) { + // Throwing an error in a Web Worker if no `hostname` is given, because we + // can not determine the `hostname` automatically. If connecting to + // localhost, please supply the `hostname` as an argument. + if (typeof (document) === 'undefined') { + throw new Error('Could not determine host. Specify host manually.') + } + var parsed = urlModule.parse(document.URL) + opts.hostname = parsed.hostname + + if (!opts.port) { + opts.port = parsed.port + } + } + return createWebSocket(client, opts) +} + +if (IS_BROWSER) { + module.exports = buildBuilderBrowser +} else { + module.exports = buildBuilder +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/wx.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/wx.js new file mode 100644 index 00000000..51781179 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/connect/wx.js @@ -0,0 +1,110 @@ +'use strict' + +/* global wx */ +var socketOpen = false +var socketMsgQueue = [] + +function sendSocketMessage (msg) { + if (socketOpen) { + wx.sendSocketMessage({ + data: msg.buffer || msg + }) + } else { + socketMsgQueue.push(msg) + } +} + +function WebSocket (url, protocols) { + var ws = { + OPEN: 1, + CLOSING: 2, + CLOSED: 3, + readyState: socketOpen ? 1 : 0, + send: sendSocketMessage, + close: wx.closeSocket, + onopen: null, + onmessage: null, + onclose: null, + onerror: null + } + + wx.connectSocket({ + url: url, + protocols: protocols + }) + wx.onSocketOpen(function (res) { + ws.readyState = ws.OPEN + socketOpen = true + for (var i = 0; i < socketMsgQueue.length; i++) { + sendSocketMessage(socketMsgQueue[i]) + } + socketMsgQueue = [] + + ws.onopen && ws.onopen.apply(ws, arguments) + }) + wx.onSocketMessage(function (res) { + ws.onmessage && ws.onmessage.apply(ws, arguments) + }) + wx.onSocketClose(function () { + ws.onclose && ws.onclose.apply(ws, arguments) + ws.readyState = ws.CLOSED + socketOpen = false + }) + wx.onSocketError(function () { + ws.onerror && ws.onerror.apply(ws, arguments) + ws.readyState = ws.CLOSED + socketOpen = false + }) + + return ws +} + +var websocket = require('websocket-stream') + +function buildUrl (opts, client) { + var protocol = opts.protocol === 'wxs' ? 'wss' : 'ws' + var url = protocol + '://' + opts.hostname + opts.path + if (opts.port && opts.port !== 80 && opts.port !== 443) { + url = protocol + '://' + opts.hostname + ':' + opts.port + opts.path + } + if (typeof (opts.transformWsUrl) === 'function') { + url = opts.transformWsUrl(url, opts, client) + } + return url +} + +function setDefaultOpts (opts) { + if (!opts.hostname) { + opts.hostname = 'localhost' + } + if (!opts.path) { + opts.path = '/' + } + + if (!opts.wsOptions) { + opts.wsOptions = {} + } +} + +function createWebSocket (client, opts) { + var websocketSubProtocol = + (opts.protocolId === 'MQIsdp') && (opts.protocolVersion === 3) + ? 'mqttv3.1' + : 'mqtt' + + setDefaultOpts(opts) + var url = buildUrl(opts, client) + return websocket(WebSocket(url, [websocketSubProtocol])) +} + +function buildBuilder (client, opts) { + opts.hostname = opts.hostname || opts.host + + if (!opts.hostname) { + throw new Error('Could not determine host. Specify host manually.') + } + + return createWebSocket(client, opts) +} + +module.exports = buildBuilder diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/store.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/store.js new file mode 100644 index 00000000..97aef436 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/store.js @@ -0,0 +1,140 @@ +'use strict' + +/** + * Module dependencies + */ +var xtend = require('xtend') + +var Readable = require('readable-stream').Readable +var streamsOpts = { objectMode: true } +var defaultStoreOptions = { + clean: true +} + +/** + * es6-map can preserve insertion order even if ES version is older. + * + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Description + * It should be noted that a Map which is a map of an object, especially + * a dictionary of dictionaries, will only map to the object's insertion + * order. In ES2015 this is ordered for objects but for older versions of + * ES, this may be random and not ordered. + * + */ +var Map = require('es6-map') + +/** + * In-memory implementation of the message store + * This can actually be saved into files. + * + * @param {Object} [options] - store options + */ +function Store (options) { + if (!(this instanceof Store)) { + return new Store(options) + } + + this.options = options || {} + + // Defaults + this.options = xtend(defaultStoreOptions, options) + + this._inflights = new Map() +} + +/** + * Adds a packet to the store, a packet is + * anything that has a messageId property. + * + */ +Store.prototype.put = function (packet, cb) { + this._inflights.set(packet.messageId, packet) + + if (cb) { + cb() + } + + return this +} + +/** + * Creates a stream with all the packets in the store + * + */ +Store.prototype.createStream = function () { + var stream = new Readable(streamsOpts) + var destroyed = false + var values = [] + var i = 0 + + this._inflights.forEach(function (value, key) { + values.push(value) + }) + + stream._read = function () { + if (!destroyed && i < values.length) { + this.push(values[i++]) + } else { + this.push(null) + } + } + + stream.destroy = function () { + if (destroyed) { + return + } + + var self = this + + destroyed = true + + process.nextTick(function () { + self.emit('close') + }) + } + + return stream +} + +/** + * deletes a packet from the store. + */ +Store.prototype.del = function (packet, cb) { + packet = this._inflights.get(packet.messageId) + if (packet) { + this._inflights.delete(packet.messageId) + cb(null, packet) + } else if (cb) { + cb(new Error('missing packet')) + } + + return this +} + +/** + * get a packet from the store. + */ +Store.prototype.get = function (packet, cb) { + packet = this._inflights.get(packet.messageId) + if (packet) { + cb(null, packet) + } else if (cb) { + cb(new Error('missing packet')) + } + + return this +} + +/** + * Close the store + */ +Store.prototype.close = function (cb) { + if (this.options.clean) { + this._inflights = null + } + if (cb) { + cb() + } +} + +module.exports = Store diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/validations.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/validations.js new file mode 100644 index 00000000..1a327790 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/lib/validations.js @@ -0,0 +1,52 @@ +'use strict' + +/** + * Validate a topic to see if it's valid or not. + * A topic is valid if it follow below rules: + * - Rule #1: If any part of the topic is not `+` or `#`, then it must not contain `+` and '#' + * - Rule #2: Part `#` must be located at the end of the mailbox + * + * @param {String} topic - A topic + * @returns {Boolean} If the topic is valid, returns true. Otherwise, returns false. + */ +function validateTopic (topic) { + var parts = topic.split('/') + + for (var i = 0; i < parts.length; i++) { + if (parts[i] === '+') { + continue + } + + if (parts[i] === '#') { + // for Rule #2 + return i === parts.length - 1 + } + + if (parts[i].indexOf('+') !== -1 || parts[i].indexOf('#') !== -1) { + return false + } + } + + return true +} + +/** + * Validate an array of topics to see if any of them is valid or not + * @param {Array} topics - Array of topics + * @returns {String} If the topics is valid, returns null. Otherwise, returns the invalid one + */ +function validateTopics (topics) { + if (topics.length === 0) { + return 'empty_topic_list' + } + for (var i = 0; i < topics.length; i++) { + if (!validateTopic(topics[i])) { + return topics[i] + } + } + return null +} + +module.exports = { + validateTopics: validateTopics +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/mqtt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/mqtt.js new file mode 100755 index 00000000..d60f7bd6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/mqtt.js @@ -0,0 +1,41 @@ +#!/usr/bin/env node +'use strict' + +/* + * Copyright (c) 2015-2015 MQTT.js contributors. + * Copyright (c) 2011-2014 Adam Rudd. + * + * See LICENSE for more information + */ + +var MqttClient = require('./lib/client') +var connect = require('./lib/connect') +var Store = require('./lib/store') + +module.exports.connect = connect + +// Expose MqttClient +module.exports.MqttClient = MqttClient +module.exports.Client = MqttClient +module.exports.Store = Store + +function cli () { + var commist = require('commist')() + var helpMe = require('help-me')() + + commist.register('publish', require('./bin/pub')) + commist.register('subscribe', require('./bin/sub')) + commist.register('version', function () { + console.log('MQTT.js version:', require('./package.json').version) + }) + commist.register('help', helpMe.toStdout) + + if (commist.parse(process.argv.slice(2)) !== null) { + console.log('No such command:', process.argv[2], '\n') + helpMe.toStdout() + } +} + +if (require.main === module) { + cli() +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/.travis.yml new file mode 100644 index 00000000..17f94330 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + +script: "npm test" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/LICENSE new file mode 100644 index 00000000..757562ec --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/README.md new file mode 100644 index 00000000..4c81471a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/README.md @@ -0,0 +1,65 @@ +# pump + +pump is a small node module that pipes streams together and destroys all of them if one of them closes. + +``` +npm install pump +``` + +[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump) + +## What problem does it solve? + +When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error. +You are also not able to provide a callback to tell when then pipe has finished. + +pump does these two things for you + +## Usage + +Simply pass the streams you want to pipe together to pump and add an optional callback + +``` js +var pump = require('pump') +var fs = require('fs') + +var source = fs.createReadStream('/dev/random') +var dest = fs.createWriteStream('/dev/null') + +pump(source, dest, function(err) { + console.log('pipe finished', err) +}) + +setTimeout(function() { + dest.destroy() // when dest is closed pump will destroy source +}, 1000) +``` + +You can use pump to pipe more than two streams together as well + +``` js +var transform = someTransformStream() + +pump(source, transform, anotherTransform, dest, function(err) { + console.log('pipe finished', err) +}) +``` + +If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. + +Similarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do: + +``` +return pump(s1, s2) // returns s2 +``` + +If you want to return a stream that combines *both* s1 and s2 to a single stream use +[pumpify](https://github.com/mafintosh/pumpify) instead. + +## License + +MIT + +## Related + +`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/index.js new file mode 100644 index 00000000..c15059f1 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/index.js @@ -0,0 +1,82 @@ +var once = require('once') +var eos = require('end-of-stream') +var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes + +var noop = function () {} +var ancient = /^v?\.0/.test(process.version) + +var isFn = function (fn) { + return typeof fn === 'function' +} + +var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} + +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) +} + +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) + + var closed = false + stream.on('close', function () { + closed = true + }) + + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) + + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true + + if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + + if (isFn(stream.destroy)) return stream.destroy() + + callback(err || new Error('stream was destroyed')) + } +} + +var call = function (fn) { + fn() +} + +var pipe = function (from, to) { + return from.pipe(to) +} + +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop + + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') + + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) + + return streams.reduce(pipe) +} + +module.exports = pump diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/package.json new file mode 100644 index 00000000..4946c001 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/package.json @@ -0,0 +1,59 @@ +{ + "_from": "pump@^3.0.0", + "_id": "pump@3.0.0", + "_inBundle": false, + "_integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "_location": "/node-red-contrib-johnny-five/mqtt/pump", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pump@^3.0.0", + "name": "pump", + "escapedName": "pump", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/mqtt" + ], + "_resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "_shasum": "b4a2116815bde2f4e1ea602354e8c75565107a64", + "_spec": "pump@^3.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/mqtt", + "author": { + "name": "Mathias Buus Madsen", + "email": "mathiasbuus@gmail.com" + }, + "browser": { + "fs": false + }, + "bugs": { + "url": "https://github.com/mafintosh/pump/issues" + }, + "bundleDependencies": false, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + }, + "deprecated": false, + "description": "pipe streams together and close all of them if one of them closes", + "homepage": "https://github.com/mafintosh/pump#readme", + "keywords": [ + "streams", + "pipe", + "destroy", + "callback" + ], + "license": "MIT", + "name": "pump", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/pump.git" + }, + "scripts": { + "test": "node test-browser.js && node test-node.js" + }, + "version": "3.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/test-browser.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/test-browser.js new file mode 100644 index 00000000..9a06c8a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/test-browser.js @@ -0,0 +1,66 @@ +var stream = require('stream') +var pump = require('./index') + +var rs = new stream.Readable() +var ws = new stream.Writable() + +rs._read = function (size) { + this.push(Buffer(size).fill('abc')) +} + +ws._write = function (chunk, encoding, cb) { + setTimeout(function () { + cb() + }, 100) +} + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-browser.js passes') + clearTimeout(timeout) + } +} + +ws.on('finish', function () { + wsClosed = true + check() +}) + +rs.on('end', function () { + rsClosed = true + check() +}) + +var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +if (res !== ws) { + throw new Error('should return last stream') +} + +setTimeout(function () { + rs.push(null) + rs.emit('close') +}, 1000) + +var timeout = setTimeout(function () { + check() + throw new Error('timeout') +}, 5000) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/test-node.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/test-node.js new file mode 100644 index 00000000..561251a0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/node_modules/pump/test-node.js @@ -0,0 +1,53 @@ +var pump = require('./index') + +var rs = require('fs').createReadStream('/dev/random') +var ws = require('fs').createWriteStream('/dev/null') + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-node.js passes') + clearTimeout(timeout) + } +} + +ws.on('close', function () { + wsClosed = true + check() +}) + +rs.on('close', function () { + rsClosed = true + check() +}) + +var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +if (res !== ws) { + throw new Error('should return last stream') +} + +setTimeout(function () { + rs.destroy() +}, 1000) + +var timeout = setTimeout(function () { + throw new Error('timeout') +}, 5000) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/package.json new file mode 100644 index 00000000..9f4bdd9e --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/package.json @@ -0,0 +1,150 @@ +{ + "_from": "mqtt@^2.15.2", + "_id": "mqtt@2.18.8", + "_inBundle": false, + "_integrity": "sha512-3h6oHlPY/yWwtC2J3geraYRtVVoRM6wdI+uchF4nvSSafXPZnaKqF8xnX+S22SU/FcgEAgockVIlOaAX3fkMpA==", + "_location": "/node-red-contrib-johnny-five/mqtt", + "_phantomChildren": { + "end-of-stream": "1.4.1", + "once": "1.4.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "mqtt@^2.15.2", + "name": "mqtt", + "escapedName": "mqtt", + "rawSpec": "^2.15.2", + "saveSpec": null, + "fetchSpec": "^2.15.2" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five" + ], + "_resolved": "https://registry.npmjs.org/mqtt/-/mqtt-2.18.8.tgz", + "_shasum": "9d213ccab92151accfb21ee8c0860dc6866ab259", + "_spec": "mqtt@^2.15.2", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five", + "bin": { + "mqtt_pub": "./bin/pub.js", + "mqtt_sub": "./bin/sub.js", + "mqtt": "./mqtt.js" + }, + "browser": { + "./mqtt.js": "./lib/connect/index.js", + "fs": false, + "tls": false, + "net": false + }, + "bugs": { + "url": "https://github.com/mqttjs/MQTT.js/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Adam Rudd", + "email": "adamvrr@gmail.com" + }, + { + "name": "Matteo Collina", + "email": "matteo.collina@gmail.com", + "url": "https://github.com/mcollina" + } + ], + "dependencies": { + "commist": "^1.0.0", + "concat-stream": "^1.6.2", + "end-of-stream": "^1.4.1", + "es6-map": "^0.1.5", + "help-me": "^1.0.1", + "inherits": "^2.0.3", + "minimist": "^1.2.0", + "mqtt-packet": "^5.6.0", + "pump": "^3.0.0", + "readable-stream": "^2.3.6", + "reinterval": "^1.1.0", + "split2": "^2.1.1", + "websocket-stream": "^5.1.2", + "xtend": "^4.0.1" + }, + "deprecated": false, + "description": "A library for the MQTT protocol", + "devDependencies": { + "@types/node": "^8.10.21", + "browserify": "^16.2.2", + "codecov": "^3.0.4", + "global": "^4.3.2", + "istanbul": "^0.4.5", + "mkdirp": "^0.5.1", + "mocha": "^4.1.0", + "mqtt-connection": "^3.0.0", + "pre-commit": "^1.2.2", + "rimraf": "^2.6.2", + "safe-buffer": "^5.1.2", + "should": "^13.2.1", + "sinon": "~1.17.7", + "snazzy": "^7.1.1", + "standard": "^11.0.1", + "through2": "^2.0.3", + "tslint": "^5.11.0", + "tslint-config-standard": "^7.1.0", + "typescript": "^2.9.2", + "uglify-js": "^3.4.5", + "ws": "^3.3.3", + "zuul": "^3.12.0", + "zuul-ngrok": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + }, + "files": [ + "dist/", + "CONTRIBUTING.md", + "doc", + "lib", + "bin", + "examples", + "test", + "types", + "mqtt.js" + ], + "homepage": "https://github.com/mqttjs/MQTT.js#readme", + "keywords": [ + "mqtt", + "publish/subscribe", + "publish", + "subscribe" + ], + "license": "MIT", + "main": "mqtt.js", + "name": "mqtt", + "pre-commit": [ + "test", + "tslint" + ], + "repository": { + "type": "git", + "url": "git://github.com/mqttjs/MQTT.js.git" + }, + "scripts": { + "browser-build": "rimraf dist/ && mkdirp dist/ && browserify mqtt.js -s mqtt > dist/mqtt.js && uglifyjs < dist/mqtt.js > dist/mqtt.min.js", + "browser-test": "zuul --server test/browser/server.js --local --open test/browser/test.js", + "ci": "npm run tslint && npm run typescript-test && npm run test && codecov", + "prepare": "npm run browser-build", + "pretest": "standard | snazzy", + "sauce-test": "zuul --server test/browser/server.js --tunnel ngrok -- test/browser/test.js", + "test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly --", + "tslint": "if [[ \"`node -v`\" != \"v4.3.2\" ]]; then tslint types/**/*.d.ts; fi", + "typescript-compile-execute": "node test/typescript/*.js", + "typescript-compile-test": "tsc -p test/typescript/tsconfig.json", + "typescript-test": "npm run typescript-compile-test && npm run typescript-compile-execute", + "weapp-test": "zuul --server test/browser/server.js --local --open test/browser/wx.js" + }, + "standard": { + "env": [ + "mocha" + ] + }, + "types": "types/index.d.ts", + "version": "2.18.8" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/abstract_client.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/abstract_client.js new file mode 100644 index 00000000..87c0b98b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/abstract_client.js @@ -0,0 +1,2667 @@ +'use strict' + +/** + * Testing dependencies + */ +var should = require('should') +var sinon = require('sinon') +var mqtt = require('../') +var xtend = require('xtend') +var Server = require('./server') +var Store = require('./../lib/store') +var port = 9876 + +module.exports = function (server, config) { + function connect (opts) { + opts = xtend(config, opts) + return mqtt.connect(opts) + } + + describe('closing', function () { + it('should emit close if stream closes', function (done) { + var client = connect() + + client.once('connect', function () { + client.stream.end() + }) + client.once('close', function () { + client.end() + done() + }) + }) + + it('should mark the client as disconnected', function (done) { + var client = connect() + + client.once('close', function () { + client.end() + if (!client.connected) { + done() + } else { + done(new Error('Not marked as disconnected')) + } + }) + client.once('connect', function () { + client.stream.end() + }) + }) + + it('should stop ping timer if stream closes', function (done) { + var client = connect() + + client.once('close', function () { + should.not.exist(client.pingTimer) + client.end() + done() + }) + + client.once('connect', function () { + should.exist(client.pingTimer) + client.stream.end() + }) + }) + + it('should emit close after end called', function (done) { + var client = connect() + + client.once('close', function () { + done() + }) + + client.once('connect', function () { + client.end() + }) + }) + + it('should emit end after end called and client must be disconnected', function (done) { + var client = connect() + + client.once('end', function () { + if (client.disconnected) { + return done() + } + done(new Error('client must be disconnected')) + }) + + client.once('connect', function () { + client.end() + }) + }) + + it('should pass store close error to end callback but not to end listeners', function (done) { + var store = new Store() + var client = connect({outgoingStore: store}) + + store.close = function (cb) { + cb(new Error('test')) + } + client.once('end', function () { + if (arguments.length === 0) { + return done() + } + throw new Error('no argument shoould be passed to event') + }) + + client.once('connect', function () { + client.end(function (test) { + if (test && test.message === 'test') { + return + } + throw new Error('bad argument passed to callback') + }) + }) + }) + + it('should return `this` if end called twice', function (done) { + var client = connect() + + client.once('connect', function () { + client.end() + var value = client.end() + if (value === client) { + done() + } else { + done(new Error('Not returning client.')) + } + }) + }) + + it('should emit end only on first client end', function (done) { + var client = connect() + + client.once('end', function () { + var timeout = setTimeout(done.bind(null), 200) + client.once('end', function () { + clearTimeout(timeout) + done(new Error('end was emitted twice')) + }) + client.end() + }) + + client.once('connect', client.end.bind(client)) + }) + + it('should stop ping timer after end called', function (done) { + var client = connect() + + client.once('connect', function () { + should.exist(client.pingTimer) + client.end() + should.not.exist(client.pingTimer) + done() + }) + }) + + it('should be able to end even on a failed connection', function (done) { + var client = connect({host: 'this_hostname_should_not_exist'}) + + var timeout = setTimeout(function () { + done(new Error('Failed to end a disconnected client')) + }, 500) + + setTimeout(function () { + client.end(function () { + clearTimeout(timeout) + done() + }) + }, 200) + }) + + it('should emit end even on a failed connection', function (done) { + var client = connect({host: 'this_hostname_should_not_exist'}) + + var timeout = setTimeout(function () { + done(new Error('Disconnected client has failed to emit end')) + }, 500) + + client.once('end', function () { + clearTimeout(timeout) + done() + }) + + setTimeout(client.end.bind(client), 200) + }) + + it('should emit end only once for a reconnecting client', function (done) { + var client = connect({host: 'this_hostname_should_not_exist', connectTimeout: 10, reconnectPeriod: 10}) + + client.once('end', function () { + var timeout = setTimeout(done.bind(null)) + client.once('end', function () { + clearTimeout(timeout) + done(new Error('end emitted twice')) + }) + }) + + setTimeout(client.end.bind(client), 300) + }) + }) + + describe('connecting', function () { + it('should connect to the broker', function (done) { + var client = connect() + client.on('error', done) + + server.once('client', function () { + client.end() + done() + }) + }) + + it('should send a default client id', function (done) { + var client = connect() + client.on('error', done) + + server.once('client', function (serverClient) { + serverClient.once('connect', function (packet) { + packet.clientId.should.match(/mqttjs.*/) + serverClient.disconnect() + done() + }) + }) + }) + + it('should send be clean by default', function (done) { + var client = connect() + client.on('error', done) + + server.once('client', function (serverClient) { + serverClient.once('connect', function (packet) { + packet.clean.should.be.true() + serverClient.disconnect() + done() + }) + }) + }) + + it('should connect with the given client id', function (done) { + var client = connect({clientId: 'testclient'}) + client.on('error', function (err) { + throw err + }) + + server.once('client', function (serverClient) { + serverClient.once('connect', function (packet) { + packet.clientId.should.match(/testclient/) + serverClient.disconnect() + done() + }) + }) + }) + + it('should connect with the client id and unclean state', function (done) { + var client = connect({clientId: 'testclient', clean: false}) + client.on('error', function (err) { + throw err + }) + + server.once('client', function (serverClient) { + serverClient.once('connect', function (packet) { + packet.clientId.should.match(/testclient/) + packet.clean.should.be.false() + serverClient.disconnect() + done() + }) + }) + }) + + it('should require a clientId with clean=false', function (done) { + try { + var client = connect({ clean: false }) + client.on('error', function (err) { + done(err) + // done(new Error('should have thrown')); + }) + } catch (err) { + done() + } + }) + + it('should default to localhost', function (done) { + var client = connect({clientId: 'testclient'}) + client.on('error', function (err) { + throw err + }) + + server.once('client', function (serverClient) { + serverClient.once('connect', function (packet) { + packet.clientId.should.match(/testclient/) + serverClient.disconnect() + done() + }) + }) + }) + + it('should emit connect', function (done) { + var client = connect() + client.once('connect', function () { + client.end() + done() + }) + client.once('error', done) + }) + + it('should provide connack packet with connect event', function (done) { + server.once('client', function (serverClient) { + serverClient.connack({returnCode: 0, sessionPresent: true}) + + server.once('client', function (serverClient) { + serverClient.connack({returnCode: 0, sessionPresent: false}) + }) + }) + + var client = connect() + client.once('connect', function (packet) { + should(packet.sessionPresent).be.equal(true) + client.once('connect', function (packet) { + should(packet.sessionPresent).be.equal(false) + client.end() + done() + }) + }) + }) + + it('should mark the client as connected', function (done) { + var client = connect() + client.once('connect', function () { + client.end() + if (client.connected) { + done() + } else { + done(new Error('Not marked as connected')) + } + }) + }) + + it('should emit error', function (done) { + var client = connect({clientId: 'invalid'}) + client.once('connect', function () { + done(new Error('Should not emit connect')) + }) + client.once('error', function (error) { + should(error.code).be.equal(2) // code for clientID identifer rejected + client.end() + done() + }) + }) + + it('should have different client ids', function (done) { + var client1 = connect() + var client2 = connect() + + client1.options.clientId.should.not.equal(client2.options.clientId) + client1.end(true) + client2.end(true) + setImmediate(done) + }) + }) + + describe('handling offline states', function () { + it('should emit offline events once when the client transitions from connected states to disconnected ones', function (done) { + var client = connect({reconnectPeriod: 20}) + + client.on('connect', function () { + this.stream.end() + }) + + client.on('offline', function () { + client.end(true, done) + }) + }) + + it('should emit offline events once when the client (at first) can NOT connect to servers', function (done) { + // fake a port + var client = connect({ reconnectPeriod: 20, port: 4557 }) + + client.on('offline', function () { + client.end(true, done) + }) + }) + }) + + describe('topic validations when subscribing', function () { + it('should be ok for well-formated topics', function (done) { + var client = connect() + client.subscribe( + [ + '+', '+/event', 'event/+', '#', 'event/#', 'system/event/+', + 'system/+/event', 'system/registry/event/#', 'system/+/event/#', + 'system/registry/event/new_device', 'system/+/+/new_device' + ], + function (err) { + client.end(function () { + if (err) { + return done(new Error(err)) + } + done() + }) + } + ) + }) + + it('should return an error (via callbacks) for topic #/event', function (done) { + var client = connect() + client.subscribe(['#/event', 'event#', 'event+'], function (err) { + client.end(false, function () { + if (err) { + return done() + } + done(new Error('Validations do NOT work')) + }) + }) + }) + + it('should return an empty array for duplicate subs', function (done) { + var client = connect() + client.subscribe('event', function (err, granted1) { + if (err) { + return done(err) + } + client.subscribe('event', function (err, granted2) { + if (err) { + return done(err) + } + granted2.should.Array() + granted2.should.be.empty() + done() + }) + }) + }) + + it('should return an error (via callbacks) for topic #/event', function (done) { + var client = connect() + client.subscribe('#/event', function (err) { + client.end(function () { + if (err) { + return done() + } + done(new Error('Validations do NOT work')) + }) + }) + }) + + it('should return an error (via callbacks) for topic event#', function (done) { + var client = connect() + client.subscribe('event#', function (err) { + client.end(function () { + if (err) { + return done() + } + done(new Error('Validations do NOT work')) + }) + }) + }) + + it('should return an error (via callbacks) for topic system/#/event', function (done) { + var client = connect() + client.subscribe('system/#/event', function (err) { + client.end(function () { + if (err) { + return done() + } + done(new Error('Validations do NOT work')) + }) + }) + }) + + it('should return an error (via callbacks) for empty topic list', function (done) { + var client = connect() + client.subscribe([], function (err) { + client.end() + if (err) { + return done() + } + done(new Error('Validations do NOT work')) + }) + }) + + it('should return an error (via callbacks) for topic system/+/#/event', function (done) { + var client = connect() + client.subscribe('system/+/#/event', function (err) { + client.end(true, function () { + if (err) { + return done() + } + done(new Error('Validations do NOT work')) + }) + }) + }) + }) + + describe('offline messages', function () { + it('should queue message until connected', function (done) { + var client = connect() + + client.publish('test', 'test') + client.subscribe('test') + client.unsubscribe('test') + client.queue.length.should.equal(3) + + client.once('connect', function () { + client.queue.length.should.equal(0) + setTimeout(function () { + client.end(true, done) + }, 10) + }) + }) + + it('should not queue qos 0 messages if queueQoSZero is false', function (done) { + var client = connect({queueQoSZero: false}) + + client.publish('test', 'test', {qos: 0}) + client.queue.length.should.equal(0) + client.on('connect', function () { + setTimeout(function () { + client.end(true, done) + }, 10) + }) + }) + + it('should queue qos != 0 messages', function (done) { + var client = connect({queueQoSZero: false}) + + client.publish('test', 'test', {qos: 1}) + client.publish('test', 'test', {qos: 2}) + client.subscribe('test') + client.unsubscribe('test') + client.queue.length.should.equal(2) + client.on('connect', function () { + setTimeout(function () { + client.end(true, done) + }, 10) + }) + }) + + it('should call cb if an outgoing QoS 0 message is not sent', function (done) { + var client = connect({queueQoSZero: false}) + var called = false + + client.publish('test', 'test', {qos: 0}, function () { + called = true + }) + + client.on('connect', function () { + called.should.equal(true) + setTimeout(function () { + client.end(true, done) + }, 10) + }) + }) + + it('should delay ending up until all inflight messages are delivered', function (done) { + var client = connect() + var subscribeCalled = false + + client.on('connect', function () { + client.subscribe('test', function () { + subscribeCalled = true + }) + client.publish('test', 'test', function () { + client.end(false, function () { + subscribeCalled.should.be.equal(true) + done() + }) + }) + }) + }) + + it('wait QoS 1 publish messages', function (done) { + var client = connect() + var messageReceived = false + + client.on('connect', function () { + client.subscribe('test') + client.publish('test', 'test', { qos: 1 }, function () { + client.end(false, function () { + messageReceived.should.equal(true) + done() + }) + }) + client.on('message', function () { + messageReceived = true + }) + }) + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + serverClient.on('publish', function (packet) { + serverClient.publish(packet) + }) + }) + }) + }) + + it('does not wait acks when force-closing', function (done) { + // non-running broker + var client = connect('mqtt://localhost:8993') + client.publish('test', 'test', { qos: 1 }) + client.end(true, done) + }) + + it('should call cb if store.put fails', function (done) { + const store = new Store() + store.put = function (packet, cb) { + process.nextTick(cb, new Error('oops there is an error')) + } + var client = connect({ incomingStore: store, outgoingStore: store }) + client.publish('test', 'test', { qos: 2 }, function (err) { + if (err) { + client.end(true, done) + } + }) + }) + }) + + describe('publishing', function () { + it('should publish a message (offline)', function (done) { + var client = connect() + var payload = 'test' + var topic = 'test' + + client.publish(topic, payload) + + server.on('client', onClient) + + function onClient (serverClient) { + serverClient.once('connect', function () { + server.removeListener('client', onClient) + }) + + serverClient.once('publish', function (packet) { + packet.topic.should.equal(topic) + packet.payload.toString().should.equal(payload) + packet.qos.should.equal(0) + packet.retain.should.equal(false) + client.end(true, done) + }) + } + }) + + it('should publish a message (online)', function (done) { + var client = connect() + var payload = 'test' + var topic = 'test' + + client.on('connect', function () { + client.publish(topic, payload) + }) + + server.once('client', function (serverClient) { + serverClient.once('publish', function (packet) { + packet.topic.should.equal(topic) + packet.payload.toString().should.equal(payload) + packet.qos.should.equal(0) + packet.retain.should.equal(false) + client.end() + done() + }) + }) + }) + + it('should publish a message (retain, offline)', function (done) { + var client = connect({ queueQoSZero: true }) + var payload = 'test' + var topic = 'test' + var called = false + + client.publish(topic, payload, { retain: true }, function () { + called = true + }) + + server.once('client', function (serverClient) { + serverClient.once('publish', function (packet) { + packet.topic.should.equal(topic) + packet.payload.toString().should.equal(payload) + packet.qos.should.equal(0) + packet.retain.should.equal(true) + called.should.equal(true) + client.end() + done() + }) + }) + }) + + it('should emit a packetsend event', function (done) { + var client = connect() + var payload = 'test_payload' + var testTopic = 'testTopic' + + client.on('packetsend', function (packet) { + if (packet.cmd === 'publish') { + packet.qos.should.equal(0) + packet.topic.should.equal(testTopic) + packet.payload.should.equal(payload) + packet.retain.should.equal(false) + client.end() + done() + } + }) + + client.publish(testTopic, payload) + }) + + it('should accept options', function (done) { + var client = connect() + var payload = 'test' + var topic = 'test' + var opts = { + retain: true, + qos: 1 + } + + client.once('connect', function () { + client.publish(topic, payload, opts) + }) + + server.once('client', function (serverClient) { + serverClient.once('publish', function (packet) { + packet.topic.should.equal(topic) + packet.payload.toString().should.equal(payload) + packet.qos.should.equal(opts.qos, 'incorrect qos') + packet.retain.should.equal(opts.retain, 'incorrect ret') + packet.dup.should.equal(false, 'incorrect dup') + client.end() + done() + }) + }) + }) + + it('should publish with the default options for an empty parameter', function (done) { + var client = connect() + var payload = 'test' + var topic = 'test' + var defaultOpts = {qos: 0, retain: false, dup: false} + + client.once('connect', function () { + client.publish(topic, payload, {}) + }) + + server.once('client', function (serverClient) { + serverClient.once('publish', function (packet) { + packet.topic.should.equal(topic) + packet.payload.toString().should.equal(payload) + packet.qos.should.equal(defaultOpts.qos, 'incorrect qos') + packet.retain.should.equal(defaultOpts.retain, 'incorrect ret') + packet.dup.should.equal(defaultOpts.dup, 'incorrect dup') + client.end() + done() + }) + }) + }) + + it('should mark a message as duplicate when "dup" option is set', function (done) { + var client = connect() + var payload = 'duplicated-test' + var topic = 'test' + var opts = { + retain: true, + qos: 1, + dup: true + } + + client.once('connect', function () { + client.publish(topic, payload, opts) + }) + + server.once('client', function (serverClient) { + serverClient.once('publish', function (packet) { + packet.topic.should.equal(topic) + packet.payload.toString().should.equal(payload) + packet.dup.should.equal(opts.dup, 'incorrect dup') + client.end() + done() + }) + }) + }) + + it('should fire a callback (qos 0)', function (done) { + var client = connect() + + client.once('connect', function () { + client.publish('a', 'b', function () { + client.end() + done() + }) + }) + }) + + it('should fire a callback (qos 1)', function (done) { + var client = connect() + var opts = { qos: 1 } + + client.once('connect', function () { + client.publish('a', 'b', opts, function () { + client.end() + done() + }) + }) + }) + + it('should fire a callback (qos 2)', function (done) { + var client = connect() + var opts = { qos: 2 } + + client.once('connect', function () { + client.publish('a', 'b', opts, function () { + client.end() + done() + }) + }) + }) + + it('should support UTF-8 characters in topic', function (done) { + var client = connect() + + client.once('connect', function () { + client.publish('中国', 'hello', function () { + client.end() + done() + }) + }) + }) + + it('should support UTF-8 characters in payload', function (done) { + var client = connect() + + client.once('connect', function () { + client.publish('hello', '中国', function () { + client.end() + done() + }) + }) + }) + + it('should publish 10 QoS 2 and receive them', function (done) { + var client = connect() + var count = 0 + + client.on('connect', function () { + client.subscribe('test') + client.publish('test', 'test', { qos: 2 }) + }) + + client.on('message', function () { + if (count >= 10) { + client.end() + done() + } else { + client.publish('test', 'test', { qos: 2 }) + } + }) + + server.once('client', function (serverClient) { + serverClient.on('offline', function () { + client.end() + done('error went offline... didnt see this happen') + }) + + serverClient.on('subscribe', function () { + serverClient.on('publish', function (packet) { + serverClient.publish(packet) + }) + }) + + serverClient.on('pubrel', function () { + count++ + }) + }) + }) + + function testQosHandleMessage (qos, done) { + var client = connect() + + var messageEventCount = 0 + var handleMessageCount = 0 + + client.handleMessage = function (packet, callback) { + setTimeout(function () { + handleMessageCount++ + // next message event should not emit until handleMessage completes + handleMessageCount.should.equal(messageEventCount) + if (handleMessageCount === 10) { + setTimeout(function () { + client.end() + done() + }) + } + callback() + }, 100) + } + + client.on('message', function (topic, message, packet) { + messageEventCount++ + }) + + client.on('connect', function () { + client.subscribe('test') + }) + + server.once('client', function (serverClient) { + serverClient.on('offline', function () { + client.end() + done('error went offline... didnt see this happen') + }) + + serverClient.on('subscribe', function () { + for (var i = 0; i < 10; i++) { + serverClient.publish({ + messageId: i, + topic: 'test', + payload: 'test' + i, + qos: qos + }) + } + }) + }) + } + + it('should publish 10 QoS 0 and receive them only when `handleMessage` finishes', function (done) { + testQosHandleMessage(0, done) + }) + + it('should publish 10 QoS 1 and receive them only when `handleMessage` finishes', function (done) { + testQosHandleMessage(1, done) + }) + + it('should publish 10 QoS 2 and receive them only when `handleMessage` finishes', function (done) { + testQosHandleMessage(2, done) + }) + + it('should not send a `puback` if the execution of `handleMessage` fails for messages with QoS `1`', function (done) { + var client = connect() + + client.handleMessage = function (packet, callback) { + callback(new Error('Error thrown by the application')) + } + + client._sendPacket = sinon.spy() + + client._handlePublish({ + messageId: Math.floor(65535 * Math.random()), + topic: 'test', + payload: 'test', + qos: 1 + }, function (err) { + should.exist(err) + }) + + client._sendPacket.callCount.should.equal(0) + client.end() + client.on('connect', function () { done() }) + }) + + it('should silently ignore errors thrown by `handleMessage` and return when no callback is passed ' + + 'into `handlePublish` method', function (done) { + var client = connect() + + client.handleMessage = function (packet, callback) { + callback(new Error('Error thrown by the application')) + } + + try { + client._handlePublish({ + messageId: Math.floor(65535 * Math.random()), + topic: 'test', + payload: 'test', + qos: 1 + }) + done() + } catch (err) { + done(err) + } finally { + client.end() + } + }) + + it('should handle error with async incoming store in QoS 2 `handlePublish` method', function (done) { + function AsyncStore () { + if (!(this instanceof AsyncStore)) { + return new AsyncStore() + } + } + AsyncStore.prototype.put = function (packet, cb) { + process.nextTick(function () { + cb(new Error('Error')) + }) + } + var store = new AsyncStore() + var client = connect({incomingStore: store}) + + client._handlePublish({ + messageId: 1, + topic: 'test', + payload: 'test', + qos: 2 + }, function () { + done() + client.end() + }) + }) + + it('should handle error with async incoming store in QoS 2 `handlePubrel` method', function (done) { + function AsyncStore () { + if (!(this instanceof AsyncStore)) { + return new AsyncStore() + } + } + AsyncStore.prototype.put = function (packet, cb) { + process.nextTick(function () { + cb(new Error('Error')) + }) + } + AsyncStore.prototype.get = function (packet, cb) { + process.nextTick(function () { + cb(null, {cmd: 'publish'}) + }) + } + var store = new AsyncStore() + var client = connect({incomingStore: store}) + + client._handlePubrel({ + messageId: 1, + qos: 2 + }, function () { + done() + client.end() + }) + }) + + it('should handle success with async incoming store in QoS 2 `handlePubrel` method', function (done) { + var putComplete = false + function AsyncStore () { + if (!(this instanceof AsyncStore)) { + return new AsyncStore() + } + } + AsyncStore.prototype.put = function (packet, cb) { + process.nextTick(function () { + putComplete = true + cb(null) + }) + } + AsyncStore.prototype.get = function (packet, cb) { + process.nextTick(function () { + cb(null, {cmd: 'publish'}) + }) + } + var store = new AsyncStore() + var client = connect({incomingStore: store}) + + client._handlePubrel({ + messageId: 1, + qos: 2 + }, function () { + putComplete.should.equal(true) + done() + client.end() + }) + }) + + it('should handle error with async incoming store in QoS 1 `handlePublish` method', function (done) { + function AsyncStore () { + if (!(this instanceof AsyncStore)) { + return new AsyncStore() + } + } + AsyncStore.prototype.put = function (packet, cb) { + process.nextTick(function () { + cb(null, 'Error') + }) + } + var store = new AsyncStore() + var client = connect({incomingStore: store}) + + client._handlePublish({ + messageId: 1, + topic: 'test', + payload: 'test', + qos: 1 + }, function () { + done() + client.end() + }) + }) + + it('should not send a `pubcomp` if the execution of `handleMessage` fails for messages with QoS `2`', function (done) { + var store = new Store() + var client = connect({incomingStore: store}) + + var messageId = Math.floor(65535 * Math.random()) + var topic = 'test' + var payload = 'test' + var qos = 2 + + client.handleMessage = function (packet, callback) { + callback(new Error('Error thrown by the application')) + } + + client.once('connect', function () { + client.subscribe(topic, {qos: 2}) + + store.put({ + messageId: messageId, + topic: topic, + payload: payload, + qos: qos, + cmd: 'publish' + }, function () { + // cleans up the client + client.end() + + client._sendPacket = sinon.spy() + client._handlePubrel({cmd: 'pubrel', messageId: messageId}, function (err) { + should.exist(err) + }) + client._sendPacket.callCount.should.equal(0) + done() + }) + }) + }) + + it('should silently ignore errors thrown by `handleMessage` and return when no callback is passed ' + + 'into `handlePubrel` method', function (done) { + var store = new Store() + var client = connect({incomingStore: store}) + + var messageId = Math.floor(65535 * Math.random()) + var topic = 'test' + var payload = 'test' + var qos = 2 + + client.handleMessage = function (packet, callback) { + callback(new Error('Error thrown by the application')) + } + + client.once('connect', function () { + client.subscribe(topic, {qos: 2}) + + store.put({ + messageId: messageId, + topic: topic, + payload: payload, + qos: qos, + cmd: 'publish' + }, function () { + try { + client._handlePubrel({cmd: 'pubrel', messageId: messageId}) + done() + } catch (err) { + done(err) + } finally { + client.end() + } + }) + }) + }) + }) + + describe('unsubscribing', function () { + it('should send an unsubscribe packet (offline)', function (done) { + var client = connect() + + client.unsubscribe('test') + + server.once('client', function (serverClient) { + serverClient.once('unsubscribe', function (packet) { + packet.unsubscriptions.should.containEql('test') + client.end() + done() + }) + }) + }) + + it('should send an unsubscribe packet', function (done) { + var client = connect() + var topic = 'topic' + + client.once('connect', function () { + client.unsubscribe(topic) + }) + + server.once('client', function (serverClient) { + serverClient.once('unsubscribe', function (packet) { + packet.unsubscriptions.should.containEql(topic) + client.end() + done() + }) + }) + }) + + it('should emit a packetsend event', function (done) { + var client = connect() + var testTopic = 'testTopic' + + client.once('connect', function () { + client.subscribe(testTopic) + }) + + client.on('packetsend', function (packet) { + if (packet.cmd === 'subscribe') { + client.end() + done() + } + }) + }) + + it('should emit a packetreceive event', function (done) { + var client = connect() + var testTopic = 'testTopic' + + client.once('connect', function () { + client.subscribe(testTopic) + }) + + client.on('packetreceive', function (packet) { + if (packet.cmd === 'suback') { + client.end() + done() + } + }) + }) + + it('should accept an array of unsubs', function (done) { + var client = connect() + var topics = ['topic1', 'topic2'] + + client.once('connect', function () { + client.unsubscribe(topics) + }) + + server.once('client', function (serverClient) { + serverClient.once('unsubscribe', function (packet) { + packet.unsubscriptions.should.eql(topics) + done() + }) + }) + }) + + it('should fire a callback on unsuback', function (done) { + var client = connect() + var topic = 'topic' + + client.once('connect', function () { + client.unsubscribe(topic, done) + }) + + server.once('client', function (serverClient) { + serverClient.once('unsubscribe', function (packet) { + serverClient.unsuback(packet) + client.end() + }) + }) + }) + + it('should unsubscribe from a chinese topic', function (done) { + var client = connect() + var topic = '中国' + + client.once('connect', function () { + client.unsubscribe(topic) + }) + + server.once('client', function (serverClient) { + serverClient.once('unsubscribe', function (packet) { + packet.unsubscriptions.should.containEql(topic) + client.end() + done() + }) + }) + }) + }) + + describe('keepalive', function () { + var clock + + beforeEach(function () { + clock = sinon.useFakeTimers() + }) + + afterEach(function () { + clock.restore() + }) + + it('should checkPing at keepalive interval', function (done) { + var interval = 3 + var client = connect({ keepalive: interval }) + + client._checkPing = sinon.spy() + + client.once('connect', function () { + clock.tick(interval * 1000) + client._checkPing.callCount.should.equal(1) + + clock.tick(interval * 1000) + client._checkPing.callCount.should.equal(2) + + clock.tick(interval * 1000) + client._checkPing.callCount.should.equal(3) + + client.end() + done() + }) + }) + + it('should not checkPing if publishing at a higher rate than keepalive', function (done) { + var intervalMs = 3000 + var client = connect({keepalive: intervalMs / 1000}) + + client._checkPing = sinon.spy() + + client.once('connect', function () { + client.publish('foo', 'bar') + clock.tick(intervalMs - 1) + client.publish('foo', 'bar') + clock.tick(2) + client._checkPing.callCount.should.equal(0) + client.end() + done() + }) + }) + + it('should checkPing if publishing at a higher rate than keepalive and reschedulePings===false', function (done) { + var intervalMs = 3000 + var client = connect({ + keepalive: intervalMs / 1000, + reschedulePings: false + }) + + client._checkPing = sinon.spy() + + client.once('connect', function () { + client.publish('foo', 'bar') + clock.tick(intervalMs - 1) + client.publish('foo', 'bar') + clock.tick(2) + client._checkPing.callCount.should.equal(1) + client.end() + done() + }) + }) + }) + + describe('pinging', function () { + it('should set a ping timer', function (done) { + var client = connect({keepalive: 3}) + client.once('connect', function () { + should.exist(client.pingTimer) + client.end() + done() + }) + }) + + it('should not set a ping timer keepalive=0', function (done) { + var client = connect({keepalive: 0}) + client.on('connect', function () { + should.not.exist(client.pingTimer) + client.end() + done() + }) + }) + + it('should reconnect if pingresp is not sent', function (done) { + var client = connect({keepalive: 1, reconnectPeriod: 100}) + + // Fake no pingresp being send by stubbing the _handlePingresp function + client._handlePingresp = function () {} + + client.once('connect', function () { + client.once('connect', function () { + client.end() + done() + }) + }) + }) + + it('should not reconnect if pingresp is successful', function (done) { + var client = connect({keepalive: 100}) + client.once('close', function () { + done(new Error('Client closed connection')) + }) + setTimeout(done, 1000) + }) + + it('should defer the next ping when sending a control packet', function (done) { + var client = connect({keepalive: 1}) + + client.once('connect', function () { + client._checkPing = sinon.spy() + + client.publish('foo', 'bar') + setTimeout(function () { + client._checkPing.callCount.should.equal(0) + client.publish('foo', 'bar') + + setTimeout(function () { + client._checkPing.callCount.should.equal(0) + client.publish('foo', 'bar') + + setTimeout(function () { + client._checkPing.callCount.should.equal(0) + done() + }, 75) + }, 75) + }, 75) + }) + }) + }) + + describe('subscribing', function () { + it('should send a subscribe message (offline)', function (done) { + var client = connect() + + client.subscribe('test') + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function () { + done() + }) + }) + }) + + it('should send a subscribe message', function (done) { + var client = connect() + var topic = 'test' + + client.once('connect', function () { + client.subscribe(topic) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function (packet) { + packet.subscriptions.should.containEql({ + topic: topic, + qos: 0 + }) + done() + }) + }) + }) + + it('should emit a packetsend event', function (done) { + var client = connect() + var testTopic = 'testTopic' + + client.once('connect', function () { + client.subscribe(testTopic) + }) + + client.on('packetsend', function (packet) { + if (packet.cmd === 'subscribe') { + done() + } + }) + }) + + it('should emit a packetreceive event', function (done) { + var client = connect() + var testTopic = 'testTopic' + + client.once('connect', function () { + client.subscribe(testTopic) + }) + + client.on('packetreceive', function (packet) { + if (packet.cmd === 'suback') { + done() + } + }) + }) + + it('should accept an array of subscriptions', function (done) { + var client = connect() + var subs = ['test1', 'test2'] + + client.once('connect', function () { + client.subscribe(subs) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function (packet) { + // i.e. [{topic: 'a', qos: 0}, {topic: 'b', qos: 0}] + var expected = subs.map(function (i) { + return {topic: i, qos: 0} + }) + + packet.subscriptions.should.eql(expected) + done() + }) + }) + }) + + it('should accept an hash of subscriptions', function (done) { + var client = connect() + var topics = { + test1: 0, + test2: 1 + } + + client.once('connect', function () { + client.subscribe(topics) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function (packet) { + var k + var expected = [] + + for (k in topics) { + if (topics.hasOwnProperty(k)) { + expected.push({ + topic: k, + qos: topics[k] + }) + } + } + + packet.subscriptions.should.eql(expected) + done() + }) + }) + }) + + it('should accept an options parameter', function (done) { + var client = connect() + var topic = 'test' + var opts = {qos: 1} + + client.once('connect', function () { + client.subscribe(topic, opts) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function (packet) { + var expected = [{ + topic: topic, + qos: 1 + }] + + packet.subscriptions.should.eql(expected) + done() + }) + }) + }) + + it('should subscribe with the default options for an empty options parameter', function (done) { + var client = connect() + var topic = 'test' + var defaultOpts = {qos: 0} + + client.once('connect', function () { + client.subscribe(topic, {}) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function (packet) { + packet.subscriptions.should.containEql({ + topic: topic, + qos: defaultOpts.qos + }) + done() + }) + }) + }) + + it('should fire a callback on suback', function (done) { + var client = connect() + var topic = 'test' + + client.once('connect', function () { + client.subscribe(topic, { qos: 2 }, function (err, granted) { + if (err) { + done(err) + } else { + should.exist(granted, 'granted not given') + granted.should.containEql({topic: 'test', qos: 2}) + done() + } + }) + }) + }) + + it('should fire a callback with error if disconnected (options provided)', function (done) { + var client = connect() + var topic = 'test' + client.once('connect', function () { + client.end(true, function () { + client.subscribe(topic, {qos: 2}, function (err, granted) { + should.not.exist(granted, 'granted given') + should.exist(err, 'no error given') + done() + }) + }) + }) + }) + + it('should fire a callback with error if disconnected (options not provided)', function (done) { + var client = connect() + var topic = 'test' + + client.once('connect', function () { + client.end(true, function () { + client.subscribe(topic, function (err, granted) { + should.not.exist(granted, 'granted given') + should.exist(err, 'no error given') + done() + }) + }) + }) + }) + + it('should subscribe with a chinese topic', function (done) { + var client = connect() + var topic = '中国' + + client.once('connect', function () { + client.subscribe(topic) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function (packet) { + packet.subscriptions.should.containEql({ + topic: topic, + qos: 0 + }) + done() + }) + }) + }) + }) + + describe('receiving messages', function () { + it('should fire the message event', function (done) { + var client = connect() + var testPacket = { + topic: 'test', + payload: 'message', + retain: true, + qos: 1, + messageId: 5 + } + + client.subscribe(testPacket.topic) + client.once('message', function (topic, message, packet) { + topic.should.equal(testPacket.topic) + message.toString().should.equal(testPacket.payload) + packet.should.equal(packet) + client.end() + done() + }) + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + serverClient.publish(testPacket) + }) + }) + }) + + it('should emit a packetreceive event', function (done) { + var client = connect() + var testPacket = { + topic: 'test', + payload: 'message', + retain: true, + qos: 1, + messageId: 5 + } + + client.subscribe(testPacket.topic) + client.on('packetreceive', function (packet) { + if (packet.cmd === 'publish') { + packet.qos.should.equal(1) + packet.topic.should.equal(testPacket.topic) + packet.payload.toString().should.equal(testPacket.payload) + packet.retain.should.equal(true) + client.end() + done() + } + }) + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + serverClient.publish(testPacket) + }) + }) + }) + + it('should support binary data', function (done) { + var client = connect({ encoding: 'binary' }) + var testPacket = { + topic: 'test', + payload: 'message', + retain: true, + qos: 1, + messageId: 5 + } + + client.subscribe(testPacket.topic) + client.once('message', function (topic, message, packet) { + topic.should.equal(testPacket.topic) + message.should.be.an.instanceOf(Buffer) + message.toString().should.equal(testPacket.payload) + packet.should.equal(packet) + done() + }) + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + serverClient.publish(testPacket) + }) + }) + }) + + it('should emit a message event (qos=2)', function (done) { + var client = connect() + var testPacket = { + topic: 'test', + payload: 'message', + retain: true, + qos: 2, + messageId: 5 + } + + server.testPublish = testPacket + + client.subscribe(testPacket.topic) + client.once('message', function (topic, message, packet) { + topic.should.equal(testPacket.topic) + message.toString().should.equal(testPacket.payload) + packet.should.equal(packet) + done() + }) + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + serverClient.publish(testPacket) + }) + }) + }) + + it('should emit a message event (qos=2) - repeated publish', function (done) { + var client = connect() + var testPacket = { + topic: 'test', + payload: 'message', + retain: true, + qos: 2, + messageId: 5 + } + + server.testPublish = testPacket + + client.subscribe(testPacket.topic) + client.on('message', function (topic, message, packet) { + topic.should.equal(testPacket.topic) + message.toString().should.equal(testPacket.payload) + packet.should.equal(packet) + done() + }) + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + serverClient.publish(testPacket) + // twice, should be ignored + serverClient.publish(testPacket) + }) + }) + }) + + it('should support chinese topic', function (done) { + var client = connect({ encoding: 'binary' }) + var testPacket = { + topic: '国', + payload: 'message', + retain: true, + qos: 1, + messageId: 5 + } + + client.subscribe(testPacket.topic) + client.once('message', function (topic, message, packet) { + topic.should.equal(testPacket.topic) + message.should.be.an.instanceOf(Buffer) + message.toString().should.equal(testPacket.payload) + packet.should.equal(packet) + done() + }) + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + serverClient.publish(testPacket) + }) + }) + }) + }) + + describe('qos handling', function () { + it('should follow qos 0 semantics (trivial)', function (done) { + var client = connect() + var testTopic = 'test' + var testMessage = 'message' + + client.once('connect', function () { + client.subscribe(testTopic, {qos: 0}) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function () { + serverClient.publish({ + topic: testTopic, + payload: testMessage, + qos: 0, + retain: false + }) + done() + }) + }) + }) + + it('should follow qos 1 semantics', function (done) { + var client = connect() + var testTopic = 'test' + var testMessage = 'message' + var mid = 50 + + client.once('connect', function () { + client.subscribe(testTopic, {qos: 1}) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function () { + serverClient.publish({ + topic: testTopic, + payload: testMessage, + messageId: mid, + qos: 1 + }) + }) + + serverClient.once('puback', function (packet) { + packet.messageId.should.equal(mid) + done() + }) + }) + }) + + it('should follow qos 2 semantics', function (done) { + var client = connect() + var testTopic = 'test' + var testMessage = 'message' + var mid = 253 + + client.once('connect', function () { + client.subscribe(testTopic, {qos: 2}) + }) + + server.once('client', function (serverClient) { + serverClient.once('subscribe', function () { + serverClient.publish({ + topic: testTopic, + payload: testMessage, + qos: 2, + messageId: mid + }) + }) + + serverClient.once('pubcomp', function () { + done() + }) + }) + }) + }) + + describe('auto reconnect', function () { + it('should mark the client disconnecting if #end called', function () { + var client = connect() + + client.end() + client.disconnecting.should.eql(true) + }) + + it('should reconnect after stream disconnect', function (done) { + var client = connect() + var tryReconnect = true + + client.on('connect', function () { + if (tryReconnect) { + client.stream.end() + tryReconnect = false + } else { + client.end() + done() + } + }) + }) + + it('should emit \'reconnect\' when reconnecting', function (done) { + var client = connect() + var tryReconnect = true + var reconnectEvent = false + + client.on('reconnect', function () { + reconnectEvent = true + }) + + client.on('connect', function () { + if (tryReconnect) { + client.stream.end() + tryReconnect = false + } else { + reconnectEvent.should.equal(true) + client.end() + done() + } + }) + }) + + it('should emit \'offline\' after going offline', function (done) { + var client = connect() + var tryReconnect = true + var offlineEvent = false + + client.on('offline', function () { + offlineEvent = true + }) + + client.on('connect', function () { + if (tryReconnect) { + client.stream.end() + tryReconnect = false + } else { + offlineEvent.should.equal(true) + client.end() + done() + } + }) + }) + + it('should not reconnect if it was ended by the user', function (done) { + var client = connect() + + client.on('connect', function () { + client.end() + done() // it will raise an exception if called two times + }) + }) + + it('should setup a reconnect timer on disconnect', function (done) { + var client = connect() + + client.once('connect', function () { + should.not.exist(client.reconnectTimer) + client.stream.end() + }) + + client.once('close', function () { + should.exist(client.reconnectTimer) + client.end() + done() + }) + }) + + it('should allow specification of a reconnect period', function (done) { + var end + var period = 200 + var client = connect({reconnectPeriod: period}) + var reconnect = false + var start = Date.now() + + client.on('connect', function () { + if (!reconnect) { + client.stream.end() + reconnect = true + } else { + client.end() + end = Date.now() + if (end - start >= period) { + // Connected in about 2 seconds, that's good enough + done() + } else { + done(new Error('Strange reconnect period')) + } + } + }) + }) + + it('should always cleanup successfully on reconnection', function (done) { + var client = connect({host: 'this_hostname_should_not_exist', connectTimeout: 0, reconnectPeriod: 1}) + setTimeout(client.end.bind(client, done), 50) + }) + + it('should resend in-flight QoS 1 publish messages from the client', function (done) { + var client = connect({reconnectPeriod: 200}) + var serverPublished = false + var clientCalledBack = false + + server.once('client', function (serverClient) { + serverClient.on('connect', function () { + setImmediate(function () { + serverClient.stream.destroy() + }) + }) + + server.once('client', function (serverClientNew) { + serverClientNew.on('publish', function () { + serverPublished = true + check() + }) + }) + }) + + client.publish('hello', 'world', { qos: 1 }, function () { + clientCalledBack = true + check() + }) + + function check () { + if (serverPublished && clientCalledBack) { + client.end() + done() + } + } + }) + + it('should not resend in-flight publish messages if disconnecting', function (done) { + var client = connect({reconnectPeriod: 200}) + var serverPublished = false + var clientCalledBack = false + server.once('client', function (serverClient) { + serverClient.on('connect', function () { + setImmediate(function () { + serverClient.stream.destroy() + client.end() + serverPublished.should.be.false() + clientCalledBack.should.be.false() + done() + }) + }) + server.once('client', function (serverClientNew) { + serverClientNew.on('publish', function () { + serverPublished = true + }) + }) + }) + client.publish('hello', 'world', { qos: 1 }, function () { + clientCalledBack = true + }) + }) + + it('should resend in-flight QoS 2 publish messages from the client', function (done) { + var client = connect({reconnectPeriod: 200}) + var serverPublished = false + var clientCalledBack = false + + server.once('client', function (serverClient) { + // ignore errors + serverClient.on('error', function () {}) + serverClient.on('publish', function () { + setImmediate(function () { + serverClient.stream.destroy() + }) + }) + + server.once('client', function (serverClientNew) { + serverClientNew.on('pubrel', function () { + serverPublished = true + check() + }) + }) + }) + + client.publish('hello', 'world', { qos: 2 }, function () { + clientCalledBack = true + check() + }) + + function check () { + if (serverPublished && clientCalledBack) { + client.end() + done() + } + } + }) + + it('should not resend in-flight QoS 1 removed publish messages from the client', function (done) { + var client = connect({reconnectPeriod: 200}) + var clientCalledBack = false + + server.once('client', function (serverClient) { + serverClient.on('connect', function () { + setImmediate(function () { + serverClient.stream.destroy() + }) + }) + + server.once('client', function (serverClientNew) { + serverClientNew.on('publish', function () { + should.fail() + done() + }) + }) + }) + + client.publish('hello', 'world', { qos: 1 }, function (err) { + clientCalledBack = true + should(err.message).be.equal('Message removed') + }) + should(Object.keys(client.outgoing).length).be.equal(1) + should(client.outgoingStore._inflights.size).be.equal(1) + client.removeOutgoingMessage(client.getLastMessageId()) + should(Object.keys(client.outgoing).length).be.equal(0) + should(client.outgoingStore._inflights.size).be.equal(0) + clientCalledBack.should.be.true() + client.end() + done() + }) + + it('should not resend in-flight QoS 2 removed publish messages from the client', function (done) { + var client = connect({reconnectPeriod: 200}) + var clientCalledBack = false + + server.once('client', function (serverClient) { + serverClient.on('connect', function () { + setImmediate(function () { + serverClient.stream.destroy() + }) + }) + + server.once('client', function (serverClientNew) { + serverClientNew.on('publish', function () { + should.fail() + done() + }) + }) + }) + + client.publish('hello', 'world', { qos: 2 }, function (err) { + clientCalledBack = true + should(err.message).be.equal('Message removed') + }) + should(Object.keys(client.outgoing).length).be.equal(1) + should(client.outgoingStore._inflights.size).be.equal(1) + client.removeOutgoingMessage(client.getLastMessageId()) + should(Object.keys(client.outgoing).length).be.equal(0) + should(client.outgoingStore._inflights.size).be.equal(0) + clientCalledBack.should.be.true() + client.end() + done() + }) + + it('should resubscribe when reconnecting', function (done) { + var client = connect({ reconnectPeriod: 100 }) + var tryReconnect = true + var reconnectEvent = false + + client.on('reconnect', function () { + reconnectEvent = true + }) + + client.on('connect', function () { + if (tryReconnect) { + client.subscribe('hello', function () { + client.stream.end() + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + client.end() + done() + }) + }) + }) + + tryReconnect = false + } else { + reconnectEvent.should.equal(true) + } + }) + }) + + it('should not resubscribe when reconnecting if resubscribe is disabled', function (done) { + var client = connect({ reconnectPeriod: 100, resubscribe: false }) + var tryReconnect = true + var reconnectEvent = false + + client.on('reconnect', function () { + reconnectEvent = true + }) + + client.on('connect', function () { + if (tryReconnect) { + client.subscribe('hello', function () { + client.stream.end() + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + should.fail() + }) + }) + }) + + tryReconnect = false + } else { + reconnectEvent.should.equal(true) + should(Object.keys(client._resubscribeTopics).length).be.equal(0) + done() + } + }) + }) + + it('should not resubscribe when reconnecting if suback is error', function (done) { + var tryReconnect = true + var reconnectEvent = false + var server2 = new Server(function (c) { + c.on('connect', function (packet) { + c.connack({returnCode: 0}) + }) + c.on('subscribe', function (packet) { + c.suback({ + messageId: packet.messageId, + granted: packet.subscriptions.map(function (e) { + return e.qos | 0x80 + }) + }) + c.pubrel({ messageId: Math.floor(Math.random() * 9000) + 1000 }) + }) + }) + + server2.listen(port + 49, function () { + var client = mqtt.connect({ + port: port + 49, + host: 'localhost', + reconnectPeriod: 100 + }) + + client.on('reconnect', function () { + reconnectEvent = true + }) + + client.on('connect', function () { + if (tryReconnect) { + client.subscribe('hello', function () { + client.stream.end() + + server.once('client', function (serverClient) { + serverClient.on('subscribe', function () { + should.fail() + }) + }) + }) + tryReconnect = false + } else { + reconnectEvent.should.equal(true) + should(Object.keys(client._resubscribeTopics).length).be.equal(0) + server2.close() + done() + } + }) + }) + }) + + it('should preserved incomingStore after disconnecting if clean is false', function (done) { + var reconnect = false + var client = {} + var incomingStore = new mqtt.Store({ clean: false }) + var outgoingStore = new mqtt.Store({ clean: false }) + var server2 = new Server(function (c) { + c.on('connect', function (packet) { + c.connack({returnCode: 0}) + if (reconnect) { + c.pubrel({ messageId: 1 }) + } + }) + c.on('subscribe', function (packet) { + c.suback({ + messageId: packet.messageId, + granted: packet.subscriptions.map(function (e) { + return e.qos + }) + }) + c.publish({ topic: 'topic', payload: 'payload', qos: 2, messageId: 1, retain: false }) + }) + c.on('pubrec', function (packet) { + client.end(false, function () { + client.reconnect({ + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + }) + }) + c.on('pubcomp', function (packet) { + client.end() + server2.close() + done() + }) + }) + + server2.listen(port + 50, function () { + client = mqtt.connect({ + port: port + 50, + host: 'localhost', + clean: false, + clientId: 'cid1', + reconnectPeriod: 0, + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + + client.on('connect', function () { + if (!reconnect) { + client.subscribe('test', {qos: 2}, function () { + }) + reconnect = true + } + }) + client.on('message', function (topic, message) { + topic.should.equal('topic') + message.toString().should.equal('payload') + }) + }) + }) + + it('should resend in-flight QoS 1 publish messages from the client if clean is false', function (done) { + var reconnect = false + var client = {} + var incomingStore = new mqtt.Store({ clean: false }) + var outgoingStore = new mqtt.Store({ clean: false }) + var server2 = new Server(function (c) { + c.on('connect', function (packet) { + c.connack({returnCode: 0}) + }) + c.on('publish', function (packet) { + if (reconnect) { + server2.close() + done() + } else { + client.end(true, function () { + client.reconnect({ + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + reconnect = true + }) + } + }) + }) + + server2.listen(port + 50, function () { + client = mqtt.connect({ + port: port + 50, + host: 'localhost', + clean: false, + clientId: 'cid1', + reconnectPeriod: 0, + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + + client.on('connect', function () { + if (!reconnect) { + client.publish('topic', 'payload', {qos: 1}) + } + }) + client.on('error', function () {}) + }) + }) + + it('should resend in-flight QoS 2 publish messages from the client if clean is false', function (done) { + var reconnect = false + var client = {} + var incomingStore = new mqtt.Store({ clean: false }) + var outgoingStore = new mqtt.Store({ clean: false }) + var server2 = new Server(function (c) { + c.on('connect', function (packet) { + c.connack({returnCode: 0}) + }) + c.on('publish', function (packet) { + if (reconnect) { + server2.close() + done() + } else { + client.end(true, function () { + client.reconnect({ + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + reconnect = true + }) + } + }) + }) + + server2.listen(port + 50, function () { + client = mqtt.connect({ + port: port + 50, + host: 'localhost', + clean: false, + clientId: 'cid1', + reconnectPeriod: 0, + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + + client.on('connect', function () { + if (!reconnect) { + client.publish('topic', 'payload', {qos: 2}) + } + }) + client.on('error', function () {}) + }) + }) + + it('should resend in-flight QoS 2 pubrel messages from the client if clean is false', function (done) { + var reconnect = false + var client = {} + var incomingStore = new mqtt.Store({ clean: false }) + var outgoingStore = new mqtt.Store({ clean: false }) + var server2 = new Server(function (c) { + c.on('connect', function (packet) { + c.connack({returnCode: 0}) + }) + c.on('publish', function (packet) { + if (!reconnect) { + c.pubrec({messageId: packet.messageId}) + } + }) + c.on('pubrel', function () { + if (reconnect) { + server2.close() + done() + } else { + client.end(true, function () { + client.reconnect({ + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + reconnect = true + }) + } + }) + }) + + server2.listen(port + 50, function () { + client = mqtt.connect({ + port: port + 50, + host: 'localhost', + clean: false, + clientId: 'cid1', + reconnectPeriod: 0, + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + + client.on('connect', function () { + if (!reconnect) { + client.publish('topic', 'payload', {qos: 2}) + } + }) + client.on('error', function () {}) + }) + }) + + it('should resend in-flight publish messages by published order', function (done) { + var publishCount = 0 + var reconnect = false + var disconnectOnce = true + var client = {} + var incomingStore = new mqtt.Store({ clean: false }) + var outgoingStore = new mqtt.Store({ clean: false }) + var server2 = new Server(function (c) { + // errors are not interesting for this test + // but they might happen on some platforms + c.on('error', function () {}) + + c.on('connect', function (packet) { + c.connack({returnCode: 0}) + }) + c.on('publish', function (packet) { + c.puback({messageId: packet.messageId}) + if (reconnect) { + switch (publishCount++) { + case 0: + packet.payload.toString().should.equal('payload1') + break + case 1: + packet.payload.toString().should.equal('payload2') + break + case 2: + packet.payload.toString().should.equal('payload3') + server2.close() + done() + break + } + } else { + if (disconnectOnce) { + client.end(true, function () { + reconnect = true + client.reconnect({ + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + }) + disconnectOnce = false + } + } + }) + }) + + server2.listen(port + 50, function () { + client = mqtt.connect({ + port: port + 50, + host: 'localhost', + clean: false, + clientId: 'cid1', + reconnectPeriod: 0, + incomingStore: incomingStore, + outgoingStore: outgoingStore + }) + + client.nextId = 65535 + + client.on('connect', function () { + if (!reconnect) { + client.publish('topic', 'payload1', {qos: 1}) + client.publish('topic', 'payload2', {qos: 1}) + client.publish('topic', 'payload3', {qos: 1}) + } + }) + client.on('error', function () {}) + }) + }) + + it('should be able to pub/sub if reconnect() is called at close handler', function (done) { + var client = connect({ reconnectPeriod: 0 }) + var tryReconnect = true + var reconnectEvent = false + + client.on('close', function () { + if (tryReconnect) { + tryReconnect = false + client.reconnect() + } else { + reconnectEvent.should.equal(true) + done() + } + }) + + client.on('reconnect', function () { + reconnectEvent = true + }) + + client.on('connect', function () { + if (tryReconnect) { + client.end() + } else { + client.subscribe('hello', function () { + client.end() + }) + } + }) + }) + + it('should be able to pub/sub if reconnect() is called at out of close handler', function (done) { + var client = connect({ reconnectPeriod: 0 }) + var tryReconnect = true + var reconnectEvent = false + + client.on('close', function () { + if (tryReconnect) { + tryReconnect = false + setTimeout(function () { + client.reconnect() + }, 100) + } else { + reconnectEvent.should.equal(true) + done() + } + }) + + client.on('reconnect', function () { + reconnectEvent = true + }) + + client.on('connect', function () { + if (tryReconnect) { + client.end() + } else { + client.subscribe('hello', function () { + client.end() + }) + } + }) + }) + + context('with alternate server client', function () { + var cachedClientListeners + + beforeEach(function () { + cachedClientListeners = server.listeners('client') + server.removeAllListeners('client') + }) + + afterEach(function () { + server.removeAllListeners('client') + cachedClientListeners.forEach(function (listener) { + server.on('client', listener) + }) + }) + + it('should resubscribe even if disconnect is before suback', function (done) { + var client = mqtt.connect(Object.assign({ reconnectPeriod: 100 }, config)) + var subscribeCount = 0 + var connectCount = 0 + + server.on('client', function (serverClient) { + serverClient.on('connect', function () { + connectCount++ + serverClient.connack({returnCode: 0}) + }) + + serverClient.on('subscribe', function () { + subscribeCount++ + + // disconnect before sending the suback on the first subscribe + if (subscribeCount === 1) { + client.stream.end() + } + + // after the second connection, confirm that the only two + // subscribes have taken place, then cleanup and exit + if (connectCount >= 2) { + subscribeCount.should.equal(2) + client.end(true, done) + } + }) + }) + + client.subscribe('hello') + }) + + it('should resubscribe exactly once', function (done) { + var client = mqtt.connect(Object.assign({ reconnectPeriod: 100 }, config)) + var subscribeCount = 0 + + server.on('client', function (serverClient) { + serverClient.on('connect', function () { + serverClient.connack({returnCode: 0}) + }) + + serverClient.on('subscribe', function () { + subscribeCount++ + + // disconnect before sending the suback on the first subscribe + if (subscribeCount === 1) { + client.stream.end() + } + + // after the second connection, only two subs + // subscribes have taken place, then cleanup and exit + if (subscribeCount === 2) { + client.end(true, done) + } + }) + }) + + client.subscribe('hello') + }) + }) + }) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/abstract_store.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/abstract_store.js new file mode 100644 index 00000000..02b3ec84 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/abstract_store.js @@ -0,0 +1,135 @@ +'use strict' + +require('should') + +module.exports = function abstractStoreTest (build) { + var store + + beforeEach(function (done) { + build(function (err, _store) { + store = _store + done(err) + }) + }) + + afterEach(function (done) { + store.close(done) + }) + + it('should put and stream in-flight packets', function (done) { + var packet = { + topic: 'hello', + payload: 'world', + qos: 1, + messageId: 42 + } + + store.put(packet, function () { + store + .createStream() + .on('data', function (data) { + data.should.eql(packet) + done() + }) + }) + }) + + it('should support destroying the stream', function (done) { + var packet = { + topic: 'hello', + payload: 'world', + qos: 1, + messageId: 42 + } + + store.put(packet, function () { + var stream = store.createStream() + stream.on('close', done) + stream.destroy() + }) + }) + + it('should add and del in-flight packets', function (done) { + var packet = { + topic: 'hello', + payload: 'world', + qos: 1, + messageId: 42 + } + + store.put(packet, function () { + store.del(packet, function () { + store + .createStream() + .on('data', function () { + done(new Error('this should never happen')) + }) + .on('end', done) + }) + }) + }) + + it('should replace a packet when doing put with the same messageId', function (done) { + var packet1 = { + cmd: 'publish', // added + topic: 'hello', + payload: 'world', + qos: 2, + messageId: 42 + } + var packet2 = { + cmd: 'pubrel', // added + qos: 2, + messageId: 42 + } + + store.put(packet1, function () { + store.put(packet2, function () { + store + .createStream() + .on('data', function (data) { + data.should.eql(packet2) + done() + }) + }) + }) + }) + + it('should return the original packet on del', function (done) { + var packet = { + topic: 'hello', + payload: 'world', + qos: 1, + messageId: 42 + } + + store.put(packet, function () { + store.del({ messageId: 42 }, function (err, deleted) { + if (err) { + throw err + } + deleted.should.eql(packet) + done() + }) + }) + }) + + it('should get a packet with the same messageId', function (done) { + var packet = { + topic: 'hello', + payload: 'world', + qos: 1, + messageId: 42 + } + + store.put(packet, function () { + store.get({ messageId: 42 }, function (err, fromDb) { + if (err) { + throw err + } + fromDb.should.eql(packet) + done() + }) + }) + }) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/server.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/server.js new file mode 100644 index 00000000..e5fab8c7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/server.js @@ -0,0 +1,132 @@ +'use strict' + +var handleClient +var websocket = require('websocket-stream') +var WebSocketServer = require('ws').Server +var Connection = require('mqtt-connection') +var http = require('http') + +handleClient = function (client) { + var self = this + + if (!self.clients) { + self.clients = {} + } + + client.on('connect', function (packet) { + if (packet.clientId === 'invalid') { + client.connack({returnCode: 2}) + } else { + client.connack({returnCode: 0}) + } + self.clients[packet.clientId] = client + client.subscriptions = [] + }) + + client.on('publish', function (packet) { + var i, k, c, s, publish + switch (packet.qos) { + case 0: + break + case 1: + client.puback(packet) + break + case 2: + client.pubrec(packet) + break + } + + for (k in self.clients) { + c = self.clients[k] + publish = false + + for (i = 0; i < c.subscriptions.length; i++) { + s = c.subscriptions[i] + + if (s.test(packet.topic)) { + publish = true + } + } + + if (publish) { + try { + c.publish({topic: packet.topic, payload: packet.payload}) + } catch (error) { + delete self.clients[k] + } + } + } + }) + + client.on('pubrel', function (packet) { + client.pubcomp(packet) + }) + + client.on('pubrec', function (packet) { + client.pubrel(packet) + }) + + client.on('pubcomp', function () { + // Nothing to be done + }) + + client.on('subscribe', function (packet) { + var qos + var topic + var reg + var granted = [] + + for (var i = 0; i < packet.subscriptions.length; i++) { + qos = packet.subscriptions[i].qos + topic = packet.subscriptions[i].topic + reg = new RegExp(topic.replace('+', '[^/]+').replace('#', '.+') + '$') + + granted.push(qos) + client.subscriptions.push(reg) + } + + client.suback({messageId: packet.messageId, granted: granted}) + }) + + client.on('unsubscribe', function (packet) { + client.unsuback(packet) + }) + + client.on('pingreq', function () { + client.pingresp() + }) +} + +function start (startPort, done) { + var server = http.createServer() + var wss = new WebSocketServer({server: server}) + + wss.on('connection', function (ws) { + var stream, connection + + if (!(ws.protocol === 'mqtt' || + ws.protocol === 'mqttv3.1')) { + return ws.close() + } + + stream = websocket(ws) + connection = new Connection(stream) + handleClient.call(server, connection) + }) + server.listen(startPort, done) + server.on('request', function (req, res) { + res.statusCode = 404 + res.end('Not Found') + }) + return server +} + +if (require.main === module) { + start(process.env.PORT || process.env.ZUUL_PORT, function (err) { + if (err) { + console.error(err) + return + } + console.log('tunnelled server started on port', process.env.PORT || process.env.ZUUL_PORT) + }) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/test.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/test.js new file mode 100644 index 00000000..2adc86c7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/test.js @@ -0,0 +1,92 @@ +'use strict' + +var mqtt = require('../../lib/connect') +var _URL = require('url') +var xtend = require('xtend') +var parsed = _URL.parse(document.URL) +var isHttps = parsed.protocol === 'https:' +var port = parsed.port || (isHttps ? 443 : 80) +var host = parsed.hostname +var protocol = isHttps ? 'wss' : 'ws' + +function clientTests (buildClient) { + var client + + beforeEach(function () { + client = buildClient() + client.on('offline', function () { + console.log('client offline') + }) + client.on('connect', function () { + console.log('client connect') + }) + client.on('reconnect', function () { + console.log('client reconnect') + }) + }) + + afterEach(function (done) { + client.once('close', function () { + done() + }) + client.end() + }) + + it('should connect', function (done) { + client.on('connect', function () { + done() + }) + }) + + it('should publish and subscribe', function (done) { + client.subscribe('hello', function () { + done() + }).publish('hello', 'world') + }) +} + +function suiteFactory (configName, opts) { + function setVersion (base) { + return xtend(base || {}, opts) + } + + var suiteName = 'MqttClient(' + configName + '=' + JSON.stringify(opts) + ')' + describe(suiteName, function () { + this.timeout(10000) + + describe('specifying nothing', function () { + clientTests(function () { + return mqtt.connect(setVersion()) + }) + }) + + if (parsed.hostname === 'localhost') { + describe('specifying a port', function () { + clientTests(function () { + return mqtt.connect(setVersion({ protocol: protocol, port: port })) + }) + }) + } + + describe('specifying a port and host', function () { + clientTests(function () { + return mqtt.connect(setVersion({ protocol: protocol, port: port, host: host })) + }) + }) + + describe('specifying a URL', function () { + clientTests(function () { + return mqtt.connect(protocol + '://' + host + ':' + port, setVersion()) + }) + }) + + describe('specifying a URL with a path', function () { + clientTests(function () { + return mqtt.connect(protocol + '://' + host + ':' + port + '/mqtt', setVersion()) + }) + }) + }) +} + +suiteFactory('v3', {protocolId: 'MQIsdp', protocolVersion: 3}) +suiteFactory('default', {}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/wx.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/wx.js new file mode 100644 index 00000000..f4ba6a96 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/browser/wx.js @@ -0,0 +1,93 @@ +'use strict' + +var mqtt = require('../../lib/connect') +var _URL = require('url') +var xtend = require('xtend') +var parsed = _URL.parse(document.URL) +var isHttps = parsed.protocol === 'https:' +var port = parsed.port || (isHttps ? 443 : 80) +var host = parsed.hostname +var protocol = isHttps ? 'wxs' : 'wx' +require('../helpers/wx') + +function clientTests (buildClient) { + var client + + beforeEach(function () { + client = buildClient() + client.on('offline', function () { + console.log('client offline') + }) + client.on('connect', function () { + console.log('client connect') + }) + client.on('reconnect', function () { + console.log('client reconnect') + }) + }) + + afterEach(function (done) { + client.once('close', function () { + done() + }) + client.end() + }) + + it('should connect', function (done) { + client.on('connect', function () { + done() + }) + }) + + it('should publish and subscribe', function (done) { + client.subscribe('hello', function () { + done() + }).publish('hello', 'world') + }) +} + +function suiteFactory (configName, opts) { + function setVersion (base) { + return xtend(base || {}, opts) + } + + var suiteName = 'MqttClient(' + configName + '=' + JSON.stringify(opts) + ')' + describe(suiteName, function () { + this.timeout(10000) + + describe('specifying nothing', function () { + clientTests(function () { + return mqtt.connect(setVersion()) + }) + }) + + if (parsed.hostname === 'localhost') { + describe('specifying a port', function () { + clientTests(function () { + return mqtt.connect(setVersion({ protocol: protocol, port: port })) + }) + }) + } + + describe('specifying a port and host', function () { + clientTests(function () { + return mqtt.connect(setVersion({ protocol: protocol, port: port, host: host })) + }) + }) + + describe('specifying a URL', function () { + clientTests(function () { + return mqtt.connect(protocol + '://' + host + ':' + port, setVersion()) + }) + }) + + describe('specifying a URL with a path', function () { + clientTests(function () { + return mqtt.connect(protocol + '://' + host + ':' + port + '/mqtt', setVersion()) + }) + }) + }) +} + +suiteFactory('v3', {protocolId: 'MQIsdp', protocolVersion: 3}) +suiteFactory('default', {}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/client.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/client.js new file mode 100644 index 00000000..ff4e8e64 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/client.js @@ -0,0 +1,544 @@ +'use strict' + +var mqtt = require('..') +var should = require('should') +var fork = require('child_process').fork +var path = require('path') +var abstractClientTests = require('./abstract_client') +var net = require('net') +var eos = require('end-of-stream') +var mqttPacket = require('mqtt-packet') +var Buffer = require('safe-buffer').Buffer +var Duplex = require('readable-stream').Duplex +var Connection = require('mqtt-connection') +var Server = require('./server') +var port = 9876 +var server + +function connOnlyServer () { + return new Server(function (client) { + client.on('connect', function (packet) { + client.connack({returnCode: 0}) + }) + }) +} + +/** + * Test server + */ +function buildServer () { + return new Server(function (client) { + client.on('connect', function (packet) { + if (packet.clientId === 'invalid') { + client.connack({returnCode: 2}) + } else { + client.connack({returnCode: 0}) + } + }) + + client.on('publish', function (packet) { + setImmediate(function () { + switch (packet.qos) { + case 0: + break + case 1: + client.puback(packet) + break + case 2: + client.pubrec(packet) + break + } + }) + }) + + client.on('pubrel', function (packet) { + client.pubcomp(packet) + }) + + client.on('pubrec', function (packet) { + client.pubrel(packet) + }) + + client.on('pubcomp', function () { + // Nothing to be done + }) + + client.on('subscribe', function (packet) { + client.suback({ + messageId: packet.messageId, + granted: packet.subscriptions.map(function (e) { + return e.qos + }) + }) + }) + + client.on('unsubscribe', function (packet) { + client.unsuback(packet) + }) + + client.on('pingreq', function () { + client.pingresp() + }) + }) +} + +server = buildServer().listen(port) + +describe('MqttClient', function () { + describe('creating', function () { + it('should allow instantiation of MqttClient without the \'new\' operator', function (done) { + should(function () { + var client + try { + client = mqtt.MqttClient(function () { + throw Error('break') + }, {}) + client.end() + } catch (err) { + if (err.message !== 'break') { + throw err + } + done() + } + }).not.throw('Object # has no method \'_setupStream\'') + }) + }) + + var config = { protocol: 'mqtt', port: port } + abstractClientTests(server, config) + + describe('message ids', function () { + it('should increment the message id', function () { + var client = mqtt.connect(config) + var currentId = client._nextId() + + client._nextId().should.equal(currentId + 1) + client.end() + }) + + it('should return 1 once the internal counter reached limit', function () { + var client = mqtt.connect(config) + client.nextId = 65535 + + client._nextId().should.equal(65535) + client._nextId().should.equal(1) + client.end() + }) + + it('should return 65535 for last message id once the internal counter reached limit', function () { + var client = mqtt.connect(config) + client.nextId = 65535 + + client._nextId().should.equal(65535) + client.getLastMessageId().should.equal(65535) + client._nextId().should.equal(1) + client.getLastMessageId().should.equal(1) + client.end() + }) + + it('should not throw an error if packet\'s messageId is not found when receiving a pubrel packet', function (done) { + var server2 = new Server(function (c) { + c.on('connect', function (packet) { + c.connack({returnCode: 0}) + c.pubrel({ messageId: Math.floor(Math.random() * 9000) + 1000 }) + }) + }) + + server2.listen(port + 49, function () { + var client = mqtt.connect({ + port: port + 49, + host: 'localhost' + }) + + client.on('packetsend', function (packet) { + if (packet.cmd === 'pubcomp') { + client.end() + server2.close() + done() + } + }) + }) + }) + + it('should not go overflow if the TCP frame contains a lot of PUBLISH packets', function (done) { + var parser = mqttPacket.parser() + var count = 0 + var max = 1000 + var duplex = new Duplex({ + read: function (n) {}, + write: function (chunk, enc, cb) { + parser.parse(chunk) + cb() // nothing to do + } + }) + var client = new mqtt.MqttClient(function () { + return duplex + }, {}) + + client.on('message', function (t, p, packet) { + if (++count === max) { + done() + } + }) + + parser.on('packet', function (packet) { + var packets = [] + + if (packet.cmd === 'connect') { + duplex.push(mqttPacket.generate({ + cmd: 'connack', + sessionPresent: false, + returnCode: 0 + })) + + for (var i = 0; i < max; i++) { + packets.push(mqttPacket.generate({ + cmd: 'publish', + topic: Buffer.from('hello'), + payload: Buffer.from('world'), + retain: false, + dup: false, + messageId: i + 1, + qos: 1 + })) + } + + duplex.push(Buffer.concat(packets)) + } + }) + }) + }) + + describe('flushing', function () { + it('should attempt to complete pending unsub and send on ping timeout', function (done) { + this.timeout(10000) + var server3 = connOnlyServer().listen(port + 72) + var pubCallbackCalled = false + var unsubscribeCallbackCalled = false + var client = mqtt.connect({ + port: port + 72, + host: 'localhost', + keepalive: 1, + connectTimeout: 350, + reconnectPeriod: 0 + }) + client.once('connect', () => { + client.publish('fakeTopic', 'fakeMessage', {qos: 1}, (err, result) => { + should.exist(err) + pubCallbackCalled = true + }) + client.unsubscribe('fakeTopic', (err, result) => { + should.exist(err) + unsubscribeCallbackCalled = true + }) + setTimeout(() => { + client.end(() => { + should.equal(pubCallbackCalled && unsubscribeCallbackCalled, true, 'callbacks not invoked') + server3.close() + done() + }) + }, 5000) + }) + }) + }) + + describe('reconnecting', function () { + it('should attempt to reconnect once server is down', function (done) { + this.timeout(15000) + + var innerServer = fork(path.join(__dirname, 'helpers', 'server_process.js')) + var client = mqtt.connect({ port: 3000, host: 'localhost', keepalive: 1 }) + + client.once('connect', function () { + innerServer.kill('SIGINT') // mocks server shutdown + + client.once('close', function () { + should.exist(client.reconnectTimer) + client.end() + done() + }) + }) + }) + + it('should reconnect to multiple host-ports-protocol combinations if servers is passed', function (done) { + this.timeout(15000) + + var server2 = buildServer().listen(port + 42) + + server2.on('listening', function () { + var client = mqtt.connect({ + protocol: 'wss', + servers: [ + { port: port + 42, host: 'localhost', protocol: 'ws' }, + { port: port, host: 'localhost' } + ], + keepalive: 50 + }) + server2.on('client', function (c) { + should.equal(client.stream.socket.url, 'ws://localhost:9918/', 'Protocol for first connection should use ws.') + c.stream.destroy() + server2.close() + }) + + server.once('client', function () { + should.equal(client.stream.socket.url, 'wss://localhost:9876/', 'Protocol for second client should use the default protocol: wss, on port: port + 42.') + client.end() + done() + }) + + client.once('connect', function () { + client.stream.destroy() + }) + }) + }) + + it('should reconnect if a connack is not received in an interval', function (done) { + this.timeout(2000) + + var server2 = net.createServer().listen(port + 43) + + server2.on('connection', function (c) { + eos(c, function () { + server2.close() + }) + }) + + server2.on('listening', function () { + var client = mqtt.connect({ + servers: [ + { port: port + 43, host: 'localhost_fake' }, + { port: port, host: 'localhost' } + ], + connectTimeout: 500 + }) + + server.once('client', function () { + client.end() + done() + }) + + client.once('connect', function () { + client.stream.destroy() + }) + }) + }) + + it('should not be cleared by the connack timer', function (done) { + this.timeout(4000) + + var server2 = net.createServer().listen(port + 44) + + server2.on('connection', function (c) { + c.destroy() + }) + + server2.once('listening', function () { + var reconnects = 0 + var connectTimeout = 1000 + var reconnectPeriod = 100 + var expectedReconnects = Math.floor(connectTimeout / reconnectPeriod) + var client = mqtt.connect({ + port: port + 44, + host: 'localhost', + connectTimeout: connectTimeout, + reconnectPeriod: reconnectPeriod + }) + + client.on('reconnect', function () { + reconnects++ + if (reconnects >= expectedReconnects) { + client.end() + done() + } + }) + }) + }) + + it('should not keep requeueing the first message when offline', function (done) { + this.timeout(2500) + + var server2 = buildServer().listen(port + 45) + var client = mqtt.connect({ + port: port + 45, + host: 'localhost', + connectTimeout: 350, + reconnectPeriod: 300 + }) + + server2.on('client', function (c) { + client.publish('hello', 'world', { qos: 1 }, function () { + c.destroy() + server2.close() + client.publish('hello', 'world', { qos: 1 }) + }) + }) + + setTimeout(function () { + if (client.queue.length === 0) { + client.end(true) + done() + } else { + client.end(true) + } + }, 2000) + }) + + it('should not send the same subscribe multiple times on a flaky connection', function (done) { + this.timeout(3500) + + var KILL_COUNT = 4 + var killedConnections = 0 + var subIds = {} + var client = mqtt.connect({ + port: port + 46, + host: 'localhost', + connectTimeout: 350, + reconnectPeriod: 300 + }) + + var server2 = new Server(function (client) { + client.on('error', function () {}) + client.on('connect', function (packet) { + if (packet.clientId === 'invalid') { + client.connack({returnCode: 2}) + } else { + client.connack({returnCode: 0}) + } + }) + }).listen(port + 46) + + server2.on('client', function (c) { + client.subscribe('topic', function () { + done() + client.end() + c.destroy() + server2.close() + }) + + c.on('subscribe', function (packet) { + if (killedConnections < KILL_COUNT) { + // Kill the first few sub attempts to simulate a flaky connection + killedConnections++ + c.destroy() + } else { + // Keep track of acks + if (!subIds[packet.messageId]) { + subIds[packet.messageId] = 0 + } + subIds[packet.messageId]++ + if (subIds[packet.messageId] > 1) { + done(new Error('Multiple duplicate acked subscriptions received for messageId ' + packet.messageId)) + client.end(true) + c.destroy() + server2.destroy() + } + + c.suback({ + messageId: packet.messageId, + granted: packet.subscriptions.map(function (e) { + return e.qos + }) + }) + } + }) + }) + }) + + it('should not fill the queue of subscribes if it cannot connect', function (done) { + this.timeout(2500) + + var port2 = port + 48 + + var server2 = net.createServer(function (stream) { + var client = new Connection(stream) + + client.on('error', function () {}) + client.on('connect', function (packet) { + client.connack({returnCode: 0}) + client.destroy() + }) + }) + + server2.listen(port2, function () { + var client = mqtt.connect({ + port: port2, + host: 'localhost', + connectTimeout: 350, + reconnectPeriod: 300 + }) + + client.subscribe('hello') + + setTimeout(function () { + client.queue.length.should.equal(1) + client.end() + done() + }, 1000) + }) + }) + + it('should not send the same publish multiple times on a flaky connection', function (done) { + this.timeout(3500) + + var KILL_COUNT = 4 + var killedConnections = 0 + var pubIds = {} + var client = mqtt.connect({ + port: port + 47, + host: 'localhost', + connectTimeout: 350, + reconnectPeriod: 300 + }) + + var server2 = net.createServer(function (stream) { + var client = new Connection(stream) + client.on('error', function () {}) + client.on('connect', function (packet) { + if (packet.clientId === 'invalid') { + client.connack({returnCode: 2}) + } else { + client.connack({returnCode: 0}) + } + }) + + this.emit('client', client) + }).listen(port + 47) + + server2.on('client', function (c) { + client.publish('topic', 'data', { qos: 1 }, function () { + done() + client.end() + c.destroy() + server2.destroy() + }) + + c.on('publish', function onPublish (packet) { + if (killedConnections < KILL_COUNT) { + // Kill the first few pub attempts to simulate a flaky connection + killedConnections++ + c.destroy() + + // to avoid receiving inflight messages + c.removeListener('publish', onPublish) + } else { + // Keep track of acks + if (!pubIds[packet.messageId]) { + pubIds[packet.messageId] = 0 + } + + pubIds[packet.messageId]++ + + if (pubIds[packet.messageId] > 1) { + done(new Error('Multiple duplicate acked publishes received for messageId ' + packet.messageId)) + client.end(true) + c.destroy() + server2.destroy() + } + + c.puback(packet) + } + }) + }) + }) + }) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/private-csr.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/private-csr.pem new file mode 100644 index 00000000..5c9f3924 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/private-csr.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICijCCAXICAQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx +ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBANtzIZmqf7h3axO9mzo2VhiF/BF3Y4E/fDTkFy27 +PgssS/ipFOMe/IxyM/hA/o/bQb0BY+sH5s1020kNH79umtabWMaDmOi8bvmHWtVC +cYhn3mhbRFWcORdTnfQ8uRYXZGeoupjlhfrKkQCoSAFKh1OzU7aNx4CjMAjSa4py +trMAVNJ37RryhsfMuHAeG8+0Eo3qmYyaplpurtr8A3HWV65R2VFCwZ5hKG8I9X2F +3UrYKHr4xlxOgjD8j2OfYZxpGHI6YexJ28aR0xlsWfzS+TKKFVxy8ntgPGL0ZXL3 +vss80mAcBl9FfsJzufn4IHOYspX1OEM0M7plMmQw/yNT9B8CAwEAAaAAMA0GCSqG +SIb3DQEBBQUAA4IBAQBsONiE5HTjfR1pDrWPIhbLqMO3AqmuB5AwpQm8kAaM2Oz1 +DI/a8bHYyODMiyWUPTtwLMQWcJpAG2ZhE18gLqFwXZR1XSOxY1yF+uZ7Ls3hwzbq +9A6O254B5wXBnXkVbzZwFshV5HWiZwVivF5GDyLRsMoS2EtUHoDEP4YIRK0kPL9H +m3BB334KlWTc8NNXFFG62OL7q2fa8xRHlN8SYfeUjy79eEoBdHv5wL/ZN/YBCDNJ +2zrYUvbOmfoq1e+6AczZ6xAHHeneUQuaOF225aMwHHZTiP2TlIeFXwBvzV1BWIJv +dOaHX/f3NamKoGvwYyIR1FrI2FpXTJLRE/eu7TFD +-----END CERTIFICATE REQUEST----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/private-key.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/private-key.pem new file mode 100644 index 00000000..fa042129 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/private-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA23Mhmap/uHdrE72bOjZWGIX8EXdjgT98NOQXLbs+CyxL+KkU +4x78jHIz+ED+j9tBvQFj6wfmzXTbSQ0fv26a1ptYxoOY6Lxu+Yda1UJxiGfeaFtE +VZw5F1Od9Dy5FhdkZ6i6mOWF+sqRAKhIAUqHU7NTto3HgKMwCNJrinK2swBU0nft +GvKGx8y4cB4bz7QSjeqZjJqmWm6u2vwDcdZXrlHZUULBnmEobwj1fYXdStgoevjG +XE6CMPyPY59hnGkYcjph7EnbxpHTGWxZ/NL5MooVXHLye2A8YvRlcve+yzzSYBwG +X0V+wnO5+fggc5iylfU4QzQzumUyZDD/I1P0HwIDAQABAoIBAQDNgNdqS5wnZs1D +Qz/mF5QwiugugxsPoh/yd9as4LeNRwIt7ki9F/twmlHInTTGCpFZKcAkDNY6eMAR +fNTKNA2UAw3zeLDs4ekai4KoSvx+vKYuG6m2cgGUsp0sZuD8qxM/b2auX+JDpQZ9 +Exm6+8wWucwfHE5DTI5i9In4sMweeuiEUYnndTzElkvnP/44h1fGSU1iGUKn/ftc +P4X+3SU68KMT3kUsEBavtmSdyeG/lSFEjm73FwVIRZ+PfbQX2hDD+mmseAXGFKi1 +HudtQkEzTvYR+QAgvtjNgt/0qxFtPdj7Y+iRkCZQSJToAw8z6vwUn1qNCADauGMI +X6KIm8XBAoGBAPiwMLYpIqp1rksINbqpbVqjtqsoejQuPYeEF7OXHbH9il7pWrQF +wLbogo3YXX+a66RreVMhsUeq7+pIf/sK2lT73gDpFfvZnJG1ww94QkHBEPso0bN9 +pcGgceIK7KRRAiAl5Mjw6pZZNnIBxlIFaSbBqQau74NfdaalMBF2wi+3AoGBAOHm +3ttFtVjVlb2fHoiGNZCZDv3gnsQXZlCxS+rQ4XEmEWKHAH4T3+Kzmo8jWoX+DGGD +6UkxWHv7e+KrYIZDi7Dd2HFV0gHN6d1SNdPix3vN114bNOrbfqxuEVT5PdFHSuel +5d3ix+3U+tpHamwb88eyeq6Q3t5Lcl3gIRGLzo7ZAoGBAKVuLzk+K/1Qw1zOXU+K +nWAKP92j04caq3uWd13UTMC2dHGmsdvHZ+dEzHQnVisol1CM3exbIV8XavliuR/6 +nDqkQY5Bf4pFvE2Bp/yGdyzejblF8hmAn98qKBfCRKEZ8lwIWSUCfkr9laZJX+/4 +AXbypMn5XQL7YXw1rsAvTAYJAoGAV4ZL8kkf6jtWuRFdkyfsuQmUdWkCGpe2XK1U +7LXhoyVMtw/3cOHibMOJrsvT1vaHdYDWcjVcQy084qXj0CF7jhtmMQM/StOtOMMR +d/b1s1Idj6ia6CQDAGvk6zdmbB9jNj1gwoeLTuqmBsyEvz5VRZoxTlFzCE3TEew0 +48d3UIECgYBMxnLByVQA3pQWWIZZyqt+HgJAphYPdpnPalblQAbuCksKTZ/QKDkW +dzih1PQROVrYrX7VwJ3/I8gXIuvKVtN1NKOS3a0JtbJQhpH4YbRwyQskXWYP8oYa +MjBGPymNDhZh0zoGWzst5uR3NpdNV+7yNYPvyxzVNjlPjtAUqIxjBg== +-----END RSA PRIVATE KEY----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/public-cert.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/public-cert.pem new file mode 100644 index 00000000..881c8b02 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/public-cert.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBjCCAe4CCQDkrq1PMPtmfzANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB +VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMB4XDTEzMDEyNTEwMzEyOVoXDTEzMDIyNDEwMzEyOVowRTELMAkG +A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 +IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANtzIZmqf7h3axO9mzo2VhiF/BF3Y4E/fDTkFy27PgssS/ipFOMe/IxyM/hA/o/b +Qb0BY+sH5s1020kNH79umtabWMaDmOi8bvmHWtVCcYhn3mhbRFWcORdTnfQ8uRYX +ZGeoupjlhfrKkQCoSAFKh1OzU7aNx4CjMAjSa4pytrMAVNJ37RryhsfMuHAeG8+0 +Eo3qmYyaplpurtr8A3HWV65R2VFCwZ5hKG8I9X2F3UrYKHr4xlxOgjD8j2OfYZxp +GHI6YexJ28aR0xlsWfzS+TKKFVxy8ntgPGL0ZXL3vss80mAcBl9FfsJzufn4IHOY +spX1OEM0M7plMmQw/yNT9B8CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAeHAwoKYl +6g9lUEwBDqm6ZxjgoYQi6V3loCjBcTr5OrMkLvvZrA55xsse0NRH40I/pvCaAZAZ +EEna0fr5GPYi+y+I8EoU2W/+ehSqRAU8Fkdm0eR5MjyLWYOwd3ClUND8EpUNNSKH +Xw9k9EQmyKsDxVsKWoJoO9rfFkUjooz07jGPCud18QCBs5i5ThbnQ9UP+26D8z5k +1Dii69LIcLXA3Vtm6R5fT57zNusfx8bqA9yy7UThYaXIazNMWNxiJRXfv0J4zFdD +RQ+SFdJ3p5jurPkc3oRWWPbn/Lpf0E5XlYTJImXT1WmWnQSaNtME4P+3kEL5x+v/ +u8zTLbobG4x0rQ== +-----END CERTIFICATE----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/public-key.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/public-key.pem new file mode 100644 index 00000000..23893ba2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/public-key.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA23Mhmap/uHdrE72bOjZW +GIX8EXdjgT98NOQXLbs+CyxL+KkU4x78jHIz+ED+j9tBvQFj6wfmzXTbSQ0fv26a +1ptYxoOY6Lxu+Yda1UJxiGfeaFtEVZw5F1Od9Dy5FhdkZ6i6mOWF+sqRAKhIAUqH +U7NTto3HgKMwCNJrinK2swBU0nftGvKGx8y4cB4bz7QSjeqZjJqmWm6u2vwDcdZX +rlHZUULBnmEobwj1fYXdStgoevjGXE6CMPyPY59hnGkYcjph7EnbxpHTGWxZ/NL5 +MooVXHLye2A8YvRlcve+yzzSYBwGX0V+wnO5+fggc5iylfU4QzQzumUyZDD/I1P0 +HwIDAQAB +-----END PUBLIC KEY----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/server.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/server.js new file mode 100644 index 00000000..9750bf1f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/server.js @@ -0,0 +1,52 @@ +'use strict' + +var Server = require('../server') +var fs = require('fs') + +module.exports.init_server = function (PORT) { + var server = new Server(function (client) { + client.on('connect', function () { + client.connack(0) + }) + + client.on('publish', function (packet) { + switch (packet.qos) { + case 1: + client.puback({messageId: packet.messageId}) + break + case 2: + client.pubrec({messageId: packet.messageId}) + break + default: + break + } + }) + + client.on('pubrel', function (packet) { + client.pubcomp({messageId: packet.messageId}) + }) + + client.on('pingreq', function () { + client.pingresp() + }) + + client.on('disconnect', function () { + client.stream.end() + }) + }) + server.listen(PORT) + return server +} + +module.exports.init_secure_server = function (port, key, cert) { + var server = new Server.SecureServer({ + key: fs.readFileSync(key), + cert: fs.readFileSync(cert) + }, function (client) { + client.on('connect', function () { + client.connack({returnCode: 0}) + }) + }) + server.listen(port) + return server +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/server_process.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/server_process.js new file mode 100644 index 00000000..747dc679 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/server_process.js @@ -0,0 +1,9 @@ +'use strict' + +var Server = require('../server') + +new Server(function (client) { + client.on('connect', function () { + client.connack({ returnCode: 0 }) + }) +}).listen(3000, 'localhost') diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-cert.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-cert.pem new file mode 100644 index 00000000..898bf9a5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICKTCCAZICCQDRSYqWgZyJmjANBgkqhkiG9w0BAQUFADBZMQswCQYDVQQGEwJB +VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMRIwEAYDVQQDEwlsb2NhbGhvc3QwHhcNMTQwNjEzMTAwMzAzWhcN +MjQwNjEwMTAwMzAzWjBZMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0 +ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRIwEAYDVQQDEwls +b2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMzFv8+9EBb1sG07 +TjdtbRksRwF7/CZsOWe+ef4ZYPolC5lzvNVYXsBIjL+ilhyKopBbwnOuX9+6FmYO +G/N1lDZRssolGoOVM+1ma3Whmxz8C1g+xi95nP2OqtwP5Du6xhvOM265CiMaf8DH +n63ZFxyi3d1CdNGamNQvrybCzJn7AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABmyp +3wyBGjb2zSHK5pF9c9GXyHRL4/FkP6qzU5NWrfVAowdOczctJbc3hxPh34Encbr6 +KijYnbdP7/f8aZrStLGqgFYL3SHZY3zvgLTzOmGr9reHUkubHtN+mWHeYy1wVe3D +qEOI8ygT4olVZmWAD+VLKgAb0J07rA/PKf82fBI= +-----END CERTIFICATE----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-csr.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-csr.pem new file mode 100644 index 00000000..be3a561d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-csr.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBmTCCAQICAQAwWTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAxMJbG9j +YWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMxb/PvRAW9bBtO043 +bW0ZLEcBe/wmbDlnvnn+GWD6JQuZc7zVWF7ASIy/opYciqKQW8Jzrl/fuhZmDhvz +dZQ2UbLKJRqDlTPtZmt1oZsc/AtYPsYveZz9jqrcD+Q7usYbzjNuuQojGn/Ax5+t +2Rccot3dQnTRmpjUL68mwsyZ+wIDAQABoAAwDQYJKoZIhvcNAQEFBQADgYEALjPb +zOEL8ahD+UFxwVCXTq4MsKwMlyZCcEVY0CksAgWpCkWr54JUp832p3nEylPRj/gx +8fKWzz5DiO3RER8fzmkb+Kwa+JvXVHmTFzemxYGnxS/HRlF0ZoeAIgvq6ouIrqm9 +1P9gsuYmA5vtfc6Y/NVlSrcSYFH4ADF5DcRTi2Q= +-----END CERTIFICATE REQUEST----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-key.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-key.pem new file mode 100644 index 00000000..965e54fd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/tls-key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQDMxb/PvRAW9bBtO043bW0ZLEcBe/wmbDlnvnn+GWD6JQuZc7zV +WF7ASIy/opYciqKQW8Jzrl/fuhZmDhvzdZQ2UbLKJRqDlTPtZmt1oZsc/AtYPsYv +eZz9jqrcD+Q7usYbzjNuuQojGn/Ax5+t2Rccot3dQnTRmpjUL68mwsyZ+wIDAQAB +AoGARg7p/xL6LEDGqbh+nCwOBWzGplVbAXJJeZsLdcoNCcge3dNhKcTgNf0cWnwv +y3gLAkTClH12Q78Q5r2xBmyV1hqyEb9lrIqAlSS5GjnTWWhyzspcjKZWR5PAjOYo +LlxNpCegWEjOUpD4Lwf9yjEu+xrDGVmsLF0PPRkAM32qh9ECQQD1vzyFr/hSn7Rh +6IFFbLAVkIvsy+1Ca7tF6/7byHCdwqS5oUKaY+9DAr0TE+br87N2IzUCU5X7Cv74 +m+YiqhBlAkEA1VDfpq8puyIq2F6Ftx0xpYMv6XKhuRyAziT/DzIBdFVeOMIgUuk0 +7E4W0N/gDmUmEQFl3HYzUfdZrTUKzjzq3wJAZflsKOGDfu2skXBErEVUsC4iEinx +Ez3XIUWzpQoAyUYqyqjDFYPglgL96Hu6uDCRSLWFWqjKtLi0Yv92OO4vDQJASuAk +YQHDCCiqGWC0Vt4sewhdXPgbxDo5DCL4VIEc+ZStiga6CeBJ71hJse+jWeovPnDb +LFNhGDhWhfHEZTgEyQJAXNuypDS5l73LPvc+yduPZiNEtwae9KbWaZUwC683a81s +mkT7uroNYyK9ptZrz/LMJJotkqCjigXaA3kuzuNUCQ== +-----END RSA PRIVATE KEY----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-cert.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-cert.pem new file mode 100644 index 00000000..3dfdb6f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-cert.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIICATCCAWoCCQDEVSSDKkcTdjANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB +VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMB4XDTE0MDUxMTE2MzMxMVoXDTE0MDYxMDE2MzMxMVowRTELMAkG +A1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0 +IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyDMI +VS2XSizZT8KeFYFQfKt7CcT5/Pkzw2BDJoMVLmrkfHdddjsTgswqHfzhO8Fmfg6B +MxgsEz2aKi24hJxQFuQ1DGhyfKHnjxM5PqSLiOkQDKllnAOgqOBDXpca0jXypCk1 +IVhMspM2ylrnBXps3nTBLJxFBkZSBov/JDkkL+cCAwEAATANBgkqhkiG9w0BAQUF +AAOBgQA8k93U0VDIpQ8lpScxrCtEu5jLZgB1fw0fdCUtDHaaM1v+LWr1xfCmFKyT +kUMcJl4e1pkcSNfXcI7LdNt8EJqMabOi2UpW1+VZJn206D0f3XmNSmZbk8oozGrl +qg2wSTZYlZClCTpWO2Y+iYzojY8kmLaQ2xbTxBz1XlshC8HvsA== +-----END CERTIFICATE----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-csr.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-csr.pem new file mode 100644 index 00000000..34ed36a4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-csr.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBhDCB7gIBADBFMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEh +MB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQDIMwhVLZdKLNlPwp4VgVB8q3sJxPn8+TPDYEMmgxUuauR8 +d112OxOCzCod/OE7wWZ+DoEzGCwTPZoqLbiEnFAW5DUMaHJ8oeePEzk+pIuI6RAM +qWWcA6Co4ENelxrSNfKkKTUhWEyykzbKWucFemzedMEsnEUGRlIGi/8kOSQv5wID +AQABoAAwDQYJKoZIhvcNAQEFBQADgYEAFXqd8jhW+2hRvkRB1CCVBK5e6AQHq1rF +s3B36O64hRHIr1KC+dWr8vv1t9Rkud+7E3ELHtxWCORIYpqQ2Ddldt4PP+MTNj2C +qgwOpxM0VDxeeWml8fqx2uzfPhVduyHGm0yff2JS2KRVmnIPLTUuz/+udukIFDVO +Sc4/W3qY7f8= +-----END CERTIFICATE REQUEST----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-key.pem b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-key.pem new file mode 100644 index 00000000..af743419 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/helpers/wrong-key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDIMwhVLZdKLNlPwp4VgVB8q3sJxPn8+TPDYEMmgxUuauR8d112 +OxOCzCod/OE7wWZ+DoEzGCwTPZoqLbiEnFAW5DUMaHJ8oeePEzk+pIuI6RAMqWWc +A6Co4ENelxrSNfKkKTUhWEyykzbKWucFemzedMEsnEUGRlIGi/8kOSQv5wIDAQAB +AoGBALOzszgaG2I2jb4dmJ7/G4s8tc2YJTlhS4iFgOEx6rJmur/KuXcmIiZXMzsF +wftMZ76hMHH3saB3vEk+DxHh6bR6cW/I82Vxts9suz2fRnd2mh5JHI+opXE53LVn +hJcQ4k6LJ9MNVxlHwCTrSuJvtikDOOrCARHRvYzFRL4wXvmpAkEA+DFzXGDg8PxX +RFp6RLLbqaUT6YXNi+E5ERuumru+rgRj+OF/dxNK3d1lcIJZjqVMDAgOsZ66/bkh +GfCzJPREUwJBAM5/HeHmTEM5K5B0X8b6XEHTgWFUNTu4K36Ee5ySd8RYI8zjQ9wS +NM1nXnx12npL7DSkShz9xgnTe0f8YmQnc50CQQCgdE/RXCxwf6LnZNsBCOSsIzXh +VgiRsxSSs+PI0zGuDNaY8yfV0ponH1fSSeMeLk0gxiDBwg2/tGzq+UrHzEdTAkB1 +/U5O0K+MzbLlxIkhgdaLSlYoDdyo9e/sR7j12v8SMqaqIMWajtCa+VCU3yZqMM2T +urgaXqr03GEZ3c0+mwhFAkAwWkczV1iwuedmWLKc36iQhoj+FRMUoxWe/fBixQls +g0lDvwWiZ3M6hjCsBRckmt8eU2mUh79Odrj5fRWIwXaX +-----END RSA PRIVATE KEY----- diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mocha.opts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mocha.opts new file mode 100644 index 00000000..4a099c90 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mocha.opts @@ -0,0 +1,4 @@ +--check-leaks +--timeout 5000 +--exit + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mqtt.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mqtt.js new file mode 100644 index 00000000..f55d04a3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mqtt.js @@ -0,0 +1,230 @@ +'use strict' + +var fs = require('fs') +var path = require('path') +var mqtt = require('../') + +describe('mqtt', function () { + describe('#connect', function () { + var sslOpts, sslOpts2 + it('should return an MqttClient when connect is called with mqtt:/ url', function () { + var c = mqtt.connect('mqtt://localhost:1883') + + c.should.be.instanceOf(mqtt.MqttClient) + c.end() + }) + + it('should throw an error when called with no protocol specified', function () { + (function () { + var c = mqtt.connect('foo.bar.com') + c.end() + }).should.throw('Missing protocol') + }) + + it('should throw an error when called with no protocol specified - with options', function () { + (function () { + var c = mqtt.connect('tcp://foo.bar.com', { protocol: null }) + c.end() + }).should.throw('Missing protocol') + }) + + it('should return an MqttClient with username option set', function () { + var c = mqtt.connect('mqtt://user:pass@localhost:1883') + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('username', 'user') + c.options.should.have.property('password', 'pass') + c.end() + }) + + it('should return an MqttClient with username and password options set', function () { + var c = mqtt.connect('mqtt://user@localhost:1883') + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('username', 'user') + c.end() + }) + + it('should return an MqttClient with the clientid with random value', function () { + var c = mqtt.connect('mqtt://user@localhost:1883') + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('clientId') + c.end() + }) + + it('should return an MqttClient with the clientid with empty string', function () { + var c = mqtt.connect('mqtt://user@localhost:1883?clientId=') + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('clientId', '') + c.end() + }) + + it('should return an MqttClient with the clientid option set', function () { + var c = mqtt.connect('mqtt://user@localhost:1883?clientId=123') + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('clientId', '123') + c.end() + }) + + it('should return an MqttClient when connect is called with tcp:/ url', function () { + var c = mqtt.connect('tcp://localhost') + + c.should.be.instanceOf(mqtt.MqttClient) + c.end() + }) + + it('should return an MqttClient with correct host when called with a host and port', function () { + var c = mqtt.connect('tcp://user:pass@localhost:1883') + + c.options.should.have.property('hostname', 'localhost') + c.options.should.have.property('port', 1883) + c.end() + }) + + sslOpts = { + keyPath: path.join(__dirname, 'helpers', 'private-key.pem'), + certPath: path.join(__dirname, 'helpers', 'public-cert.pem'), + caPaths: [path.join(__dirname, 'helpers', 'public-cert.pem')] + } + + it('should return an MqttClient when connect is called with mqtts:/ url', function () { + var c = mqtt.connect('mqtts://localhost', sslOpts) + + c.options.should.have.property('protocol', 'mqtts') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + c.end() + }) + + it('should return an MqttClient when connect is called with ssl:/ url', function () { + var c = mqtt.connect('ssl://localhost', sslOpts) + + c.options.should.have.property('protocol', 'ssl') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + c.end() + }) + + it('should return an MqttClient when connect is called with ws:/ url', function () { + var c = mqtt.connect('ws://localhost', sslOpts) + + c.options.should.have.property('protocol', 'ws') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + c.end() + }) + + it('should return an MqttClient when connect is called with wss:/ url', function () { + var c = mqtt.connect('wss://localhost', sslOpts) + + c.options.should.have.property('protocol', 'wss') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + c.end() + }) + + sslOpts2 = { + key: fs.readFileSync(path.join(__dirname, 'helpers', 'private-key.pem')), + cert: fs.readFileSync(path.join(__dirname, 'helpers', 'public-cert.pem')), + ca: [fs.readFileSync(path.join(__dirname, 'helpers', 'public-cert.pem'))] + } + + it('should throw an error when it is called with cert and key set but no protocol specified', function () { + // to do rewrite wrap function + (function () { + var c = mqtt.connect(sslOpts2) + c.end() + }).should.throw('Missing secure protocol key') + }) + + it('should throw an error when it is called with cert and key set and protocol other than allowed: mqtt,mqtts,ws,wss,wxs', function () { + (function () { + sslOpts2.protocol = 'UNKNOWNPROTOCOL' + var c = mqtt.connect(sslOpts2) + c.end() + }).should.throw() + }) + + it('should return a MqttClient with mqtts set when connect is called key and cert set and protocol mqtt', function () { + sslOpts2.protocol = 'mqtt' + var c = mqtt.connect(sslOpts2) + + c.options.should.have.property('protocol', 'mqtts') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + }) + + it('should return a MqttClient with mqtts set when connect is called key and cert set and protocol mqtts', function () { + sslOpts2.protocol = 'mqtts' + var c = mqtt.connect(sslOpts2) + + c.options.should.have.property('protocol', 'mqtts') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + }) + + it('should return a MqttClient with wss set when connect is called key and cert set and protocol ws', function () { + sslOpts2.protocol = 'ws' + var c = mqtt.connect(sslOpts2) + + c.options.should.have.property('protocol', 'wss') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + }) + + it('should return a MqttClient with wss set when connect is called key and cert set and protocol wss', function () { + sslOpts2.protocol = 'wss' + var c = mqtt.connect(sslOpts2) + + c.options.should.have.property('protocol', 'wss') + + c.on('error', function () {}) + + c.should.be.instanceOf(mqtt.MqttClient) + }) + + it('should return an MqttClient with the clientid with option of clientId as empty string', function () { + var c = mqtt.connect('mqtt://localhost:1883', { + clientId: '' + }) + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('clientId', '') + }) + + it('should return an MqttClient with the clientid with option of clientId empty', function () { + var c = mqtt.connect('mqtt://localhost:1883') + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('clientId') + c.end() + }) + + it('should return an MqttClient with the clientid with option of with specific clientId', function () { + var c = mqtt.connect('mqtt://localhost:1883', { + clientId: '123' + }) + + c.should.be.instanceOf(mqtt.MqttClient) + c.options.should.have.property('clientId', '123') + c.end() + }) + }) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mqtt_store.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mqtt_store.js new file mode 100644 index 00000000..976a01af --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/mqtt_store.js @@ -0,0 +1,9 @@ +'use strict' + +var mqtt = require('../lib/connect') + +describe('store in lib/connect/index.js (webpack entry point)', function () { + it('should create store', function (done) { + done(null, new mqtt.Store()) + }) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/secure_client.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/secure_client.js new file mode 100644 index 00000000..37892486 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/secure_client.js @@ -0,0 +1,157 @@ +'use strict' + +var mqtt = require('..') +var path = require('path') +var abstractClientTests = require('./abstract_client') +var fs = require('fs') +var port = 9899 +var KEY = path.join(__dirname, 'helpers', 'tls-key.pem') +var CERT = path.join(__dirname, 'helpers', 'tls-cert.pem') +var WRONG_CERT = path.join(__dirname, 'helpers', 'wrong-cert.pem') +var Server = require('./server') + +var server = new Server.SecureServer({ + key: fs.readFileSync(KEY), + cert: fs.readFileSync(CERT) +}, function (client) { + client.on('connect', function (packet) { + if (packet.clientId === 'invalid') { + client.connack({returnCode: 2}) + } else { + server.emit('connect', client) + client.connack({returnCode: 0}) + } + }) + + client.on('publish', function (packet) { + setImmediate(function () { + /* jshint -W027 */ + /* eslint default-case:0 */ + switch (packet.qos) { + case 0: + break + case 1: + client.puback(packet) + break + case 2: + client.pubrec(packet) + break + } + /* jshint +W027 */ + }) + }) + + client.on('pubrel', function (packet) { + client.pubcomp(packet) + }) + + client.on('pubrec', function (packet) { + client.pubrel(packet) + }) + + client.on('pubcomp', function () { + // Nothing to be done + }) + + client.on('subscribe', function (packet) { + client.suback({ + messageId: packet.messageId, + granted: packet.subscriptions.map(function (e) { + return e.qos + }) + }) + }) + + client.on('unsubscribe', function (packet) { + client.unsuback(packet) + }) + + client.on('pingreq', function () { + client.pingresp() + }) +}).listen(port) + +describe('MqttSecureClient', function () { + var config = { protocol: 'mqtts', port: port, rejectUnauthorized: false } + abstractClientTests(server, config) + + describe('with secure parameters', function () { + it('should validate successfully the CA', function (done) { + var client = mqtt.connect({ + protocol: 'mqtts', + port: port, + ca: [fs.readFileSync(CERT)], + rejectUnauthorized: true + }) + + client.on('error', function (err) { + done(err) + }) + + server.once('connect', function () { + done() + }) + }) + + it('should validate successfully the CA using URI', function (done) { + var client = mqtt.connect('mqtts://localhost:' + port, { + ca: [fs.readFileSync(CERT)], + rejectUnauthorized: true + }) + + client.on('error', function (err) { + done(err) + }) + + server.once('connect', function () { + done() + }) + }) + + it('should validate successfully the CA using URI with path', function (done) { + var client = mqtt.connect('mqtts://localhost:' + port + '/', { + ca: [fs.readFileSync(CERT)], + rejectUnauthorized: true + }) + + client.on('error', function (err) { + done(err) + }) + + server.once('connect', function () { + done() + }) + }) + + it('should validate unsuccessfully the CA', function (done) { + var client = mqtt.connect({ + protocol: 'mqtts', + port: port, + ca: [fs.readFileSync(WRONG_CERT)], + rejectUnauthorized: true + }) + + client.once('error', function () { + done() + client.end() + client.on('error', function () {}) + }) + }) + + it('should emit close on TLS error', function (done) { + var client = mqtt.connect({ + protocol: 'mqtts', + port: port, + ca: [fs.readFileSync(WRONG_CERT)], + rejectUnauthorized: true + }) + + client.on('error', function () {}) + + // TODO node v0.8.x emits multiple close events + client.once('close', function () { + done() + }) + }) + }) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/server.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/server.js new file mode 100644 index 00000000..00c7ec7b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/server.js @@ -0,0 +1,65 @@ +'use strict' + +var net = require('net') +var tls = require('tls') +var inherits = require('inherits') +var Connection = require('mqtt-connection') +var MqttServer +var MqttSecureServer + +function setupConnection (duplex) { + var connection = new Connection(duplex) + this.emit('client', connection) +} + +/* + * MqttServer + * + * @param {Function} listener - fired on client connection + */ +MqttServer = module.exports = function Server (listener) { + if (!(this instanceof Server)) { + return new Server(listener) + } + + net.Server.call(this) + + this.on('connection', setupConnection) + + if (listener) { + this.on('client', listener) + } + + return this +} +inherits(MqttServer, net.Server) + +/** + * MqttSecureServer + * + * @param {Object} opts - server options + * @param {Function} listener + */ +MqttSecureServer = module.exports.SecureServer = + function SecureServer (opts, listener) { + if (!(this instanceof SecureServer)) { + return new SecureServer(opts, listener) + } + + // new MqttSecureServer(function(){}) + if (typeof opts === 'function') { + listener = opts + opts = {} + } + + tls.Server.call(this, opts) + + if (listener) { + this.on('client', listener) + } + + this.on('secureConnection', setupConnection) + + return this + } +inherits(MqttSecureServer, tls.Server) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/store.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/store.js new file mode 100644 index 00000000..1489b213 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/store.js @@ -0,0 +1,10 @@ +'use strict' + +var Store = require('../lib/store') +var abstractTest = require('../test/abstract_store') + +describe('in-memory store', function () { + abstractTest(function (done) { + done(null, new Store()) + }) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js new file mode 100644 index 00000000..0c851210 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// relative path uses package.json {"types":"types/index.d.ts", ...} +var __1 = require("../.."); +var BROKER = 'test.mosquitto.org'; +var PAYLOAD = 'hello from TS'; +var TOPIC = 'typescript-test-' + Math.random().toString(16).substr(2); +var opts = {}; +console.log("connect(" + JSON.stringify(BROKER) + ")"); +var client = __1.connect("mqtt://" + BROKER, opts); +client.subscribe((_a = {}, _a[TOPIC] = 2, _a), function (err, granted) { + granted.forEach(function (_a) { + var topic = _a.topic, qos = _a.qos; + console.log("subscribed to " + topic + " with qos=" + qos); + }); + client.publish(TOPIC, PAYLOAD, { qos: 2 }); +}).on('message', function (topic, payload) { + console.log("message from " + topic + ": " + payload); + client.end(); +}).on('connect', function (packet) { + console.log('connected!', JSON.stringify(packet)); +}); +var _a; +//# sourceMappingURL=broker-connect-subscribe-and-publish.js.map \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js.map b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js.map new file mode 100644 index 00000000..74fead43 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.js.map @@ -0,0 +1 @@ +{"version":3,"file":"broker-connect-subscribe-and-publish.js","sourceRoot":"","sources":["broker-connect-subscribe-and-publish.ts"],"names":[],"mappings":";;AAAA,oEAAoE;AACpE,2BAAqE;AACrE,IAAM,MAAM,GAAG,oBAAoB,CAAA;AAEnC,IAAM,OAAO,GAAG,eAAe,CAAA;AAC/B,IAAM,KAAK,GAAG,kBAAkB,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AACvE,IAAM,IAAI,GAAmB,EAAE,CAAA;AAE/B,OAAO,CAAC,GAAG,CAAC,aAAW,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAG,CAAC,CAAA;AACjD,IAAM,MAAM,GAAU,WAAO,CAAC,YAAU,MAAQ,EAAE,IAAI,CAAC,CAAA;AAEvD,MAAM,CAAC,SAAS,WAAE,GAAC,KAAK,IAAG,CAAC,OAAG,UAAC,GAAG,EAAE,OAAO;IACxC,OAAO,CAAC,OAAO,CAAC,UAAC,EAAY;YAAX,gBAAK,EAAE,YAAG;QACxB,OAAO,CAAC,GAAG,CAAC,mBAAiB,KAAK,kBAAa,GAAK,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,KAAa,EAAE,OAAe;IAC5C,OAAO,CAAC,GAAG,CAAC,kBAAgB,KAAK,UAAK,OAAS,CAAC,CAAA;IAChD,MAAM,CAAC,GAAG,EAAE,CAAA;AAChB,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,MAAsB;IACpC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;AACrD,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.ts new file mode 100644 index 00000000..0c53157b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/broker-connect-subscribe-and-publish.ts @@ -0,0 +1,22 @@ +// relative path uses package.json {"types":"types/index.d.ts", ...} +import {IClientOptions, Client, connect, IConnackPacket} from '../..' +const BROKER = 'test.mosquitto.org' + +const PAYLOAD = 'hello from TS' +const TOPIC = 'typescript-test-' + Math.random().toString(16).substr(2) +const opts: IClientOptions = {} + +console.log(`connect(${JSON.stringify(BROKER)})`) +const client:Client = connect(`mqtt://${BROKER}`, opts) + +client.subscribe({[TOPIC]: 2}, (err, granted) => { + granted.forEach(({topic, qos}) => { + console.log(`subscribed to ${topic} with qos=${qos}`) + }) + client.publish(TOPIC, PAYLOAD, {qos: 2}) +}).on('message', (topic: string, payload: Buffer) => { + console.log(`message from ${topic}: ${payload}`) + client.end() +}).on('connect', (packet: IConnackPacket) => { + console.log('connected!', JSON.stringify(packet)) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/tsconfig.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/tsconfig.json new file mode 100644 index 00000000..0b8d393a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/typescript/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "moduleResolution": "node", + "noEmitOnError": true, + "noImplicitAny": true, + "alwaysStrict": true, + "strictNullChecks": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "sourceMap": true + } +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/util.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/util.js new file mode 100644 index 00000000..813bbd90 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/util.js @@ -0,0 +1,13 @@ +'use strict' + +var through = require('through2') + +module.exports.testStream = function () { + return through(function (buf, enc, cb) { + var that = this + setImmediate(function () { + that.push(buf) + cb() + }) + }) +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/websocket_client.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/websocket_client.js new file mode 100644 index 00000000..08c18b14 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/test/websocket_client.js @@ -0,0 +1,144 @@ +'use strict' + +var http = require('http') +var websocket = require('websocket-stream') +var WebSocketServer = require('ws').Server +var Connection = require('mqtt-connection') +var abstractClientTests = require('./abstract_client') +var mqtt = require('../') +var xtend = require('xtend') +var assert = require('assert') +var port = 9999 +var server = http.createServer() + +function attachWebsocketServer (wsServer) { + var wss = new WebSocketServer({server: wsServer, perMessageDeflate: false}) + + wss.on('connection', function (ws) { + var stream = websocket(ws) + var connection = new Connection(stream) + + wsServer.emit('client', connection) + stream.on('error', function () {}) + connection.on('error', function () {}) + }) + + return wsServer +} + +attachWebsocketServer(server) + +server.on('client', function (client) { + client.on('connect', function (packet) { + if (packet.clientId === 'invalid') { + client.connack({ returnCode: 2 }) + } else { + server.emit('connect', client) + client.connack({returnCode: 0}) + } + }) + + client.on('publish', function (packet) { + setImmediate(function () { + switch (packet.qos) { + case 0: + break + case 1: + client.puback(packet) + break + case 2: + client.pubrec(packet) + break + } + }) + }) + + client.on('pubrel', function (packet) { + client.pubcomp(packet) + }) + + client.on('pubrec', function (packet) { + client.pubrel(packet) + }) + + client.on('pubcomp', function () { + // Nothing to be done + }) + + client.on('subscribe', function (packet) { + client.suback({ + messageId: packet.messageId, + granted: packet.subscriptions.map(function (e) { + return e.qos + }) + }) + }) + + client.on('unsubscribe', function (packet) { + client.unsuback(packet) + }) + + client.on('pingreq', function () { + client.pingresp() + }) +}).listen(port) + +describe('Websocket Client', function () { + var baseConfig = { protocol: 'ws', port: port } + + function makeOptions (custom) { + // xtend returns a new object. Does not mutate arguments + return xtend(baseConfig, custom || {}) + } + + it('should use mqtt as the protocol by default', function (done) { + server.once('client', function (client) { + client.stream.socket.protocol.should.equal('mqtt') + }) + mqtt.connect(makeOptions()).on('connect', function () { + this.end(true, done) + }) + }) + + it('should be able transform the url (for e.g. to sign it)', function (done) { + var baseUrl = 'ws://localhost:9999/mqtt' + var sig = '?AUTH=token' + var expected = baseUrl + sig + var actual + var opts = makeOptions({ + path: '/mqtt', + transformWsUrl: function (url, opt, client) { + assert.equal(url, baseUrl) + assert.strictEqual(opt, opts) + assert.strictEqual(client.options, opts) + assert.strictEqual(typeof opt.transformWsUrl, 'function') + assert(client instanceof mqtt.MqttClient) + url += sig + actual = url + return url + }}) + mqtt.connect(opts) + .on('connect', function () { + assert.equal(this.stream.socket.url, expected) + assert.equal(actual, expected) + this.end(true, done) + }) + }) + + it('should use mqttv3.1 as the protocol if using v3.1', function (done) { + server.once('client', function (client) { + client.stream.socket.protocol.should.equal('mqttv3.1') + }) + + var opts = makeOptions({ + protocolId: 'MQIsdp', + protocolVersion: 3 + }) + + mqtt.connect(opts).on('connect', function () { + this.end(true, done) + }) + }) + + abstractClientTests(server, makeOptions()) +}) diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/index.d.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/index.d.ts new file mode 100644 index 00000000..f743390f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/index.d.ts @@ -0,0 +1,27 @@ +export * from './lib/client' +export * from './lib/connect' +export * from './lib/store' +export * from './lib/client-options' +import { MqttClient } from './lib/client' +export { MqttClient as Client } +export { + QoS, + PacketCmd, + IPacket, + IConnectPacket, + IPublishPacket, + IConnackPacket, + ISubscription, + ISubscribePacket, + ISubackPacket, + IUnsubscribePacket, + IUnsubackPacket, + IPubackPacket, + IPubcompPacket, + IPubrelPacket, + IPubrecPacket, + IPingreqPacket, + IPingrespPacket, + IDisconnectPacket, + Packet +} from 'mqtt-packet' diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/client-options.d.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/client-options.d.ts new file mode 100644 index 00000000..1db9c5f5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/client-options.d.ts @@ -0,0 +1,137 @@ +import { MqttClient } from './client' +import { Store } from './store' +import { QoS } from 'mqtt-packet' + +export interface IClientOptions extends ISecureClientOptions { + port?: number // port is made into a number subsequently + host?: string // host does NOT include port + hostname?: string + path?: string + protocol?: 'wss' | 'ws' | 'mqtt' | 'mqtts' | 'tcp' | 'ssl' | 'wx' | 'wxs' + + wsOptions?: { + [x: string]: any + } + /** + * 10 seconds, set to 0 to disable + */ + keepalive?: number + /** + * 'mqttjs_' + Math.random().toString(16).substr(2, 8) + */ + clientId?: string + /** + * 'MQTT' + */ + protocolId?: string + /** + * 4 + */ + protocolVersion?: number + /** + * true, set to false to receive QoS 1 and 2 messages while offline + */ + clean?: boolean + /** + * 1000 milliseconds, interval between two reconnections + */ + reconnectPeriod?: number + /** + * 30 * 1000 milliseconds, time to wait before a CONNACK is received + */ + connectTimeout?: number + /** + * the username required by your broker, if any + */ + username?: string + /** + * the password required by your broker, if any + */ + password?: string + /** + * a Store for the incoming packets + */ + incomingStore?: Store + /** + * a Store for the outgoing packets + */ + outgoingStore?: Store + queueQoSZero?: boolean + reschedulePings?: boolean + servers?: Array<{ + host: string + port: number + protocol?: 'wss' | 'ws' | 'mqtt' | 'mqtts' | 'tcp' | 'ssl' | 'wx' | 'wxs' + }> + /** + * true, set to false to disable re-subscribe functionality + */ + resubscribe?: boolean + /** + * a message that will sent by the broker automatically when the client disconnect badly. + */ + will?: { + /** + * the topic to publish + */ + topic: string + /** + * the message to publish + */ + payload: string + /** + * the QoS + */ + qos: QoS + /** + * the retain flag + */ + retain: boolean + } + transformWsUrl?: (url: string, options: IClientOptions, client: MqttClient) => string +} +export interface ISecureClientOptions { + /** + * optional private keys in PEM format + */ + key?: string | string[] | Buffer | Buffer[] | Object[] + /** + * optional cert chains in PEM format + */ + cert?: string | string[] | Buffer | Buffer[] + /** + * Optionally override the trusted CA certificates in PEM format + */ + ca?: string | string[] | Buffer | Buffer[] + rejectUnauthorized?: boolean +} +export interface IClientPublishOptions { + /** + * the QoS + */ + qos: QoS + /** + * the retain flag + */ + retain?: boolean + /** + * whether or not mark a message as duplicate + */ + dup?: boolean +} +export interface IClientSubscribeOptions { + /** + * the QoS + */ + qos: QoS +} +export interface IClientReconnectOptions { + /** + * a Store for the incoming packets + */ + incomingStore?: Store + /** + * a Store for the outgoing packets + */ + outgoingStore?: Store +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/client.d.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/client.d.ts new file mode 100644 index 00000000..3eee6096 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/client.d.ts @@ -0,0 +1,196 @@ +/// + +import * as events from 'events' +import { + IClientOptions, + IClientPublishOptions, + IClientSubscribeOptions, + IClientReconnectOptions +} from './client-options' +import { Store } from './store' +import { Packet, QoS } from 'mqtt-packet' + +export interface ISubscriptionGrant { + /** + * is a subscribed to topic + */ + topic: string + /** + * is the granted qos level on it, may return 128 on error + */ + qos: QoS | number +} +export interface ISubscriptionRequest { + /** + * is a subscribed to topic + */ + topic: string + /** + * is the granted qos level on it + */ + qos: QoS +} +export interface ISubscriptionMap { + /** + * object which has topic names as object keys and as value the QoS, like {'test1': 0, 'test2': 1}. + */ + [topic: string]: QoS +} + +export declare type ClientSubscribeCallback = (err: Error, granted: ISubscriptionGrant[]) => void +export declare type OnMessageCallback = (topic: string, payload: Buffer, packet: Packet) => void +export declare type OnPacketCallback = (packet: Packet) => void +export declare type OnErrorCallback = (error: Error) => void +export declare type PacketCallback = (error?: Error, packet?: Packet) => any +export declare type CloseCallback = () => void + +export interface IStream extends events.EventEmitter { + pipe (to: any): any + destroy (): any + end (): any +} +/** + * MqttClient constructor + * + * @param {Stream} stream - stream + * @param {Object} [options] - connection options + * (see Connection#connect) + */ +export declare class MqttClient extends events.EventEmitter { + public connected: boolean + public disconnecting: boolean + public disconnected: boolean + public reconnecting: boolean + public incomingStore: Store + public outgoingStore: Store + public options: IClientOptions + public queueQoSZero: boolean + + constructor (streamBuilder: (client: MqttClient) => IStream, options: IClientOptions) + + public on (event: 'message', cb: OnMessageCallback): this + public on (event: 'packetsend' | 'packetreceive', cb: OnPacketCallback): this + public on (event: 'error', cb: OnErrorCallback): this + public on (event: string, cb: Function): this + + public once (event: 'message', cb: OnMessageCallback): this + public once (event: + 'packetsend' + | 'packetreceive', cb: OnPacketCallback): this + public once (event: 'error', cb: OnErrorCallback): this + public once (event: string, cb: Function): this + + /** + * publish - publish to + * + * @param {String} topic - topic to publish to + * @param {(String|Buffer)} message - message to publish + * + * @param {Object} [opts] - publish options, includes: + * @param {Number} [opts.qos] - qos level to publish on + * @param {Boolean} [opts.retain] - whether or not to retain the message + * + * @param {Function} [callback] - function(err){} + * called when publish succeeds or fails + * @returns {Client} this - for chaining + * @api public + * + * @example client.publish('topic', 'message') + * @example + * client.publish('topic', 'message', {qos: 1, retain: true}) + * @example client.publish('topic', 'message', console.log) + */ + public publish (topic: string, message: string | Buffer, + opts: IClientPublishOptions, callback?: PacketCallback): this + public publish (topic: string, message: string | Buffer, + callback?: PacketCallback): this + + /** + * subscribe - subscribe to + * + * @param {String, Array, Object} topic - topic(s) to subscribe to, supports objects in the form {'topic': qos} + * @param {Object} [opts] - optional subscription options, includes: + * @param {Number} [opts.qos] - subscribe qos level + * @param {Function} [callback] - function(err, granted){} where: + * {Error} err - subscription error (none at the moment!) + * {Array} granted - array of {topic: 't', qos: 0} + * @returns {MqttClient} this - for chaining + * @api public + * @example client.subscribe('topic') + * @example client.subscribe('topic', {qos: 1}) + * @example client.subscribe({'topic': 0, 'topic2': 1}, console.log) + * @example client.subscribe('topic', console.log) + */ + public subscribe (topic: + string + | string[], opts: IClientSubscribeOptions, callback?: ClientSubscribeCallback): this + public subscribe (topic: + string + | string[] + | ISubscriptionMap, callback?: ClientSubscribeCallback): this + + /** + * unsubscribe - unsubscribe from topic(s) + * + * @param {String, Array} topic - topics to unsubscribe from + * @param {Function} [callback] - callback fired on unsuback + * @returns {MqttClient} this - for chaining + * @api public + * @example client.unsubscribe('topic') + * @example client.unsubscribe('topic', console.log) + */ + public unsubscribe (topic: string | string[], callback?: PacketCallback): this + + /** + * end - close connection + * + * @returns {MqttClient} this - for chaining + * @param {Boolean} force - do not wait for all in-flight messages to be acked + * @param {Function} cb - called when the client has been closed + * + * @api public + */ + public end (force?: boolean, cb?: CloseCallback): this + + /** + * removeOutgoingMessage - remove a message in outgoing store + * the outgoing callback will be called withe Error('Message removed') if the message is removed + * + * @param {Number} mid - messageId to remove message + * @returns {MqttClient} this - for chaining + * @api public + * + * @example client.removeOutgoingMessage(client.getLastMessageId()); + */ + public removeOutgoingMessage (mid: number): this + + /** + * reconnect - connect again using the same options as connect() + * + * @param {Object} [opts] - optional reconnect options, includes: + * {Store} incomingStore - a store for the incoming packets + * {Store} outgoingStore - a store for the outgoing packets + * if opts is not given, current stores are used + * + * @returns {MqttClient} this - for chaining + * + * @api public + */ + public reconnect (opts?: IClientReconnectOptions): this + + /** + * Handle messages with backpressure support, one at a time. + * Override at will. + * + * @param packet packet the packet + * @param callback callback call when finished + * @api public + */ + public handleMessage (packet: Packet, callback: PacketCallback): void + + /** + * getLastMessageId + */ + public getLastMessageId (): number +} +export { IClientOptions } diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/connect/index.d.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/connect/index.d.ts new file mode 100644 index 00000000..d058373f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/connect/index.d.ts @@ -0,0 +1,10 @@ +import { IClientOptions, MqttClient } from '../client' +/** + * connect - connect to an MQTT broker. + * + * @param {String} [brokerUrl] - url of the broker, optional + * @param {Object} opts - see MqttClient#constructor + */ +declare function connect (brokerUrl?: string | any, opts?: IClientOptions): MqttClient +export { connect } +export { MqttClient } diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/store-options.d.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/store-options.d.ts new file mode 100644 index 00000000..03a175e7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/store-options.d.ts @@ -0,0 +1,6 @@ +export interface IStoreOptions { + /** + * true, clear _inflights at close + */ + clean?: boolean +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/store.d.ts b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/store.d.ts new file mode 100644 index 00000000..dd4c17f2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/mqtt/types/lib/store.d.ts @@ -0,0 +1,46 @@ +import { + IStoreOptions +} from './store-options' + +/** + * In-memory implementation of the message store + * This can actually be saved into files. + * + */ +declare class Store { + /** + * Store constructor + * + * @param {Object} [options] - store options + */ + constructor (options: IStoreOptions) + + /** + * Adds a packet to the store, a packet is + * anything that has a messageId property. + * + */ + public put (packet: any, cb?: Function): this + + /** + * Creates a stream with all the packets in the store + * + */ + public createStream (): any + + /** + * deletes a packet from the store. + */ + public del (packet: any, cb: Function): this + + /** + * get a packet from the store. + */ + public get (packet: any, cb: Function): this + + /** + * Close the store + */ + public close (cb: Function): void +} +export { Store } diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/index.js new file mode 100644 index 00000000..72297501 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/license.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/license.md new file mode 100644 index 00000000..69b61253 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/package.json new file mode 100644 index 00000000..21427ba6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/package.json @@ -0,0 +1,69 @@ +{ + "_from": "ms@^2.1.1", + "_id": "ms@2.1.1", + "_inBundle": false, + "_integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "_location": "/node-red-contrib-johnny-five/ms", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ms@^2.1.1", + "name": "ms", + "escapedName": "ms", + "rawSpec": "^2.1.1", + "saveSpec": null, + "fetchSpec": "^2.1.1" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/debug" + ], + "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "_shasum": "30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a", + "_spec": "ms@^2.1.1", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/debug", + "bugs": { + "url": "https://github.com/zeit/ms/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Tiny millisecond conversion utility", + "devDependencies": { + "eslint": "4.12.1", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/zeit/ms#readme", + "license": "MIT", + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "main": "./index", + "name": "ms", + "repository": { + "type": "git", + "url": "git+https://github.com/zeit/ms.git" + }, + "scripts": { + "lint": "eslint lib/* bin/*", + "precommit": "lint-staged", + "test": "mocha tests.js" + }, + "version": "2.1.1" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/readme.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/readme.md new file mode 100644 index 00000000..bb767293 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/ms/readme.md @@ -0,0 +1,60 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/LICENSE.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/LICENSE.md new file mode 100644 index 00000000..dddd13d5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/LICENSE.md @@ -0,0 +1,13 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2018 NAN contributors +----------------------------------- + +*NAN contributors listed at * + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/README.md new file mode 100644 index 00000000..8ccba893 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/README.md @@ -0,0 +1,456 @@ +Native Abstractions for Node.js +=============================== + +**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and 11.** + +***Current version: 2.13.2*** + +*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)* + +[![NPM](https://nodei.co/npm/nan.png?downloads=true&downloadRank=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6&height=3)](https://nodei.co/npm/nan/) + +[![Build Status](https://api.travis-ci.org/nodejs/nan.svg?branch=master)](https://travis-ci.org/nodejs/nan) +[![Build status](https://ci.appveyor.com/api/projects/status/kh73pbm9dsju7fgh)](https://ci.appveyor.com/project/RodVagg/nan) + +Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.12 to 4.0, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle. + +This project also contains some helper utilities that make addon development a bit more pleasant. + + * **[News & Updates](#news)** + * **[Usage](#usage)** + * **[Example](#example)** + * **[API](#api)** + * **[Tests](#tests)** + * **[Knowns issues](#issues)** + * **[Governance & Contributing](#governance)** + + + +## News & Updates + + + +## Usage + +Simply add **NAN** as a dependency in the *package.json* of your Node addon: + +``` bash +$ npm install --save nan +``` + +Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files: + +``` python +"include_dirs" : [ + "` when compiling your addon. + + + +## Example + +Just getting started with Nan? Take a look at the **[Node Add-on Examples](https://github.com/nodejs/node-addon-examples)**. + +Refer to a [quick-start **Nan** Boilerplate](https://github.com/fcanas/node-native-boilerplate) for a ready-to-go project that utilizes basic Nan functionality. + +For a simpler example, see the **[async pi estimation example](https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**. + +Yet another example is **[nan-example-eol](https://github.com/CodeCharmLtd/nan-example-eol)**. It shows newline detection implemented as a native addon. + +Also take a look at our comprehensive **[C++ test suite](https://github.com/nodejs/nan/tree/master/test/cpp)** which has a plethora of code snippets for your pasting pleasure. + + + +## API + +Additional to the NAN documentation below, please consult: + +* [The V8 Getting Started * Guide](https://github.com/v8/v8/wiki/Getting%20Started%20with%20Embedding) +* [The V8 Embedders * Guide](https://github.com/v8/v8/wiki/Embedder%27s%20Guide) +* [V8 API Documentation](https://v8docs.nodesource.com/) +* [Node Add-on Documentation](https://nodejs.org/api/addons.html) + + + +### JavaScript-accessible methods + +A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://github.com/v8/v8/wiki/Embedder%27s-Guide#templates) for further information. + +In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type. + +* **Method argument types** + - Nan::FunctionCallbackInfo + - Nan::PropertyCallbackInfo + - Nan::ReturnValue +* **Method declarations** + - Method declaration + - Getter declaration + - Setter declaration + - Property getter declaration + - Property setter declaration + - Property enumerator declaration + - Property deleter declaration + - Property query declaration + - Index getter declaration + - Index setter declaration + - Index enumerator declaration + - Index deleter declaration + - Index query declaration +* Method and template helpers + - Nan::SetMethod() + - Nan::SetPrototypeMethod() + - Nan::SetAccessor() + - Nan::SetNamedPropertyHandler() + - Nan::SetIndexedPropertyHandler() + - Nan::SetTemplate() + - Nan::SetPrototypeTemplate() + - Nan::SetInstanceTemplate() + - Nan::SetCallHandler() + - Nan::SetCallAsFunctionHandler() + +### Scopes + +A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works. + +A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope. + +The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these. + + - Nan::HandleScope + - Nan::EscapableHandleScope + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection). + +### Persistent references + +An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed. + +Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported. + + - Nan::PersistentBase & v8::PersistentBase + - Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits + - Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits + - Nan::Persistent + - Nan::Global + - Nan::WeakCallbackInfo + - Nan::WeakCallbackType + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles). + +### New + +NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8. + + - Nan::New() + - Nan::Undefined() + - Nan::Null() + - Nan::True() + - Nan::False() + - Nan::EmptyString() + + +### Converters + +NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN. + + - Nan::To() + +### Maybe Types + +The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_. + +* **Maybe Types** + - Nan::MaybeLocal + - Nan::Maybe + - Nan::Nothing + - Nan::Just +* **Maybe Helpers** + - Nan::Call() + - Nan::ToDetailString() + - Nan::ToArrayIndex() + - Nan::Equals() + - Nan::NewInstance() + - Nan::GetFunction() + - Nan::Set() + - Nan::DefineOwnProperty() + - Nan::ForceSet() + - Nan::Get() + - Nan::GetPropertyAttributes() + - Nan::Has() + - Nan::Delete() + - Nan::GetPropertyNames() + - Nan::GetOwnPropertyNames() + - Nan::SetPrototype() + - Nan::ObjectProtoToString() + - Nan::HasOwnProperty() + - Nan::HasRealNamedProperty() + - Nan::HasRealIndexedProperty() + - Nan::HasRealNamedCallbackProperty() + - Nan::GetRealNamedPropertyInPrototypeChain() + - Nan::GetRealNamedProperty() + - Nan::CallAsFunction() + - Nan::CallAsConstructor() + - Nan::GetSourceLine() + - Nan::GetLineNumber() + - Nan::GetStartColumn() + - Nan::GetEndColumn() + - Nan::CloneElementAt() + - Nan::HasPrivate() + - Nan::GetPrivate() + - Nan::SetPrivate() + - Nan::DeletePrivate() + - Nan::MakeMaybe() + +### Script + +NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8. + + - Nan::CompileScript() + - Nan::RunScript() + + +### JSON + +The _JSON_ object provides the c++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object. + + - Nan::JSON.Parse + - Nan::JSON.Stringify + +Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-8.11/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments. + +### Errors + +NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted. + +Note that an Error object is simply a specialized form of `v8::Value`. + +Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information. + + - Nan::Error() + - Nan::RangeError() + - Nan::ReferenceError() + - Nan::SyntaxError() + - Nan::TypeError() + - Nan::ThrowError() + - Nan::ThrowRangeError() + - Nan::ThrowReferenceError() + - Nan::ThrowSyntaxError() + - Nan::ThrowTypeError() + - Nan::FatalException() + - Nan::ErrnoException() + - Nan::TryCatch + + +### Buffers + +NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility. + + - Nan::NewBuffer() + - Nan::CopyBuffer() + - Nan::FreeCallback() + +### Nan::Callback + +`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution. + + - Nan::Callback + +### Asynchronous work helpers + +`Nan::AsyncWorker`, `Nan::AsyncProgressWorker` and `Nan::AsyncProgressQueueWorker` are helper classes that make working with asynchronous code easier. + + - Nan::AsyncWorker + - Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker + - Nan::AsyncProgressQueueWorker + - Nan::AsyncQueueWorker + +### Strings & Bytes + +Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing. + + - Nan::Encoding + - Nan::Encode() + - Nan::DecodeBytes() + - Nan::DecodeWrite() + + +### Object Wrappers + +The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects. + + - Nan::ObjectWrap + + +### V8 internals + +The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods. + + - NAN_GC_CALLBACK() + - Nan::AddGCEpilogueCallback() + - Nan::RemoveGCEpilogueCallback() + - Nan::AddGCPrologueCallback() + - Nan::RemoveGCPrologueCallback() + - Nan::GetHeapStatistics() + - Nan::SetCounterFunction() + - Nan::SetCreateHistogramFunction() + - Nan::SetAddHistogramSampleFunction() + - Nan::IdleNotification() + - Nan::LowMemoryNotification() + - Nan::ContextDisposedNotification() + - Nan::GetInternalFieldPointer() + - Nan::SetInternalFieldPointer() + - Nan::AdjustExternalMemory() + + +### Miscellaneous V8 Helpers + + - Nan::Utf8String + - Nan::GetCurrentContext() + - Nan::SetIsolateData() + - Nan::GetIsolateData() + - Nan::TypedArrayContents + + +### Miscellaneous Node Helpers + + - Nan::AsyncResource + - Nan::MakeCallback() + - NAN_MODULE_INIT() + - Nan::Export() + + + + + + +### Tests + +To run the NAN tests do: + +``` sh +npm install +npm run-script rebuild-tests +npm test +``` + +Or just: + +``` sh +npm install +make test +``` + + + +## Known issues + +### Compiling against Node.js 0.12 on OSX + +With new enough compilers available on OSX, the versions of V8 headers corresponding to Node.js 0.12 +do not compile anymore. The error looks something like: + +``` +❯ CXX(target) Release/obj.target/accessors/cpp/accessors.o +In file included from ../cpp/accessors.cpp:9: +In file included from ../../nan.h:51: +In file included from /Users/ofrobots/.node-gyp/0.12.18/include/node/node.h:61: +/Users/ofrobots/.node-gyp/0.12.18/include/node/v8.h:5800:54: error: 'CreateHandle' is a protected member of 'v8::HandleScope' + return Handle(reinterpret_cast(HandleScope::CreateHandle( + ~~~~~~~~~~~~~^~~~~~~~~~~~ +``` + +This can be worked around by patching your local versions of v8.h corresponding to Node 0.12 to make +`v8::Handle` a friend of `v8::HandleScope`. Since neither Node.js not V8 support this release line anymore +this patch cannot be released by either project in an official release. + +For this reason, we do not test against Node.js 0.12 on OSX in this project's CI. If you need to support +that configuration, you will need to either get an older compiler, or apply a source patch to the version +of V8 headers as a workaround. + + + +## Governance & Contributing + +NAN is governed by the [Node.js Addon API Working Group](https://github.com/nodejs/CTC/blob/master/WORKING_GROUPS.md#addon-api) + +### Addon API Working Group (WG) + +The NAN project is jointly governed by a Working Group which is responsible for high-level guidance of the project. + +Members of the WG are also known as Collaborators, there is no distinction between the two, unlike other Node.js projects. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project [README.md](./README.md#collaborators). + +Individuals making significant and valuable contributions are made members of the WG and given commit-access to the project. These individuals are identified by the WG and their addition to the WG is discussed via GitHub and requires unanimous consensus amongst those WG members participating in the discussion with a quorum of 50% of WG members required for acceptance of the vote. + +_Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly. + +For the current list of WG members / Collaborators, see the project [README.md](./README.md#collaborators). + +### Consensus Seeking Process + +The WG follows a [Consensus Seeking](https://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision making model. + +Modifications of the contents of the NAN repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the WG. All pull requests must be reviewed and accepted by a WG member with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing WG member, an additional WG member is required for sign-off. Consensus should be sought if additional WG members participate and there is disagreement around a particular modification. + +If a change proposal cannot reach a consensus, a WG member can call for a vote amongst the members of the WG. Simple majority wins. + + + +## Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + + + +### WG Members / Collaborators + + + + + + + + + + +
Rod VaggGitHub/rvaggTwitter/@rvagg
Benjamin ByholmGitHub/kkoopa-
Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
Brett LawsonGitHub/brett19Twitter/@brett19x
Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
David SiegelGitHub/agnatTwitter/@agnat
Michael Ira KrufkyGitHub/mkrufkyTwitter/@mkrufky
+ +## Licence & copyright + +Copyright (c) 2018 NAN WG Members / Collaborators (listed above). + +Native Abstractions for Node.js is licensed under an MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/asyncworker.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/asyncworker.md new file mode 100644 index 00000000..3963ff57 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/asyncworker.md @@ -0,0 +1,146 @@ +## Asynchronous work helpers + +`Nan::AsyncWorker`, `Nan::AsyncProgressWorker` and `Nan::AsyncProgressQueueWorker` are helper classes that make working with asynchronous code easier. + + - Nan::AsyncWorker + - Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker + - Nan::AsyncProgressQueueWorker + - Nan::AsyncQueueWorker + + +### Nan::AsyncWorker + +`Nan::AsyncWorker` is an _abstract_ class that you can subclass to have much of the annoying asynchronous queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the asynchronous work is in progress. + +This class internally handles the details of creating an [`AsyncResource`][AsyncResource], and running the callback in the +correct async context. To be able to identify the async resources created by this class in async-hooks, provide a +`resource_name` to the constructor. It is recommended that the module name be used as a prefix to the `resource_name` to avoid +collisions in the names. For more details see [`AsyncResource`][AsyncResource] documentation. The `resource_name` needs to stay valid for the lifetime of the worker instance. + +Definition: + +```c++ +class AsyncWorker { + public: + explicit AsyncWorker(Callback *callback_, const char* resource_name = "nan:AsyncWorker"); + + virtual ~AsyncWorker(); + + virtual void WorkComplete(); + + void SaveToPersistent(const char *key, const v8::Local &value); + + void SaveToPersistent(const v8::Local &key, + const v8::Local &value); + + void SaveToPersistent(uint32_t index, + const v8::Local &value); + + v8::Local GetFromPersistent(const char *key) const; + + v8::Local GetFromPersistent(const v8::Local &key) const; + + v8::Local GetFromPersistent(uint32_t index) const; + + virtual void Execute() = 0; + + uv_work_t request; + + virtual void Destroy(); + + protected: + Persistent persistentHandle; + + Callback *callback; + + virtual void HandleOKCallback(); + + virtual void HandleErrorCallback(); + + void SetErrorMessage(const char *msg); + + const char* ErrorMessage(); +}; +``` + + +### Nan::AsyncProgressWorkerBase & Nan::AsyncProgressWorker + +`Nan::AsyncProgressWorkerBase` is an _abstract_ class template that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript. + +Previously the definiton of `Nan::AsyncProgressWorker` only allowed sending `const char` data. Now extending `Nan::AsyncProgressWorker` will yield an instance of the implicit `Nan::AsyncProgressWorkerBase` template with type `` for compatibility. + +`Nan::AsyncProgressWorkerBase` & `Nan::AsyncProgressWorker` is intended for best-effort delivery of nonessential progress messages, e.g. a progress bar. The last event sent before the main thread is woken will be delivered. + +Definition: + +```c++ +template +class AsyncProgressWorkerBase : public AsyncWorker { + public: + explicit AsyncProgressWorkerBase(Callback *callback_, const char* resource_name = ...); + + virtual ~AsyncProgressWorkerBase(); + + void WorkProgress(); + + class ExecutionProgress { + public: + void Signal() const; + void Send(const T* data, size_t count) const; + }; + + virtual void Execute(const ExecutionProgress& progress) = 0; + + virtual void HandleProgressCallback(const T *data, size_t count) = 0; + + virtual void Destroy(); +}; + +typedef AsyncProgressWorkerBase AsyncProgressWorker; +``` + + +### Nan::AsyncProgressQueueWorker + +`Nan::AsyncProgressQueueWorker` is an _abstract_ class template that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript. + +`Nan::AsyncProgressQueueWorker` behaves exactly the same as `Nan::AsyncProgressWorker`, except all events are queued and delivered to the main thread. + +Definition: + +```c++ +template +class AsyncProgressQueueWorker : public AsyncWorker { + public: + explicit AsyncProgressQueueWorker(Callback *callback_, const char* resource_name = "nan:AsyncProgressQueueWorker"); + + virtual ~AsyncProgressQueueWorker(); + + void WorkProgress(); + + class ExecutionProgress { + public: + void Send(const T* data, size_t count) const; + }; + + virtual void Execute(const ExecutionProgress& progress) = 0; + + virtual void HandleProgressCallback(const T *data, size_t count) = 0; + + virtual void Destroy(); +}; +``` + + +### Nan::AsyncQueueWorker + +`Nan::AsyncQueueWorker` will run a `Nan::AsyncWorker` asynchronously via libuv. Both the `execute` and `after_work` steps are taken care of for you. Most of the logic for this is embedded in `Nan::AsyncWorker`. + +Definition: + +```c++ +void AsyncQueueWorker(AsyncWorker *); +``` + +[AsyncResource]: node_misc.md#api_nan_asyncresource diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/buffers.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/buffers.md new file mode 100644 index 00000000..8d8d25cf --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/buffers.md @@ -0,0 +1,54 @@ +## Buffers + +NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility. + + - Nan::NewBuffer() + - Nan::CopyBuffer() + - Nan::FreeCallback() + + +### Nan::NewBuffer() + +Allocate a new `node::Buffer` object with the specified size and optional data. Calls `node::Buffer::New()`. + +Note that when creating a `Buffer` using `Nan::NewBuffer()` and an existing `char*`, it is assumed that the ownership of the pointer is being transferred to the new `Buffer` for management. +When a `node::Buffer` instance is garbage collected and a `FreeCallback` has not been specified, `data` will be disposed of via a call to `free()`. +You _must not_ free the memory space manually once you have created a `Buffer` in this way. + +Signature: + +```c++ +Nan::MaybeLocal Nan::NewBuffer(uint32_t size) +Nan::MaybeLocal Nan::NewBuffer(char* data, uint32_t size) +Nan::MaybeLocal Nan::NewBuffer(char *data, + size_t length, + Nan::FreeCallback callback, + void *hint) +``` + + + +### Nan::CopyBuffer() + +Similar to [`Nan::NewBuffer()`](#api_nan_new_buffer) except that an implicit memcpy will occur within Node. Calls `node::Buffer::Copy()`. + +Management of the `char*` is left to the user, you should manually free the memory space if necessary as the new `Buffer` will have its own copy. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CopyBuffer(const char *data, uint32_t size) +``` + + + +### Nan::FreeCallback() + +A free callback that can be provided to [`Nan::NewBuffer()`](#api_nan_new_buffer). +The supplied callback will be invoked when the `Buffer` undergoes garbage collection. + +Signature: + +```c++ +typedef void (*FreeCallback)(char *data, void *hint); +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/callback.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/callback.md new file mode 100644 index 00000000..f7af0bfd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/callback.md @@ -0,0 +1,76 @@ +## Nan::Callback + +`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution. + + - Nan::Callback + + +### Nan::Callback + +```c++ +class Callback { + public: + Callback(); + + explicit Callback(const v8::Local &fn); + + ~Callback(); + + bool operator==(const Callback &other) const; + + bool operator!=(const Callback &other) const; + + v8::Local operator*() const; + + MaybeLocal operator()(AsyncResource* async_resource, + v8::Local target, + int argc = 0, + v8::Local argv[] = 0) const; + + MaybeLocal operator()(AsyncResource* async_resource, + int argc = 0, + v8::Local argv[] = 0) const; + + void SetFunction(const v8::Local &fn); + + v8::Local GetFunction() const; + + bool IsEmpty() const; + + void Reset(const v8::Local &fn); + + void Reset(); + + MaybeLocal Call(v8::Local target, + int argc, + v8::Local argv[], + AsyncResource* async_resource) const; + MaybeLocal Call(int argc, + v8::Local argv[], + AsyncResource* async_resource) const; + + // Deprecated versions. Use the versions that accept an async_resource instead + // as they run the callback in the correct async context as specified by the + // resource. If you want to call a synchronous JS function (i.e. on a + // non-empty JS stack), you can use Nan::Call instead. + v8::Local operator()(v8::Local target, + int argc = 0, + v8::Local argv[] = 0) const; + + v8::Local operator()(int argc = 0, + v8::Local argv[] = 0) const; + v8::Local Call(v8::Local target, + int argc, + v8::Local argv[]) const; + + v8::Local Call(int argc, v8::Local argv[]) const; +}; +``` + +Example usage: + +```c++ +v8::Local function; +Nan::Callback callback(function); +callback.Call(0, 0); +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/converters.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/converters.md new file mode 100644 index 00000000..d20861b5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/converters.md @@ -0,0 +1,41 @@ +## Converters + +NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN. + + - Nan::To() + + +### Nan::To() + +Converts a `v8::Local` to a different subtype of `v8::Value` or to a native data type. Returns a `Nan::MaybeLocal<>` or a `Nan::Maybe<>` accordingly. + +See [maybe_types.md](./maybe_types.md) for more information on `Nan::Maybe` types. + +Signatures: + +```c++ +// V8 types +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); +Nan::MaybeLocal Nan::To(v8::Local val); + +// Native types +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +Nan::Maybe Nan::To(v8::Local val); +``` + +### Example + +```c++ +v8::Local val; +Nan::MaybeLocal str = Nan::To(val); +Nan::Maybe d = Nan::To(val); +``` + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/errors.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/errors.md new file mode 100644 index 00000000..8127a548 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/errors.md @@ -0,0 +1,226 @@ +## Errors + +NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted. + +Note that an Error object is simply a specialized form of `v8::Value`. + +Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information. + + - Nan::Error() + - Nan::RangeError() + - Nan::ReferenceError() + - Nan::SyntaxError() + - Nan::TypeError() + - Nan::ThrowError() + - Nan::ThrowRangeError() + - Nan::ThrowReferenceError() + - Nan::ThrowSyntaxError() + - Nan::ThrowTypeError() + - Nan::FatalException() + - Nan::ErrnoException() + - Nan::TryCatch + + + +### Nan::Error() + +Create a new Error object using the [v8::Exception](https://v8docs.nodesource.com/node-8.11/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an Error object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::Error(const char *msg); +v8::Local Nan::Error(v8::Local msg); +``` + + + +### Nan::RangeError() + +Create a new RangeError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.11/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an RangeError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::RangeError(const char *msg); +v8::Local Nan::RangeError(v8::Local msg); +``` + + + +### Nan::ReferenceError() + +Create a new ReferenceError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.11/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an ReferenceError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::ReferenceError(const char *msg); +v8::Local Nan::ReferenceError(v8::Local msg); +``` + + + +### Nan::SyntaxError() + +Create a new SyntaxError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.11/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an SyntaxError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::SyntaxError(const char *msg); +v8::Local Nan::SyntaxError(v8::Local msg); +``` + + + +### Nan::TypeError() + +Create a new TypeError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.11/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8. + +Note that an TypeError object is simply a specialized form of `v8::Value`. + +Signature: + +```c++ +v8::Local Nan::TypeError(const char *msg); +v8::Local Nan::TypeError(v8::Local msg); +``` + + + +### Nan::ThrowError() + +Throw an Error object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new Error object will be created. + +Signature: + +```c++ +void Nan::ThrowError(const char *msg); +void Nan::ThrowError(v8::Local msg); +void Nan::ThrowError(v8::Local error); +``` + + + +### Nan::ThrowRangeError() + +Throw an RangeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new RangeError object will be created. + +Signature: + +```c++ +void Nan::ThrowRangeError(const char *msg); +void Nan::ThrowRangeError(v8::Local msg); +void Nan::ThrowRangeError(v8::Local error); +``` + + + +### Nan::ThrowReferenceError() + +Throw an ReferenceError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new ReferenceError object will be created. + +Signature: + +```c++ +void Nan::ThrowReferenceError(const char *msg); +void Nan::ThrowReferenceError(v8::Local msg); +void Nan::ThrowReferenceError(v8::Local error); +``` + + + +### Nan::ThrowSyntaxError() + +Throw an SyntaxError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new SyntaxError object will be created. + +Signature: + +```c++ +void Nan::ThrowSyntaxError(const char *msg); +void Nan::ThrowSyntaxError(v8::Local msg); +void Nan::ThrowSyntaxError(v8::Local error); +``` + + + +### Nan::ThrowTypeError() + +Throw an TypeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new TypeError object will be created. + +Signature: + +```c++ +void Nan::ThrowTypeError(const char *msg); +void Nan::ThrowTypeError(v8::Local msg); +void Nan::ThrowTypeError(v8::Local error); +``` + + +### Nan::FatalException() + +Replaces `node::FatalException()` which has a different API across supported versions of Node. For use with [`Nan::TryCatch`](#api_nan_try_catch). + +Signature: + +```c++ +void Nan::FatalException(const Nan::TryCatch& try_catch); +``` + + +### Nan::ErrnoException() + +Replaces `node::ErrnoException()` which has a different API across supported versions of Node. + +Signature: + +```c++ +v8::Local Nan::ErrnoException(int errorno, + const char* syscall = NULL, + const char* message = NULL, + const char* path = NULL); +``` + + + +### Nan::TryCatch + +A simple wrapper around [`v8::TryCatch`](https://v8docs.nodesource.com/node-8.11/d4/dc6/classv8_1_1_try_catch.html) compatible with all supported versions of V8. Can be used as a direct replacement in most cases. See also [`Nan::FatalException()`](#api_nan_fatal_exception) for an internal use compatible with `node::FatalException`. + +Signature: + +```c++ +class Nan::TryCatch { + public: + Nan::TryCatch(); + + bool HasCaught() const; + + bool CanContinue() const; + + v8::Local ReThrow(); + + v8::Local Exception() const; + + // Nan::MaybeLocal for older versions of V8 + v8::MaybeLocal StackTrace() const; + + v8::Local Message() const; + + void Reset(); + + void SetVerbose(bool value); + + void SetCaptureMessage(bool value); +}; +``` + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/json.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/json.md new file mode 100644 index 00000000..4fa78dba --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/json.md @@ -0,0 +1,62 @@ +## JSON + +The _JSON_ object provides the c++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object. + + - Nan::JSON.Parse + - Nan::JSON.Stringify + +Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-8.11/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments. + + + +### Nan::JSON.Parse + +A simple wrapper around [`v8::JSON::Parse`](https://v8docs.nodesource.com/node-8.11/da/d6f/classv8_1_1_j_s_o_n.html#a936310d2540fb630ed37d3ee3ffe4504). + +Definition: + +```c++ +Nan::MaybeLocal Nan::JSON::Parse(v8::Local json_string); +``` + +Use `JSON.Parse(json_string)` to parse a string into a `v8::Value`. + +Example: + +```c++ +v8::Local json_string = Nan::New("{ \"JSON\": \"object\" }").ToLocalChecked(); + +Nan::JSON NanJSON; +Nan::MaybeLocal result = NanJSON.Parse(json_string); +if (!result.IsEmpty()) { + v8::Local val = result.ToLocalChecked(); +} +``` + + + +### Nan::JSON.Stringify + +A simple wrapper around [`v8::JSON::Stringify`](https://v8docs.nodesource.com/node-8.11/da/d6f/classv8_1_1_j_s_o_n.html#a44b255c3531489ce43f6110209138860). + +Definition: + +```c++ +Nan::MaybeLocal Nan::JSON::Stringify(v8::Local json_object, v8::Local gap = v8::Local()); +``` + +Use `JSON.Stringify(value)` to stringify a `v8::Object`. + +Example: + +```c++ +// using `v8::Local val` from the `JSON::Parse` example +v8::Local obj = Nan::To(val).ToLocalChecked(); + +Nan::JSON NanJSON; +Nan::MaybeLocal result = NanJSON.Stringify(obj); +if (!result.IsEmpty()) { + v8::Local stringified = result.ToLocalChecked(); +} +``` + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/maybe_types.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/maybe_types.md new file mode 100644 index 00000000..1a9fabf7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/maybe_types.md @@ -0,0 +1,583 @@ +## Maybe Types + +The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_. + +* **Maybe Types** + - Nan::MaybeLocal + - Nan::Maybe + - Nan::Nothing + - Nan::Just +* **Maybe Helpers** + - Nan::Call() + - Nan::ToDetailString() + - Nan::ToArrayIndex() + - Nan::Equals() + - Nan::NewInstance() + - Nan::GetFunction() + - Nan::Set() + - Nan::DefineOwnProperty() + - Nan::ForceSet() + - Nan::Get() + - Nan::GetPropertyAttributes() + - Nan::Has() + - Nan::Delete() + - Nan::GetPropertyNames() + - Nan::GetOwnPropertyNames() + - Nan::SetPrototype() + - Nan::ObjectProtoToString() + - Nan::HasOwnProperty() + - Nan::HasRealNamedProperty() + - Nan::HasRealIndexedProperty() + - Nan::HasRealNamedCallbackProperty() + - Nan::GetRealNamedPropertyInPrototypeChain() + - Nan::GetRealNamedProperty() + - Nan::CallAsFunction() + - Nan::CallAsConstructor() + - Nan::GetSourceLine() + - Nan::GetLineNumber() + - Nan::GetStartColumn() + - Nan::GetEndColumn() + - Nan::CloneElementAt() + - Nan::HasPrivate() + - Nan::GetPrivate() + - Nan::SetPrivate() + - Nan::DeletePrivate() + - Nan::MakeMaybe() + + +### Nan::MaybeLocal + +A `Nan::MaybeLocal` is a wrapper around [`v8::Local`](https://v8docs.nodesource.com/node-8.11/de/deb/classv8_1_1_local.html) that enforces a check that determines whether the `v8::Local` is empty before it can be used. + +If an API method returns a `Nan::MaybeLocal`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, an empty `Nan::MaybeLocal` is returned. + +Definition: + +```c++ +template class Nan::MaybeLocal { + public: + MaybeLocal(); + + template MaybeLocal(v8::Local that); + + bool IsEmpty() const; + + template bool ToLocal(v8::Local *out); + + // Will crash if the MaybeLocal<> is empty. + v8::Local ToLocalChecked(); + + template v8::Local FromMaybe(v8::Local default_value) const; +}; +``` + +See the documentation for [`v8::MaybeLocal`](https://v8docs.nodesource.com/node-8.11/d8/d7d/classv8_1_1_maybe_local.html) for further details. + + +### Nan::Maybe + +A simple `Nan::Maybe` type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html. + +If an API method returns a `Nan::Maybe<>`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, a "Nothing" value is returned. + +Definition: + +```c++ +template class Nan::Maybe { + public: + bool IsNothing() const; + bool IsJust() const; + + // Will crash if the Maybe<> is nothing. + T FromJust(); + + T FromMaybe(const T& default_value); + + bool operator==(const Maybe &other); + + bool operator!=(const Maybe &other); +}; +``` + +See the documentation for [`v8::Maybe`](https://v8docs.nodesource.com/node-8.11/d9/d4b/classv8_1_1_maybe.html) for further details. + + +### Nan::Nothing + +Construct an empty `Nan::Maybe` type representing _nothing_. + +```c++ +template Nan::Maybe Nan::Nothing(); +``` + + +### Nan::Just + +Construct a `Nan::Maybe` type representing _just_ a value. + +```c++ +template Nan::Maybe Nan::Just(const T &t); +``` + + +### Nan::Call() + +A helper method for calling a synchronous [`v8::Function#Call()`](https://v8docs.nodesource.com/node-8.11/d5/d54/classv8_1_1_function.html#a9c3d0e4e13ddd7721fce238aa5b94a11) in a way compatible across supported versions of V8. + +For asynchronous callbacks, use Nan::Callback::Call along with an AsyncResource. + +Signature: + +```c++ +Nan::MaybeLocal Nan::Call(v8::Local fun, v8::Local recv, int argc, v8::Local argv[]); +Nan::MaybeLocal Nan::Call(const Nan::Callback& callback, v8::Local recv, + int argc, v8::Local argv[]); +Nan::MaybeLocal Nan::Call(const Nan::Callback& callback, int argc, v8::Local argv[]); +``` + + + +### Nan::ToDetailString() + +A helper method for calling [`v8::Value#ToDetailString()`](https://v8docs.nodesource.com/node-8.11/dc/d0a/classv8_1_1_value.html#a2f9770296dc2c8d274bc8cc0dca243e5) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::ToDetailString(v8::Local val); +``` + + + +### Nan::ToArrayIndex() + +A helper method for calling [`v8::Value#ToArrayIndex()`](https://v8docs.nodesource.com/node-8.11/dc/d0a/classv8_1_1_value.html#acc5bbef3c805ec458470c0fcd6f13493) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::ToArrayIndex(v8::Local val); +``` + + + +### Nan::Equals() + +A helper method for calling [`v8::Value#Equals()`](https://v8docs.nodesource.com/node-8.11/dc/d0a/classv8_1_1_value.html#a08fba1d776a59bbf6864b25f9152c64b) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Equals(v8::Local a, v8::Local(b)); +``` + + + +### Nan::NewInstance() + +A helper method for calling [`v8::Function#NewInstance()`](https://v8docs.nodesource.com/node-8.11/d5/d54/classv8_1_1_function.html#ae477558b10c14b76ed00e8dbab44ce5b) and [`v8::ObjectTemplate#NewInstance()`](https://v8docs.nodesource.com/node-8.11/db/d5f/classv8_1_1_object_template.html#ad605a7543cfbc5dab54cdb0883d14ae4) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::NewInstance(v8::Local h); +Nan::MaybeLocal Nan::NewInstance(v8::Local h, int argc, v8::Local argv[]); +Nan::MaybeLocal Nan::NewInstance(v8::Local h); +``` + + + +### Nan::GetFunction() + +A helper method for calling [`v8::FunctionTemplate#GetFunction()`](https://v8docs.nodesource.com/node-8.11/d8/d83/classv8_1_1_function_template.html#a56d904662a86eca78da37d9bb0ed3705) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetFunction(v8::Local t); +``` + + + +### Nan::Set() + +A helper method for calling [`v8::Object#Set()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a67604ea3734f170c66026064ea808f20) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Set(v8::Local obj, + v8::Local key, + v8::Local value) +Nan::Maybe Nan::Set(v8::Local obj, + uint32_t index, + v8::Local value); +``` + + + +### Nan::DefineOwnProperty() + +A helper method for calling [`v8::Object#DefineOwnProperty()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a6f76b2ed605cb8f9185b92de0033a820) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::DefineOwnProperty(v8::Local obj, + v8::Local key, + v8::Local value, + v8::PropertyAttribute attribs = v8::None); +``` + + + +### Nan::ForceSet() + +Deprecated, use Nan::DefineOwnProperty(). + +A helper method for calling [`v8::Object#ForceSet()`](https://v8docs.nodesource.com/node-0.12/db/d85/classv8_1_1_object.html#acfbdfd7427b516ebdb5c47c4df5ed96c) in a way compatible across supported versions of V8. + +Signature: + +```c++ +NAN_DEPRECATED Nan::Maybe Nan::ForceSet(v8::Local obj, + v8::Local key, + v8::Local value, + v8::PropertyAttribute attribs = v8::None); +``` + + + +### Nan::Get() + +A helper method for calling [`v8::Object#Get()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a2565f03e736694f6b1e1cf22a0b4eac2) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::Get(v8::Local obj, + v8::Local key); +Nan::MaybeLocal Nan::Get(v8::Local obj, uint32_t index); +``` + + + +### Nan::GetPropertyAttributes() + +A helper method for calling [`v8::Object#GetPropertyAttributes()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a9b898894da3d1db2714fd9325a54fe57) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetPropertyAttributes( + v8::Local obj, + v8::Local key); +``` + + + +### Nan::Has() + +A helper method for calling [`v8::Object#Has()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ab3c3d89ea7c2f9afd08965bd7299a41d) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Has(v8::Local obj, v8::Local key); +Nan::Maybe Nan::Has(v8::Local obj, uint32_t index); +``` + + + +### Nan::Delete() + +A helper method for calling [`v8::Object#Delete()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a48e4a19b2cedff867eecc73ddb7d377f) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::Delete(v8::Local obj, + v8::Local key); +Nan::Maybe Nan::Delete(v8::Local obj, uint32_t index); +``` + + + +### Nan::GetPropertyNames() + +A helper method for calling [`v8::Object#GetPropertyNames()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#aced885270cfd2c956367b5eedc7fbfe8) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetPropertyNames(v8::Local obj); +``` + + + +### Nan::GetOwnPropertyNames() + +A helper method for calling [`v8::Object#GetOwnPropertyNames()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a79a6e4d66049b9aa648ed4dfdb23e6eb) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetOwnPropertyNames(v8::Local obj); +``` + + + +### Nan::SetPrototype() + +A helper method for calling [`v8::Object#SetPrototype()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a442706b22fceda6e6d1f632122a9a9f4) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::SetPrototype(v8::Local obj, + v8::Local prototype); +``` + + + +### Nan::ObjectProtoToString() + +A helper method for calling [`v8::Object#ObjectProtoToString()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ab7a92b4dcf822bef72f6c0ac6fea1f0b) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::ObjectProtoToString(v8::Local obj); +``` + + + +### Nan::HasOwnProperty() + +A helper method for calling [`v8::Object#HasOwnProperty()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ab7b7245442ca6de1e1c145ea3fd653ff) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasOwnProperty(v8::Local obj, + v8::Local key); +``` + + + +### Nan::HasRealNamedProperty() + +A helper method for calling [`v8::Object#HasRealNamedProperty()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ad8b80a59c9eb3c1e6c3cd6c84571f767) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasRealNamedProperty(v8::Local obj, + v8::Local key); +``` + + + +### Nan::HasRealIndexedProperty() + +A helper method for calling [`v8::Object#HasRealIndexedProperty()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#af94fc1135a5e74a2193fb72c3a1b9855) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasRealIndexedProperty(v8::Local obj, + uint32_t index); +``` + + + +### Nan::HasRealNamedCallbackProperty() + +A helper method for calling [`v8::Object#HasRealNamedCallbackProperty()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#af743b7ea132b89f84d34d164d0668811) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasRealNamedCallbackProperty( + v8::Local obj, + v8::Local key); +``` + + + +### Nan::GetRealNamedPropertyInPrototypeChain() + +A helper method for calling [`v8::Object#GetRealNamedPropertyInPrototypeChain()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a8700b1862e6b4783716964ba4d5e6172) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetRealNamedPropertyInPrototypeChain( + v8::Local obj, + v8::Local key); +``` + + + +### Nan::GetRealNamedProperty() + +A helper method for calling [`v8::Object#GetRealNamedProperty()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a84471a824576a5994fdd0ffcbf99ccc0) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetRealNamedProperty(v8::Local obj, + v8::Local key); +``` + + + +### Nan::CallAsFunction() + +A helper method for calling [`v8::Object#CallAsFunction()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ad3ffc36f3dfc3592ce2a96bc047ee2cd) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CallAsFunction(v8::Local obj, + v8::Local recv, + int argc, + v8::Local argv[]); +``` + + + +### Nan::CallAsConstructor() + +A helper method for calling [`v8::Object#CallAsConstructor()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a50d571de50d0b0dfb28795619d07a01b) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CallAsConstructor(v8::Local obj, + int argc, + v8::Local argv[]); +``` + + + +### Nan::GetSourceLine() + +A helper method for calling [`v8::Message#GetSourceLine()`](https://v8docs.nodesource.com/node-8.11/d9/d28/classv8_1_1_message.html#a849f7a6c41549d83d8159825efccd23a) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetSourceLine(v8::Local msg); +``` + + + +### Nan::GetLineNumber() + +A helper method for calling [`v8::Message#GetLineNumber()`](https://v8docs.nodesource.com/node-8.11/d9/d28/classv8_1_1_message.html#adbe46c10a88a6565f2732a2d2adf99b9) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetLineNumber(v8::Local msg); +``` + + + +### Nan::GetStartColumn() + +A helper method for calling [`v8::Message#GetStartColumn()`](https://v8docs.nodesource.com/node-8.11/d9/d28/classv8_1_1_message.html#a60ede616ba3822d712e44c7a74487ba6) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetStartColumn(v8::Local msg); +``` + + + +### Nan::GetEndColumn() + +A helper method for calling [`v8::Message#GetEndColumn()`](https://v8docs.nodesource.com/node-8.11/d9/d28/classv8_1_1_message.html#aaa004cf19e529da980bc19fcb76d93be) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::GetEndColumn(v8::Local msg); +``` + + + +### Nan::CloneElementAt() + +A helper method for calling [`v8::Array#CloneElementAt()`](https://v8docs.nodesource.com/node-4.8/d3/d32/classv8_1_1_array.html#a1d3a878d4c1c7cae974dd50a1639245e) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CloneElementAt(v8::Local array, uint32_t index); +``` + + +### Nan::HasPrivate() + +A helper method for calling [`v8::Object#HasPrivate()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#af68a0b98066cfdeb8f943e98a40ba08d) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::HasPrivate(v8::Local object, v8::Local key); +``` + + +### Nan::GetPrivate() + +A helper method for calling [`v8::Object#GetPrivate()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a169f2da506acbec34deadd9149a1925a) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::GetPrivate(v8::Local object, v8::Local key); +``` + + +### Nan::SetPrivate() + +A helper method for calling [`v8::Object#SetPrivate()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ace1769b0f3b86bfe9fda1010916360ee) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::SetPrivate(v8::Local object, v8::Local key, v8::Local value); +``` + + +### Nan::DeletePrivate() + +A helper method for calling [`v8::Object#DeletePrivate()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a138bb32a304f3982be02ad499693b8fd) in a way compatible across supported versions of V8. + +Signature: + +```c++ +Nan::Maybe Nan::DeletePrivate(v8::Local object, v8::Local key); +``` + + +### Nan::MakeMaybe() + +Wraps a `v8::Local<>` in a `Nan::MaybeLocal<>`. When called with a `Nan::MaybeLocal<>` it just returns its argument. This is useful in generic template code that builds on NAN. + +Synopsis: + +```c++ + MaybeLocal someNumber = MakeMaybe(New(3.141592654)); + MaybeLocal someString = MakeMaybe(New("probably")); +``` + +Signature: + +```c++ +template class MaybeMaybe> +Nan::MaybeLocal Nan::MakeMaybe(MaybeMaybe v); +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/methods.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/methods.md new file mode 100644 index 00000000..b2b26c38 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/methods.md @@ -0,0 +1,661 @@ +## JavaScript-accessible methods + +A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://github.com/v8/v8/wiki/Embedder%27s-Guide#templates) for further information. + +In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type. + +* **Method argument types** + - Nan::FunctionCallbackInfo + - Nan::PropertyCallbackInfo + - Nan::ReturnValue +* **Method declarations** + - Method declaration + - Getter declaration + - Setter declaration + - Property getter declaration + - Property setter declaration + - Property enumerator declaration + - Property deleter declaration + - Property query declaration + - Index getter declaration + - Index setter declaration + - Index enumerator declaration + - Index deleter declaration + - Index query declaration +* Method and template helpers + - Nan::SetMethod() + - Nan::SetPrototypeMethod() + - Nan::SetAccessor() + - Nan::SetNamedPropertyHandler() + - Nan::SetIndexedPropertyHandler() + - Nan::SetTemplate() + - Nan::SetPrototypeTemplate() + - Nan::SetInstanceTemplate() + - Nan::SetCallHandler() + - Nan::SetCallAsFunctionHandler() + + +### Nan::FunctionCallbackInfo + +`Nan::FunctionCallbackInfo` should be used in place of [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/node-8.11/dd/d0d/classv8_1_1_function_callback_info.html), even with older versions of Node where `v8::FunctionCallbackInfo` does not exist. + +Definition: + +```c++ +template class FunctionCallbackInfo { + public: + ReturnValue GetReturnValue() const; + v8::Local Callee(); // NOTE: Not available in NodeJS >= 10.0.0 + v8::Local Data(); + v8::Local Holder(); + bool IsConstructCall(); + int Length() const; + v8::Local operator[](int i) const; + v8::Local This() const; + v8::Isolate *GetIsolate() const; +}; +``` + +See the [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/node-8.11/dd/d0d/classv8_1_1_function_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from methods. + +**Note:** `FunctionCallbackInfo::Callee` is removed in Node.js after `10.0.0` because it is was deprecated in V8. Consider using `info.Data()` to pass any information you need. + + +### Nan::PropertyCallbackInfo + +`Nan::PropertyCallbackInfo` should be used in place of [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/node-8.11/d7/dc5/classv8_1_1_property_callback_info.html), even with older versions of Node where `v8::PropertyCallbackInfo` does not exist. + +Definition: + +```c++ +template class PropertyCallbackInfo : public PropertyCallbackInfoBase { + public: + ReturnValue GetReturnValue() const; + v8::Isolate* GetIsolate() const; + v8::Local Data() const; + v8::Local This() const; + v8::Local Holder() const; +}; +``` + +See the [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/node-8.11/d7/dc5/classv8_1_1_property_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from property accessor methods. + + +### Nan::ReturnValue + +`Nan::ReturnValue` is used in place of [`v8::ReturnValue`](https://v8docs.nodesource.com/node-8.11/da/da7/classv8_1_1_return_value.html) on both [`Nan::FunctionCallbackInfo`](#api_nan_function_callback_info) and [`Nan::PropertyCallbackInfo`](#api_nan_property_callback_info) as the return type of `GetReturnValue()`. + +Example usage: + +```c++ +void EmptyArray(const Nan::FunctionCallbackInfo& info) { + info.GetReturnValue().Set(Nan::New()); +} +``` + +Definition: + +```c++ +template class ReturnValue { + public: + // Handle setters + template void Set(const v8::Local &handle); + template void Set(const Nan::Global &handle); + + // Fast primitive setters + void Set(bool value); + void Set(double i); + void Set(int32_t i); + void Set(uint32_t i); + + // Fast JS primitive setters + void SetNull(); + void SetUndefined(); + void SetEmptyString(); + + // Convenience getter for isolate + v8::Isolate *GetIsolate() const; +}; +``` + +See the documentation on [`v8::ReturnValue`](https://v8docs.nodesource.com/node-8.11/da/da7/classv8_1_1_return_value.html) for further information on this. + + +### Method declaration + +JavaScript-accessible methods should be declared with the following signature to form a `Nan::FunctionCallback`: + +```c++ +typedef void(*FunctionCallback)(const FunctionCallbackInfo&); +``` + +Example: + +```c++ +void MethodName(const Nan::FunctionCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a method as one is implicitly created for you. + +**Example usage** + +```c++ +// .h: +class Foo : public Nan::ObjectWrap { + ... + + static void Bar(const Nan::FunctionCallbackInfo& info); + static void Baz(const Nan::FunctionCallbackInfo& info); +} + + +// .cc: +void Foo::Bar(const Nan::FunctionCallbackInfo& info) { + ... +} + +void Foo::Baz(const Nan::FunctionCallbackInfo& info) { + ... +} +``` + +A helper macro `NAN_METHOD(methodname)` exists, compatible with NAN v1 method declarations. + +**Example usage with `NAN_METHOD(methodname)`** + +```c++ +// .h: +class Foo : public Nan::ObjectWrap { + ... + + static NAN_METHOD(Bar); + static NAN_METHOD(Baz); +} + + +// .cc: +NAN_METHOD(Foo::Bar) { + ... +} + +NAN_METHOD(Foo::Baz) { + ... +} +``` + +Use [`Nan::SetPrototypeMethod`](#api_nan_set_prototype_method) to attach a method to a JavaScript function prototype or [`Nan::SetMethod`](#api_nan_set_method) to attach a method directly on a JavaScript object. + + +### Getter declaration + +JavaScript-accessible getters should be declared with the following signature to form a `Nan::GetterCallback`: + +```c++ +typedef void(*GetterCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void GetterName(v8::Local property, + const Nan::PropertyCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a getter as one is implicitly created for you. + +A helper macro `NAN_GETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors). + + +### Setter declaration + +JavaScript-accessible setters should be declared with the following signature to form a Nan::SetterCallback: + +```c++ +typedef void(*SetterCallback)(v8::Local, + v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void SetterName(v8::Local property, + v8::Local value, + const Nan::PropertyCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a setter as one is implicitly created for you. + +A helper macro `NAN_SETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors). + + +### Property getter declaration + +JavaScript-accessible property getters should be declared with the following signature to form a Nan::PropertyGetterCallback: + +```c++ +typedef void(*PropertyGetterCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyGetterName(v8::Local property, + const Nan::PropertyCallbackInfo& info) { + ... +} +``` + +You do not need to declare a new `HandleScope` within a property getter as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_GETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property setter declaration + +JavaScript-accessible property setters should be declared with the following signature to form a Nan::PropertySetterCallback: + +```c++ +typedef void(*PropertySetterCallback)(v8::Local, + v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertySetterName(v8::Local property, + v8::Local value, + const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property setter as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_SETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property enumerator declaration + +JavaScript-accessible property enumerators should be declared with the following signature to form a Nan::PropertyEnumeratorCallback: + +```c++ +typedef void(*PropertyEnumeratorCallback)(const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyEnumeratorName(const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property enumerator as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property deleter declaration + +JavaScript-accessible property deleters should be declared with the following signature to form a Nan::PropertyDeleterCallback: + +```c++ +typedef void(*PropertyDeleterCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyDeleterName(v8::Local property, + const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property deleter as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_DELETER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Property query declaration + +JavaScript-accessible property query methods should be declared with the following signature to form a Nan::PropertyQueryCallback: + +```c++ +typedef void(*PropertyQueryCallback)(v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void PropertyQueryName(v8::Local property, + const Nan::PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a property query method as one is implicitly created for you. + +A helper macro `NAN_PROPERTY_QUERY(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index getter declaration + +JavaScript-accessible index getter methods should be declared with the following signature to form a Nan::IndexGetterCallback: + +```c++ +typedef void(*IndexGetterCallback)(uint32_t, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexGetterName(uint32_t index, const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index getter as one is implicitly created for you. + +A helper macro `NAN_INDEX_GETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index setter declaration + +JavaScript-accessible index setter methods should be declared with the following signature to form a Nan::IndexSetterCallback: + +```c++ +typedef void(*IndexSetterCallback)(uint32_t, + v8::Local, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexSetterName(uint32_t index, + v8::Local value, + const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index setter as one is implicitly created for you. + +A helper macro `NAN_INDEX_SETTER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index enumerator declaration + +JavaScript-accessible index enumerator methods should be declared with the following signature to form a Nan::IndexEnumeratorCallback: + +```c++ +typedef void(*IndexEnumeratorCallback)(const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexEnumeratorName(const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index enumerator as one is implicitly created for you. + +A helper macro `NAN_INDEX_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index deleter declaration + +JavaScript-accessible index deleter methods should be declared with the following signature to form a Nan::IndexDeleterCallback: + +```c++ +typedef void(*IndexDeleterCallback)(uint32_t, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexDeleterName(uint32_t index, const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index deleter as one is implicitly created for you. + +A helper macro `NAN_INDEX_DELETER(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Index query declaration + +JavaScript-accessible index query methods should be declared with the following signature to form a Nan::IndexQueryCallback: + +```c++ +typedef void(*IndexQueryCallback)(uint32_t, + const PropertyCallbackInfo&); +``` + +Example: + +```c++ +void IndexQueryName(uint32_t index, const PropertyCallbackInfo& info); +``` + +You do not need to declare a new `HandleScope` within a index query method as one is implicitly created for you. + +A helper macro `NAN_INDEX_QUERY(methodname)` exists, compatible with NAN v1 method declarations. + +Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors). + + +### Nan::SetMethod() + +Sets a method with a given name directly on a JavaScript object where the method has the `Nan::FunctionCallback` signature (see Method declaration). + +Signature: + +```c++ +void Nan::SetMethod(v8::Local recv, + const char *name, + Nan::FunctionCallback callback) +void Nan::SetMethod(v8::Local templ, + const char *name, + Nan::FunctionCallback callback) +``` + + +### Nan::SetPrototypeMethod() + +Sets a method with a given name on a `FunctionTemplate`'s prototype where the method has the `Nan::FunctionCallback` signature (see Method declaration). + +Signature: + +```c++ +void Nan::SetPrototypeMethod(v8::Local recv, + const char* name, + Nan::FunctionCallback callback) +``` + + +### Nan::SetAccessor() + +Sets getters and setters for a property with a given name on an `ObjectTemplate` or a plain `Object`. Accepts getters with the `Nan::GetterCallback` signature (see Getter declaration) and setters with the `Nan::SetterCallback` signature (see Setter declaration). + +Signature: + +```c++ +void SetAccessor(v8::Local tpl, + v8::Local name, + Nan::GetterCallback getter, + Nan::SetterCallback setter = 0, + v8::Local data = v8::Local(), + v8::AccessControl settings = v8::DEFAULT, + v8::PropertyAttribute attribute = v8::None, + imp::Sig signature = imp::Sig()); +bool SetAccessor(v8::Local obj, + v8::Local name, + Nan::GetterCallback getter, + Nan::SetterCallback setter = 0, + v8::Local data = v8::Local(), + v8::AccessControl settings = v8::DEFAULT, + v8::PropertyAttribute attribute = v8::None) +``` + +See the V8 [`ObjectTemplate#SetAccessor()`](https://v8docs.nodesource.com/node-8.11/db/d5f/classv8_1_1_object_template.html#aca0ed196f8a9adb1f68b1aadb6c9cd77) and [`Object#SetAccessor()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ae91b3b56b357f285288c89fbddc46d1b) for further information about how to use `Nan::SetAccessor()`. + + +### Nan::SetNamedPropertyHandler() + +Sets named property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts: + +* Property getters with the `Nan::PropertyGetterCallback` signature (see Property getter declaration) +* Property setters with the `Nan::PropertySetterCallback` signature (see Property setter declaration) +* Property query methods with the `Nan::PropertyQueryCallback` signature (see Property query declaration) +* Property deleters with the `Nan::PropertyDeleterCallback` signature (see Property deleter declaration) +* Property enumerators with the `Nan::PropertyEnumeratorCallback` signature (see Property enumerator declaration) + +Signature: + +```c++ +void SetNamedPropertyHandler(v8::Local tpl, + Nan::PropertyGetterCallback getter, + Nan::PropertySetterCallback setter = 0, + Nan::PropertyQueryCallback query = 0, + Nan::PropertyDeleterCallback deleter = 0, + Nan::PropertyEnumeratorCallback enumerator = 0, + v8::Local data = v8::Local()) +``` + +See the V8 [`ObjectTemplate#SetNamedPropertyHandler()`](https://v8docs.nodesource.com/node-8.11/db/d5f/classv8_1_1_object_template.html#a33b3ebd7de641f6cc6414b7de01fc1c7) for further information about how to use `Nan::SetNamedPropertyHandler()`. + + +### Nan::SetIndexedPropertyHandler() + +Sets indexed property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts: + +* Indexed property getters with the `Nan::IndexGetterCallback` signature (see Index getter declaration) +* Indexed property setters with the `Nan::IndexSetterCallback` signature (see Index setter declaration) +* Indexed property query methods with the `Nan::IndexQueryCallback` signature (see Index query declaration) +* Indexed property deleters with the `Nan::IndexDeleterCallback` signature (see Index deleter declaration) +* Indexed property enumerators with the `Nan::IndexEnumeratorCallback` signature (see Index enumerator declaration) + +Signature: + +```c++ +void SetIndexedPropertyHandler(v8::Local tpl, + Nan::IndexGetterCallback getter, + Nan::IndexSetterCallback setter = 0, + Nan::IndexQueryCallback query = 0, + Nan::IndexDeleterCallback deleter = 0, + Nan::IndexEnumeratorCallback enumerator = 0, + v8::Local data = v8::Local()) +``` + +See the V8 [`ObjectTemplate#SetIndexedPropertyHandler()`](https://v8docs.nodesource.com/node-8.11/db/d5f/classv8_1_1_object_template.html#ac89f06d634add0e890452033f7d17ff1) for further information about how to use `Nan::SetIndexedPropertyHandler()`. + + +### Nan::SetTemplate() + +Adds properties on an `Object`'s or `Function`'s template. + +Signature: + +```c++ +void Nan::SetTemplate(v8::Local templ, + const char *name, + v8::Local value); +void Nan::SetTemplate(v8::Local templ, + v8::Local name, + v8::Local value, + v8::PropertyAttribute attributes) +``` + +Calls the `Template`'s [`Set()`](https://v8docs.nodesource.com/node-8.11/db/df7/classv8_1_1_template.html#ae3fbaff137557aa6a0233bc7e52214ac). + + +### Nan::SetPrototypeTemplate() + +Adds properties on an `Object`'s or `Function`'s prototype template. + +Signature: + +```c++ +void Nan::SetPrototypeTemplate(v8::Local templ, + const char *name, + v8::Local value); +void Nan::SetPrototypeTemplate(v8::Local templ, + v8::Local name, + v8::Local value, + v8::PropertyAttribute attributes) +``` + +Calls the `FunctionTemplate`'s _PrototypeTemplate's_ [`Set()`](https://v8docs.nodesource.com/node-8.11/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf). + + +### Nan::SetInstanceTemplate() + +Use to add instance properties on `FunctionTemplate`'s. + +Signature: + +```c++ +void Nan::SetInstanceTemplate(v8::Local templ, + const char *name, + v8::Local value); +void Nan::SetInstanceTemplate(v8::Local templ, + v8::Local name, + v8::Local value, + v8::PropertyAttribute attributes) +``` + +Calls the `FunctionTemplate`'s _InstanceTemplate's_ [`Set()`](https://v8docs.nodesource.com/node-8.11/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf). + + +### Nan::SetCallHandler() + +Set the call-handler callback for a `v8::FunctionTemplate`. +This callback is called whenever the function created from this FunctionTemplate is called. + +Signature: + +```c++ +void Nan::SetCallHandler(v8::Local templ, Nan::FunctionCallback callback, v8::Local data = v8::Local()) +``` + +Calls the `FunctionTemplate`'s [`SetCallHandler()`](https://v8docs.nodesource.com/node-8.11/d8/d83/classv8_1_1_function_template.html#ab7574b298db3c27fbc2ed465c08ea2f8). + + +### Nan::SetCallAsFunctionHandler() + +Sets the callback to be used when calling instances created from the `v8::ObjectTemplate` as a function. +If no callback is set, instances behave like normal JavaScript objects that cannot be called as a function. + +Signature: + +```c++ +void Nan::SetCallAsFunctionHandler(v8::Local templ, Nan::FunctionCallback callback, v8::Local data = v8::Local()) +``` + +Calls the `ObjectTemplate`'s [`SetCallAsFunctionHandler()`](https://v8docs.nodesource.com/node-8.11/db/d5f/classv8_1_1_object_template.html#a5e9612fc80bf6db8f2da199b9b0bd04e). + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/new.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/new.md new file mode 100644 index 00000000..359df435 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/new.md @@ -0,0 +1,147 @@ +## New + +NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8. + + - Nan::New() + - Nan::Undefined() + - Nan::Null() + - Nan::True() + - Nan::False() + - Nan::EmptyString() + + + +### Nan::New() + +`Nan::New()` should be used to instantiate new JavaScript objects. + +Refer to the specific V8 type in the [V8 documentation](https://v8docs.nodesource.com/node-8.11/d1/d83/classv8_1_1_data.html) for information on the types of arguments required for instantiation. + +Signatures: + +Return types are mostly omitted from the signatures for simplicity. In most cases the type will be contained within a `v8::Local`. The following types will be contained within a `Nan::MaybeLocal`: `v8::String`, `v8::Date`, `v8::RegExp`, `v8::Script`, `v8::UnboundScript`. + +Empty objects: + +```c++ +Nan::New(); +``` + +Generic single and multiple-argument: + +```c++ +Nan::New(A0 arg0); +Nan::New(A0 arg0, A1 arg1); +Nan::New(A0 arg0, A1 arg1, A2 arg2); +Nan::New(A0 arg0, A1 arg1, A2 arg2, A3 arg3); +``` + +For creating `v8::FunctionTemplate` and `v8::Function` objects: + +_The definition of `Nan::FunctionCallback` can be found in the [Method declaration](./methods.md#api_nan_method) documentation._ + +```c++ +Nan::New(Nan::FunctionCallback callback, + v8::Local data = v8::Local()); +Nan::New(Nan::FunctionCallback callback, + v8::Local data = v8::Local(), + A2 a2 = A2()); +``` + +Native number types: + +```c++ +v8::Local Nan::New(bool value); +v8::Local Nan::New(int32_t value); +v8::Local Nan::New(uint32_t value); +v8::Local Nan::New(double value); +``` + +String types: + +```c++ +Nan::MaybeLocal Nan::New(std::string const& value); +Nan::MaybeLocal Nan::New(const char * value, int length); +Nan::MaybeLocal Nan::New(const char * value); +Nan::MaybeLocal Nan::New(const uint16_t * value); +Nan::MaybeLocal Nan::New(const uint16_t * value, int length); +``` + +Specialized types: + +```c++ +v8::Local Nan::New(v8::String::ExternalStringResource * value); +v8::Local Nan::New(Nan::ExternalOneByteStringResource * value); +v8::Local Nan::New(v8::Local pattern, v8::RegExp::Flags flags); +``` + +Note that `Nan::ExternalOneByteStringResource` maps to [`v8::String::ExternalOneByteStringResource`](https://v8docs.nodesource.com/node-8.11/d9/db3/classv8_1_1_string_1_1_external_one_byte_string_resource.html), and `v8::String::ExternalAsciiStringResource` in older versions of V8. + + + +### Nan::Undefined() + +A helper method to reference the `v8::Undefined` object in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::Undefined() +``` + + +### Nan::Null() + +A helper method to reference the `v8::Null` object in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::Null() +``` + + +### Nan::True() + +A helper method to reference the `v8::Boolean` object representing the `true` value in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::True() +``` + + +### Nan::False() + +A helper method to reference the `v8::Boolean` object representing the `false` value in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::False() +``` + + +### Nan::EmptyString() + +Call [`v8::String::Empty`](https://v8docs.nodesource.com/node-8.11/d2/db3/classv8_1_1_string.html#a7c1bc8886115d7ee46f1d571dd6ebc6d) to reference the empty string in a way that is compatible across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::EmptyString() +``` + + + +### Nan::NewOneByteString() + +An implementation of [`v8::String::NewFromOneByte()`](https://v8docs.nodesource.com/node-8.11/d2/db3/classv8_1_1_string.html#a5264d50b96d2c896ce525a734dc10f09) provided for consistent availability and API across supported versions of V8. Allocates a new string from Latin-1 data. + +Signature: + +```c++ +Nan::MaybeLocal Nan::NewOneByteString(const uint8_t * value, + int length = -1) +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/node_misc.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/node_misc.md new file mode 100644 index 00000000..17578e34 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/node_misc.md @@ -0,0 +1,123 @@ +## Miscellaneous Node Helpers + + - Nan::AsyncResource + - Nan::MakeCallback() + - NAN_MODULE_INIT() + - Nan::Export() + + +### Nan::AsyncResource + +This class is analogous to the `AsyncResource` JavaScript class exposed by Node's [async_hooks][] API. + +When calling back into JavaScript asynchronously, special care must be taken to ensure that the runtime can properly track +async hops. `Nan::AsyncResource` is a class that provides an RAII wrapper around `node::EmitAsyncInit`, `node::EmitAsyncDestroy`, +and `node::MakeCallback`. Using this mechanism to call back into JavaScript, as opposed to `Nan::MakeCallback` or +`v8::Function::Call` ensures that the callback is executed in the correct async context. This ensures that async mechanisms +such as domains and [async_hooks][] function correctly. + +Definition: + +```c++ +class AsyncResource { + public: + AsyncResource(v8::Local name, + v8::Local resource = New()); + AsyncResource(const char* name, + v8::Local resource = New()); + ~AsyncResource(); + + v8::MaybeLocal runInAsyncScope(v8::Local target, + v8::Local func, + int argc, + v8::Local* argv); + v8::MaybeLocal runInAsyncScope(v8::Local target, + v8::Local symbol, + int argc, + v8::Local* argv); + v8::MaybeLocal runInAsyncScope(v8::Local target, + const char* method, + int argc, + v8::Local* argv); +}; +``` + +* `name`: Identifier for the kind of resource that is being provided for diagnostics information exposed by the [async_hooks][] + API. This will be passed to the possible `init` hook as the `type`. To avoid name collisions with other modules we recommend + that the name include the name of the owning module as a prefix. For example `mysql` module could use something like + `mysql:batch-db-query-resource`. +* `resource`: An optional object associated with the async work that will be passed to the possible [async_hooks][] + `init` hook. If this parameter is omitted, or an empty handle is provided, this object will be created automatically. +* When calling JS on behalf of this resource, one can use `runInAsyncScope`. This will ensure that the callback runs in the + correct async execution context. +* `AsyncDestroy` is automatically called when an AsyncResource object is destroyed. + +For more details, see the Node [async_hooks][] documentation. You might also want to take a look at the documentation for the +[N-API counterpart][napi]. For example usage, see the `asyncresource.cpp` example in the `test/cpp` directory. + + +### Nan::MakeCallback() + +Deprecated wrappers around the legacy `node::MakeCallback()` APIs. Node.js 10+ +has deprecated these legacy APIs as they do not provide a mechanism to preserve +async context. + +We recommend that you use the `AsyncResource` class and `AsyncResource::runInAsyncScope` instead of using `Nan::MakeCallback` or +`v8::Function#Call()` directly. `AsyncResource` properly takes care of running the callback in the correct async execution +context – something that is essential for functionality like domains, async_hooks and async debugging. + +Signatures: + +```c++ +NAN_DEPRECATED +v8::Local Nan::MakeCallback(v8::Local target, + v8::Local func, + int argc, + v8::Local* argv); +NAN_DEPRECATED +v8::Local Nan::MakeCallback(v8::Local target, + v8::Local symbol, + int argc, + v8::Local* argv); +NAN_DEPRECATED +v8::Local Nan::MakeCallback(v8::Local target, + const char* method, + int argc, + v8::Local* argv); +``` + + + +### NAN_MODULE_INIT() + +Used to define the entry point function to a Node add-on. Creates a function with a given `name` that receives a `target` object representing the equivalent of the JavaScript `exports` object. + +See example below. + + +### Nan::Export() + +A simple helper to register a `v8::FunctionTemplate` from a JavaScript-accessible method (see [Methods](./methods.md)) as a property on an object. Can be used in a way similar to assigning properties to `module.exports` in JavaScript. + +Signature: + +```c++ +void Export(v8::Local target, const char *name, Nan::FunctionCallback f) +``` + +Also available as the shortcut `NAN_EXPORT` macro. + +Example: + +```c++ +NAN_METHOD(Foo) { + ... +} + +NAN_MODULE_INIT(Init) { + NAN_EXPORT(target, Foo); +} +``` + +[async_hooks]: https://nodejs.org/dist/latest-v9.x/docs/api/async_hooks.html +[napi]: https://nodejs.org/dist/latest-v9.x/docs/api/n-api.html#n_api_custom_asynchronous_operations diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/object_wrappers.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/object_wrappers.md new file mode 100644 index 00000000..08dd6b55 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/object_wrappers.md @@ -0,0 +1,263 @@ +## Object Wrappers + +The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects. + + - Nan::ObjectWrap + + + +### Nan::ObjectWrap() + +A reimplementation of `node::ObjectWrap` that adds some API not present in older versions of Node. Should be preferred over `node::ObjectWrap` in all cases for consistency. + +Definition: + +```c++ +class ObjectWrap { + public: + ObjectWrap(); + + virtual ~ObjectWrap(); + + template + static inline T* Unwrap(v8::Local handle); + + inline v8::Local handle(); + + inline Nan::Persistent& persistent(); + + protected: + inline void Wrap(v8::Local handle); + + inline void MakeWeak(); + + /* Ref() marks the object as being attached to an event loop. + * Refed objects will not be garbage collected, even if + * all references are lost. + */ + virtual void Ref(); + + /* Unref() marks an object as detached from the event loop. This is its + * default state. When an object with a "weak" reference changes from + * attached to detached state it will be freed. Be careful not to access + * the object after making this call as it might be gone! + * (A "weak reference" means an object that only has a + * persistant handle.) + * + * DO NOT CALL THIS FROM DESTRUCTOR + */ + virtual void Unref(); + + int refs_; // ro +}; +``` + +See the Node documentation on [Wrapping C++ Objects](https://nodejs.org/api/addons.html#addons_wrapping_c_objects) for more details. + +### This vs. Holder + +When calling `Unwrap`, it is important that the argument is indeed some JavaScript object which got wrapped by a `Wrap` call for this class or any derived class. +The `Signature` installed by [`Nan::SetPrototypeMethod()`](methods.md#api_nan_set_prototype_method) does ensure that `info.Holder()` is just such an instance. +In Node 0.12 and later, `info.This()` will also be of such a type, since otherwise the invocation will get rejected. +However, in Node 0.10 and before it was possible to invoke a method on a JavaScript object which just had the extension type in its prototype chain. +In such a situation, calling `Unwrap` on `info.This()` will likely lead to a failed assertion causing a crash, but could lead to even more serious corruption. + +On the other hand, calling `Unwrap` in an [accessor](methods.md#api_nan_set_accessor) should not use `Holder()` if the accessor is defined on the prototype. +So either define your accessors on the instance template, +or use `This()` after verifying that it is indeed a valid object. + +### Examples + +#### Basic + +```c++ +class MyObject : public Nan::ObjectWrap { + public: + static NAN_MODULE_INIT(Init) { + v8::Local tpl = Nan::New(New); + tpl->SetClassName(Nan::New("MyObject").ToLocalChecked()); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + Nan::SetPrototypeMethod(tpl, "getHandle", GetHandle); + Nan::SetPrototypeMethod(tpl, "getValue", GetValue); + + constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); + Nan::Set(target, Nan::New("MyObject").ToLocalChecked(), + Nan::GetFunction(tpl).ToLocalChecked()); + } + + private: + explicit MyObject(double value = 0) : value_(value) {} + ~MyObject() {} + + static NAN_METHOD(New) { + if (info.IsConstructCall()) { + double value = info[0]->IsUndefined() ? 0 : Nan::To(info[0]).FromJust(); + MyObject *obj = new MyObject(value); + obj->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); + } else { + const int argc = 1; + v8::Local argv[argc] = {info[0]}; + v8::Local cons = Nan::New(constructor()); + info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); + } + } + + static NAN_METHOD(GetHandle) { + MyObject* obj = Nan::ObjectWrap::Unwrap(info.Holder()); + info.GetReturnValue().Set(obj->handle()); + } + + static NAN_METHOD(GetValue) { + MyObject* obj = Nan::ObjectWrap::Unwrap(info.Holder()); + info.GetReturnValue().Set(obj->value_); + } + + static inline Nan::Persistent & constructor() { + static Nan::Persistent my_constructor; + return my_constructor; + } + + double value_; +}; + +NODE_MODULE(objectwrapper, MyObject::Init) +``` + +To use in Javascript: + +```Javascript +var objectwrapper = require('bindings')('objectwrapper'); + +var obj = new objectwrapper.MyObject(5); +console.log('Should be 5: ' + obj.getValue()); +``` + +#### Factory of wrapped objects + +```c++ +class MyFactoryObject : public Nan::ObjectWrap { + public: + static NAN_MODULE_INIT(Init) { + v8::Local tpl = Nan::New(New); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + Nan::SetPrototypeMethod(tpl, "getValue", GetValue); + + constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked()); + } + + static NAN_METHOD(NewInstance) { + v8::Local cons = Nan::New(constructor()); + double value = info[0]->IsNumber() ? Nan::To(info[0]).FromJust() : 0; + const int argc = 1; + v8::Local argv[1] = {Nan::New(value)}; + info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); + } + + // Needed for the next example: + inline double value() const { + return value_; + } + + private: + explicit MyFactoryObject(double value = 0) : value_(value) {} + ~MyFactoryObject() {} + + static NAN_METHOD(New) { + if (info.IsConstructCall()) { + double value = info[0]->IsNumber() ? Nan::To(info[0]).FromJust() : 0; + MyFactoryObject * obj = new MyFactoryObject(value); + obj->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); + } else { + const int argc = 1; + v8::Local argv[argc] = {info[0]}; + v8::Local cons = Nan::New(constructor()); + info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked()); + } + } + + static NAN_METHOD(GetValue) { + MyFactoryObject* obj = ObjectWrap::Unwrap(info.Holder()); + info.GetReturnValue().Set(obj->value_); + } + + static inline Nan::Persistent & constructor() { + static Nan::Persistent my_constructor; + return my_constructor; + } + + double value_; +}; + +NAN_MODULE_INIT(Init) { + MyFactoryObject::Init(target); + Nan::Set(target, + Nan::New("newFactoryObjectInstance").ToLocalChecked(), + Nan::GetFunction( + Nan::New(MyFactoryObject::NewInstance)).ToLocalChecked() + ); +} + +NODE_MODULE(wrappedobjectfactory, Init) +``` + +To use in Javascript: + +```Javascript +var wrappedobjectfactory = require('bindings')('wrappedobjectfactory'); + +var obj = wrappedobjectfactory.newFactoryObjectInstance(10); +console.log('Should be 10: ' + obj.getValue()); +``` + +#### Passing wrapped objects around + +Use the `MyFactoryObject` class above along with the following: + +```c++ +static NAN_METHOD(Sum) { + Nan::MaybeLocal maybe1 = Nan::To(info[0]); + Nan::MaybeLocal maybe2 = Nan::To(info[1]); + + // Quick check: + if (maybe1.IsEmpty() || maybe2.IsEmpty()) { + // return value is undefined by default + return; + } + + MyFactoryObject* obj1 = + Nan::ObjectWrap::Unwrap(maybe1.ToLocalChecked()); + MyFactoryObject* obj2 = + Nan::ObjectWrap::Unwrap(maybe2.ToLocalChecked()); + + info.GetReturnValue().Set(Nan::New(obj1->value() + obj2->value())); +} + +NAN_MODULE_INIT(Init) { + MyFactoryObject::Init(target); + Nan::Set(target, + Nan::New("newFactoryObjectInstance").ToLocalChecked(), + Nan::GetFunction( + Nan::New(MyFactoryObject::NewInstance)).ToLocalChecked() + ); + Nan::Set(target, + Nan::New("sum").ToLocalChecked(), + Nan::GetFunction(Nan::New(Sum)).ToLocalChecked() + ); +} + +NODE_MODULE(myaddon, Init) +``` + +To use in Javascript: + +```Javascript +var myaddon = require('bindings')('myaddon'); + +var obj1 = myaddon.newFactoryObjectInstance(5); +var obj2 = myaddon.newFactoryObjectInstance(10); +console.log('sum of object values: ' + myaddon.sum(obj1, obj2)); +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/persistent.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/persistent.md new file mode 100644 index 00000000..bec9c3f3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/persistent.md @@ -0,0 +1,296 @@ +## Persistent references + +An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed. + +Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported. + + - Nan::PersistentBase & v8::PersistentBase + - Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits + - Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits + - Nan::Persistent + - Nan::Global + - Nan::WeakCallbackInfo + - Nan::WeakCallbackType + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles). + + +### Nan::PersistentBase & v8::PersistentBase + +A persistent handle contains a reference to a storage cell in V8 which holds an object value and which is updated by the garbage collector whenever the object is moved. A new storage cell can be created using the constructor or `Nan::PersistentBase::Reset()`. Existing handles can be disposed using an argument-less `Nan::PersistentBase::Reset()`. + +Definition: + +_(note: this is implemented as `Nan::PersistentBase` for older versions of V8 and the native `v8::PersistentBase` is used for newer versions of V8)_ + +```c++ +template class PersistentBase { + public: + /** + * If non-empty, destroy the underlying storage cell + */ + void Reset(); + + /** + * If non-empty, destroy the underlying storage cell and create a new one with + * the contents of another if it is also non-empty + */ + template void Reset(const v8::Local &other); + + /** + * If non-empty, destroy the underlying storage cell and create a new one with + * the contents of another if it is also non-empty + */ + template void Reset(const PersistentBase &other); + + /** Returns true if the handle is empty. */ + bool IsEmpty() const; + + /** + * If non-empty, destroy the underlying storage cell + * IsEmpty() will return true after this call. + */ + void Empty(); + + template bool operator==(const PersistentBase &that); + + template bool operator==(const v8::Local &that); + + template bool operator!=(const PersistentBase &that); + + template bool operator!=(const v8::Local &that); + + /** + * Install a finalization callback on this object. + * NOTE: There is no guarantee as to *when* or even *if* the callback is + * invoked. The invocation is performed solely on a best effort basis. + * As always, GC-based finalization should *not* be relied upon for any + * critical form of resource management! At the moment you can either + * specify a parameter for the callback or the location of two internal + * fields in the dying object. + */ + template + void SetWeak(P *parameter, + typename WeakCallbackInfo

::Callback callback, + WeakCallbackType type); + + void ClearWeak(); + + /** + * Marks the reference to this object independent. Garbage collector is free + * to ignore any object groups containing this object. Weak callback for an + * independent handle should not assume that it will be preceded by a global + * GC prologue callback or followed by a global GC epilogue callback. + */ + void MarkIndependent() const; + + bool IsIndependent() const; + + /** Checks if the handle holds the only reference to an object. */ + bool IsNearDeath() const; + + /** Returns true if the handle's reference is weak. */ + bool IsWeak() const +}; +``` + +See the V8 documentation for [`PersistentBase`](https://v8docs.nodesource.com/node-8.11/d4/dca/classv8_1_1_persistent_base.html) for further information. + +**Tip:** To get a `v8::Local` reference to the original object back from a `PersistentBase` or `Persistent` object: + +```c++ +v8::Local object = Nan::New(persistent); +``` + + +### Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits + +Default traits for `Nan::Persistent`. This class does not allow use of the a copy constructor or assignment operator. At present `kResetInDestructor` is not set, but that will change in a future version. + +Definition: + +_(note: this is implemented as `Nan::NonCopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_ + +```c++ +template class NonCopyablePersistentTraits { + public: + typedef Persistent > NonCopyablePersistent; + + static const bool kResetInDestructor = false; + + template + static void Copy(const Persistent &source, + NonCopyablePersistent *dest); + + template static void Uncompilable(); +}; +``` + +See the V8 documentation for [`NonCopyablePersistentTraits`](https://v8docs.nodesource.com/node-8.11/de/d73/classv8_1_1_non_copyable_persistent_traits.html) for further information. + + +### Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits + +A helper class of traits to allow copying and assignment of `Persistent`. This will clone the contents of storage cell, but not any of the flags, etc.. + +Definition: + +_(note: this is implemented as `Nan::CopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_ + +```c++ +template +class CopyablePersistentTraits { + public: + typedef Persistent > CopyablePersistent; + + static const bool kResetInDestructor = true; + + template + static void Copy(const Persistent &source, + CopyablePersistent *dest); +}; +``` + +See the V8 documentation for [`CopyablePersistentTraits`](https://v8docs.nodesource.com/node-8.11/da/d5c/structv8_1_1_copyable_persistent_traits.html) for further information. + + +### Nan::Persistent + +A type of `PersistentBase` which allows copy and assignment. Copy, assignment and destructor behavior is controlled by the traits class `M`. + +Definition: + +```c++ +template > +class Persistent; + +template class Persistent : public PersistentBase { + public: + /** + * A Persistent with no storage cell. + */ + Persistent(); + + /** + * Construct a Persistent from a v8::Local. When the v8::Local is non-empty, a + * new storage cell is created pointing to the same object, and no flags are + * set. + */ + template Persistent(v8::Local that); + + /** + * Construct a Persistent from a Persistent. When the Persistent is non-empty, + * a new storage cell is created pointing to the same object, and no flags are + * set. + */ + Persistent(const Persistent &that); + + /** + * The copy constructors and assignment operator create a Persistent exactly + * as the Persistent constructor, but the Copy function from the traits class + * is called, allowing the setting of flags based on the copied Persistent. + */ + Persistent &operator=(const Persistent &that); + + template + Persistent &operator=(const Persistent &that); + + /** + * The destructor will dispose the Persistent based on the kResetInDestructor + * flags in the traits class. Since not calling dispose can result in a + * memory leak, it is recommended to always set this flag. + */ + ~Persistent(); +}; +``` + +See the V8 documentation for [`Persistent`](https://v8docs.nodesource.com/node-8.11/d2/d78/classv8_1_1_persistent.html) for further information. + + +### Nan::Global + +A type of `PersistentBase` which has move semantics. + +```c++ +template class Global : public PersistentBase { + public: + /** + * A Global with no storage cell. + */ + Global(); + + /** + * Construct a Global from a v8::Local. When the v8::Local is non-empty, a new + * storage cell is created pointing to the same object, and no flags are set. + */ + template Global(v8::Local that); + /** + * Construct a Global from a PersistentBase. When the Persistent is non-empty, + * a new storage cell is created pointing to the same object, and no flags are + * set. + */ + template Global(const PersistentBase &that); + + /** + * Pass allows returning globals from functions, etc. + */ + Global Pass(); +}; +``` + +See the V8 documentation for [`Global`](https://v8docs.nodesource.com/node-8.11/d5/d40/classv8_1_1_global.html) for further information. + + +### Nan::WeakCallbackInfo + +`Nan::WeakCallbackInfo` is used as an argument when setting a persistent reference as weak. You may need to free any external resources attached to the object. It is a mirror of `v8:WeakCallbackInfo` as found in newer versions of V8. + +Definition: + +```c++ +template class WeakCallbackInfo { + public: + typedef void (*Callback)(const WeakCallbackInfo& data); + + v8::Isolate *GetIsolate() const; + + /** + * Get the parameter that was associated with the weak handle. + */ + T *GetParameter() const; + + /** + * Get pointer from internal field, index can be 0 or 1. + */ + void *GetInternalField(int index) const; +}; +``` + +Example usage: + +```c++ +void weakCallback(const WeakCallbackInfo &data) { + int *parameter = data.GetParameter(); + delete parameter; +} + +Persistent obj; +int *data = new int(0); +obj.SetWeak(data, callback, WeakCallbackType::kParameter); +``` + +See the V8 documentation for [`WeakCallbackInfo`](https://v8docs.nodesource.com/node-8.11/d8/d06/classv8_1_1_weak_callback_info.html) for further information. + + +### Nan::WeakCallbackType + +Represents the type of a weak callback. +A weak callback of type `kParameter` makes the supplied parameter to `Nan::PersistentBase::SetWeak` available through `WeakCallbackInfo::GetParameter`. +A weak callback of type `kInternalFields` uses up to two internal fields at indices 0 and 1 on the `Nan::PersistentBase` being made weak. +Note that only `v8::Object`s and derivatives can have internal fields. + +Definition: + +```c++ +enum class WeakCallbackType { kParameter, kInternalFields }; +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/scopes.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/scopes.md new file mode 100644 index 00000000..27ab8630 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/scopes.md @@ -0,0 +1,73 @@ +## Scopes + +A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works. + +A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope. + +The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these. + + - Nan::HandleScope + - Nan::EscapableHandleScope + +Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection). + + +### Nan::HandleScope + +A simple wrapper around [`v8::HandleScope`](https://v8docs.nodesource.com/node-8.11/d3/d95/classv8_1_1_handle_scope.html). + +Definition: + +```c++ +class Nan::HandleScope { + public: + Nan::HandleScope(); + static int NumberOfHandles(); +}; +``` + +Allocate a new `Nan::HandleScope` whenever you are creating new V8 JavaScript objects. Note that an implicit `HandleScope` is created for you on JavaScript-accessible methods so you do not need to insert one yourself. + +Example: + +```c++ +// new object is created, it needs a new scope: +void Pointless() { + Nan::HandleScope scope; + v8::Local obj = Nan::New(); +} + +// JavaScript-accessible method already has a HandleScope +NAN_METHOD(Pointless2) { + v8::Local obj = Nan::New(); +} +``` + + +### Nan::EscapableHandleScope + +Similar to [`Nan::HandleScope`](#api_nan_handle_scope) but should be used in cases where a function needs to return a V8 JavaScript type that has been created within it. + +Definition: + +```c++ +class Nan::EscapableHandleScope { + public: + Nan::EscapableHandleScope(); + static int NumberOfHandles(); + template v8::Local Escape(v8::Local value); +} +``` + +Use `Escape(value)` to return the object. + +Example: + +```c++ +v8::Local EmptyObj() { + Nan::EscapableHandleScope scope; + v8::Local obj = Nan::New(); + return scope.Escape(obj); +} +``` + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/script.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/script.md new file mode 100644 index 00000000..945398f0 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/script.md @@ -0,0 +1,38 @@ +## Script + +NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8. + + - Nan::CompileScript() + - Nan::RunScript() + + + +### Nan::CompileScript() + +A wrapper around [`v8::ScriptCompiler::Compile()`](https://v8docs.nodesource.com/node-8.11/da/da5/classv8_1_1_script_compiler.html#a93f5072a0db55d881b969e9fc98e564b). + +Note that `Nan::BoundScript` is an alias for `v8::Script`. + +Signature: + +```c++ +Nan::MaybeLocal Nan::CompileScript( + v8::Local s, + const v8::ScriptOrigin& origin); +Nan::MaybeLocal Nan::CompileScript(v8::Local s); +``` + + + +### Nan::RunScript() + +Calls `script->Run()` or `script->BindToCurrentContext()->Run(Nan::GetCurrentContext())`. + +Note that `Nan::BoundScript` is an alias for `v8::Script` and `Nan::UnboundScript` is an alias for `v8::UnboundScript` where available and `v8::Script` on older versions of V8. + +Signature: + +```c++ +Nan::MaybeLocal Nan::RunScript(v8::Local script) +Nan::MaybeLocal Nan::RunScript(v8::Local script) +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/string_bytes.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/string_bytes.md new file mode 100644 index 00000000..7c1bd325 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/string_bytes.md @@ -0,0 +1,62 @@ +## Strings & Bytes + +Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing. + + - Nan::Encoding + - Nan::Encode() + - Nan::DecodeBytes() + - Nan::DecodeWrite() + + + +### Nan::Encoding + +An enum representing the supported encoding types. A copy of `node::encoding` that is consistent across versions of Node. + +Definition: + +```c++ +enum Nan::Encoding { ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER } +``` + + + +### Nan::Encode() + +A wrapper around `node::Encode()` that provides a consistent implementation across supported versions of Node. + +Signature: + +```c++ +v8::Local Nan::Encode(const void *buf, + size_t len, + enum Nan::Encoding encoding = BINARY); +``` + + + +### Nan::DecodeBytes() + +A wrapper around `node::DecodeBytes()` that provides a consistent implementation across supported versions of Node. + +Signature: + +```c++ +ssize_t Nan::DecodeBytes(v8::Local val, + enum Nan::Encoding encoding = BINARY); +``` + + + +### Nan::DecodeWrite() + +A wrapper around `node::DecodeWrite()` that provides a consistent implementation across supported versions of Node. + +Signature: + +```c++ +ssize_t Nan::DecodeWrite(char *buf, + size_t len, + v8::Local val, + enum Nan::Encoding encoding = BINARY); +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/v8_internals.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/v8_internals.md new file mode 100644 index 00000000..88bd2deb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/v8_internals.md @@ -0,0 +1,199 @@ +## V8 internals + +The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods. + + - NAN_GC_CALLBACK() + - Nan::AddGCEpilogueCallback() + - Nan::RemoveGCEpilogueCallback() + - Nan::AddGCPrologueCallback() + - Nan::RemoveGCPrologueCallback() + - Nan::GetHeapStatistics() + - Nan::SetCounterFunction() + - Nan::SetCreateHistogramFunction() + - Nan::SetAddHistogramSampleFunction() + - Nan::IdleNotification() + - Nan::LowMemoryNotification() + - Nan::ContextDisposedNotification() + - Nan::GetInternalFieldPointer() + - Nan::SetInternalFieldPointer() + - Nan::AdjustExternalMemory() + + + +### NAN_GC_CALLBACK(callbackname) + +Use `NAN_GC_CALLBACK` to declare your callbacks for `Nan::AddGCPrologueCallback()` and `Nan::AddGCEpilogueCallback()`. Your new method receives the arguments `v8::GCType type` and `v8::GCCallbackFlags flags`. + +```c++ +static Nan::Persistent callback; + +NAN_GC_CALLBACK(gcPrologueCallback) { + v8::Local argv[] = { Nan::New("prologue").ToLocalChecked() }; + Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(callback), 1, argv); +} + +NAN_METHOD(Hook) { + callback.Reset(To(args[0]).ToLocalChecked()); + Nan::AddGCPrologueCallback(gcPrologueCallback); + info.GetReturnValue().Set(info.Holder()); +} +``` + + +### Nan::AddGCEpilogueCallback() + +Signature: + +```c++ +void Nan::AddGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback, v8::GCType gc_type_filter = v8::kGCTypeAll) +``` + +Calls V8's [`AddGCEpilogueCallback()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a580f976e4290cead62c2fc4dd396be3e). + + +### Nan::RemoveGCEpilogueCallback() + +Signature: + +```c++ +void Nan::RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback) +``` + +Calls V8's [`RemoveGCEpilogueCallback()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#adca9294555a3908e9f23c7bb0f0f284c). + + +### Nan::AddGCPrologueCallback() + +Signature: + +```c++ +void Nan::AddGCPrologueCallback(v8::Isolate::GCPrologueCallback, v8::GCType gc_type_filter callback) +``` + +Calls V8's [`AddGCPrologueCallback()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a6dbef303603ebdb03da6998794ea05b8). + + +### Nan::RemoveGCPrologueCallback() + +Signature: + +```c++ +void Nan::RemoveGCPrologueCallback(v8::Isolate::GCPrologueCallback callback) +``` + +Calls V8's [`RemoveGCPrologueCallback()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a5f72c7cda21415ce062bbe5c58abe09e). + + +### Nan::GetHeapStatistics() + +Signature: + +```c++ +void Nan::GetHeapStatistics(v8::HeapStatistics *heap_statistics) +``` + +Calls V8's [`GetHeapStatistics()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a5593ac74687b713095c38987e5950b34). + + +### Nan::SetCounterFunction() + +Signature: + +```c++ +void Nan::SetCounterFunction(v8::CounterLookupCallback cb) +``` + +Calls V8's [`SetCounterFunction()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a045d7754e62fa0ec72ae6c259b29af94). + + +### Nan::SetCreateHistogramFunction() + +Signature: + +```c++ +void Nan::SetCreateHistogramFunction(v8::CreateHistogramCallback cb) +``` + +Calls V8's [`SetCreateHistogramFunction()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a542d67e85089cb3f92aadf032f99e732). + + +### Nan::SetAddHistogramSampleFunction() + +Signature: + +```c++ +void Nan::SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) +``` + +Calls V8's [`SetAddHistogramSampleFunction()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#aeb420b690bc2c216882d6fdd00ddd3ea). + + +### Nan::IdleNotification() + +Signature: + +```c++ +bool Nan::IdleNotification(int idle_time_in_ms) +``` + +Calls V8's [`IdleNotification()` or `IdleNotificationDeadline()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#ad6a2a02657f5425ad460060652a5a118) depending on V8 version. + + +### Nan::LowMemoryNotification() + +Signature: + +```c++ +void Nan::LowMemoryNotification() +``` + +Calls V8's [`LowMemoryNotification()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a24647f61d6b41f69668094bdcd6ea91f). + + +### Nan::ContextDisposedNotification() + +Signature: + +```c++ +void Nan::ContextDisposedNotification() +``` + +Calls V8's [`ContextDisposedNotification()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#ad7f5dc559866343fe6cd8db1f134d48b). + + +### Nan::GetInternalFieldPointer() + +Gets a pointer to the internal field with at `index` from a V8 `Object` handle. + +Signature: + +```c++ +void* Nan::GetInternalFieldPointer(v8::Local object, int index) +``` + +Calls the Object's [`GetAlignedPointerFromInternalField()` or `GetPointerFromInternalField()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#a580ea84afb26c005d6762eeb9e3c308f) depending on the version of V8. + + +### Nan::SetInternalFieldPointer() + +Sets the value of the internal field at `index` on a V8 `Object` handle. + +Signature: + +```c++ +void Nan::SetInternalFieldPointer(v8::Local object, int index, void* value) +``` + +Calls the Object's [`SetAlignedPointerInInternalField()` or `SetPointerInInternalField()`](https://v8docs.nodesource.com/node-8.11/db/d85/classv8_1_1_object.html#ab3c57184263cf29963ef0017bec82281) depending on the version of V8. + + +### Nan::AdjustExternalMemory() + +Signature: + +```c++ +int Nan::AdjustExternalMemory(int bytesChange) +``` + +Calls V8's [`AdjustAmountOfExternalAllocatedMemory()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#ae1a59cac60409d3922582c4af675473e). + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/v8_misc.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/v8_misc.md new file mode 100644 index 00000000..8e2db20d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/doc/v8_misc.md @@ -0,0 +1,85 @@ +## Miscellaneous V8 Helpers + + - Nan::Utf8String + - Nan::GetCurrentContext() + - Nan::SetIsolateData() + - Nan::GetIsolateData() + - Nan::TypedArrayContents + + + +### Nan::Utf8String + +Converts an object to a UTF-8-encoded character array. If conversion to a string fails (e.g. due to an exception in the toString() method of the object) then the length() method returns 0 and the * operator returns NULL. The underlying memory used for this object is managed by the object. + +An implementation of [`v8::String::Utf8Value`](https://v8docs.nodesource.com/node-8.11/d4/d1b/classv8_1_1_string_1_1_utf8_value.html) that is consistent across all supported versions of V8. + +Definition: + +```c++ +class Nan::Utf8String { + public: + Nan::Utf8String(v8::Local from); + + int length() const; + + char* operator*(); + const char* operator*() const; +}; +``` + + +### Nan::GetCurrentContext() + +A call to [`v8::Isolate::GetCurrent()->GetCurrentContext()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a81c7a1ed7001ae2a65e89107f75fd053) that works across all supported versions of V8. + +Signature: + +```c++ +v8::Local Nan::GetCurrentContext() +``` + + +### Nan::SetIsolateData() + +A helper to provide a consistent API to [`v8::Isolate#SetData()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#a7acadfe7965997e9c386a05f098fbe36). + +Signature: + +```c++ +void Nan::SetIsolateData(v8::Isolate *isolate, T *data) +``` + + + +### Nan::GetIsolateData() + +A helper to provide a consistent API to [`v8::Isolate#GetData()`](https://v8docs.nodesource.com/node-8.11/d5/dda/classv8_1_1_isolate.html#aabd223436bc1100a787dadaa024c6257). + +Signature: + +```c++ +T *Nan::GetIsolateData(v8::Isolate *isolate) +``` + + +### Nan::TypedArrayContents + +A helper class for accessing the contents of an ArrayBufferView (aka a typedarray) from C++. If the input array is not a valid typedarray, then the data pointer of TypedArrayContents will default to `NULL` and the length will be 0. If the data pointer is not compatible with the alignment requirements of type, an assertion error will fail. + +Note that you must store a reference to the `array` object while you are accessing its contents. + +Definition: + +```c++ +template +class Nan::TypedArrayContents { + public: + TypedArrayContents(v8::Local array); + + size_t length() const; + + T* const operator*(); + const T* const operator*() const; +}; +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/include_dirs.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/include_dirs.js new file mode 100644 index 00000000..4f1dfb41 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/include_dirs.js @@ -0,0 +1 @@ +console.log(require('path').relative('.', __dirname)); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan.h new file mode 100644 index 00000000..f844c61b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan.h @@ -0,0 +1,2826 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors: + * - Rod Vagg + * - Benjamin Byholm + * - Trevor Norris + * - Nathan Rajlich + * - Brett Lawson + * - Ben Noordhuis + * - David Siegel + * - Michael Ira Krufky + * + * MIT License + * + * Version 2.13.2: current Node 11.12.0, Node 12: 0.12.18, Node 10: 0.10.48, iojs: 3.3.1 + * + * See https://github.com/nodejs/nan for the latest update to this file + **********************************************************************************/ + +#ifndef NAN_H_ +#define NAN_H_ + +#include + +#define NODE_0_10_MODULE_VERSION 11 +#define NODE_0_12_MODULE_VERSION 14 +#define ATOM_0_21_MODULE_VERSION 41 +#define IOJS_1_0_MODULE_VERSION 42 +#define IOJS_1_1_MODULE_VERSION 43 +#define IOJS_2_0_MODULE_VERSION 44 +#define IOJS_3_0_MODULE_VERSION 45 +#define NODE_4_0_MODULE_VERSION 46 +#define NODE_5_0_MODULE_VERSION 47 +#define NODE_6_0_MODULE_VERSION 48 +#define NODE_7_0_MODULE_VERSION 51 +#define NODE_8_0_MODULE_VERSION 57 +#define NODE_9_0_MODULE_VERSION 59 +#define NODE_10_0_MODULE_VERSION 64 +#define NODE_11_0_MODULE_VERSION 67 + +#ifdef _MSC_VER +# define NAN_HAS_CPLUSPLUS_11 (_MSC_VER >= 1800) +#else +# define NAN_HAS_CPLUSPLUS_11 (__cplusplus >= 201103L) +#endif + +#if NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION && !NAN_HAS_CPLUSPLUS_11 +# error This version of node/NAN/v8 requires a C++11 compiler +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(_MSC_VER) +# pragma warning( push ) +# pragma warning( disable : 4530 ) +# include +# include +# include +# pragma warning( pop ) +#else +# include +# include +# include +#endif + +// uv helpers +#ifdef UV_VERSION_MAJOR +# ifndef UV_VERSION_PATCH +# define UV_VERSION_PATCH 0 +# endif +# define NAUV_UVVERSION ((UV_VERSION_MAJOR << 16) | \ + (UV_VERSION_MINOR << 8) | \ + (UV_VERSION_PATCH)) +#else +# define NAUV_UVVERSION 0x000b00 +#endif + +#if NAUV_UVVERSION < 0x000b0b +# ifdef WIN32 +# include +# else +# include +# endif +#endif + +namespace Nan { + +#define NAN_CONCAT(a, b) NAN_CONCAT_HELPER(a, b) +#define NAN_CONCAT_HELPER(a, b) a##b + +#define NAN_INLINE inline // TODO(bnoordhuis) Remove in v3.0.0. + +#if defined(__GNUC__) && \ + !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS) +# define NAN_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) && \ + !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS) +# define NAN_DEPRECATED __declspec(deprecated) +#else +# define NAN_DEPRECATED +#endif + +#if NAN_HAS_CPLUSPLUS_11 +# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete; +# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete; +# define NAN_DISALLOW_MOVE(CLASS) \ + CLASS(CLASS&&) = delete; /* NOLINT(build/c++11) */ \ + void operator=(CLASS&&) = delete; +#else +# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&); +# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&); +# define NAN_DISALLOW_MOVE(CLASS) +#endif + +#define NAN_DISALLOW_ASSIGN_COPY(CLASS) \ + NAN_DISALLOW_ASSIGN(CLASS) \ + NAN_DISALLOW_COPY(CLASS) + +#define NAN_DISALLOW_ASSIGN_MOVE(CLASS) \ + NAN_DISALLOW_ASSIGN(CLASS) \ + NAN_DISALLOW_MOVE(CLASS) + +#define NAN_DISALLOW_COPY_MOVE(CLASS) \ + NAN_DISALLOW_COPY(CLASS) \ + NAN_DISALLOW_MOVE(CLASS) + +#define NAN_DISALLOW_ASSIGN_COPY_MOVE(CLASS) \ + NAN_DISALLOW_ASSIGN(CLASS) \ + NAN_DISALLOW_COPY(CLASS) \ + NAN_DISALLOW_MOVE(CLASS) + +#define TYPE_CHECK(T, S) \ + while (false) { \ + *(static_cast(0)) = static_cast(0); \ + } + +//=== RegistrationFunction ===================================================== + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + typedef v8::Handle ADDON_REGISTER_FUNCTION_ARGS_TYPE; +#else + typedef v8::Local ADDON_REGISTER_FUNCTION_ARGS_TYPE; +#endif + +#define NAN_MODULE_INIT(name) \ + void name(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target) + +#if NODE_MAJOR_VERSION >= 10 || \ + NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3 +#define NAN_MODULE_WORKER_ENABLED(module_name, registration) \ + extern "C" NODE_MODULE_EXPORT void \ + NAN_CONCAT(node_register_module_v, NODE_MODULE_VERSION)( \ + v8::Local exports, v8::Local module, \ + v8::Local context) \ + { \ + registration(exports); \ + } +#else +#define NAN_MODULE_WORKER_ENABLED(module_name, registration) \ + NODE_MODULE(module_name, registration) +#endif + +//=== CallbackInfo ============================================================= + +#include "nan_callbacks.h" // NOLINT(build/include) + +//============================================================================== + +#if (NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION) +typedef v8::Script UnboundScript; +typedef v8::Script BoundScript; +#else +typedef v8::UnboundScript UnboundScript; +typedef v8::Script BoundScript; +#endif + +#if (NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION) +typedef v8::String::ExternalAsciiStringResource + ExternalOneByteStringResource; +#else +typedef v8::String::ExternalOneByteStringResource + ExternalOneByteStringResource; +#endif + +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) +template +class NonCopyablePersistentTraits : + public v8::NonCopyablePersistentTraits {}; +template +class CopyablePersistentTraits : + public v8::CopyablePersistentTraits {}; + +template +class PersistentBase : + public v8::PersistentBase {}; + +template > +class Persistent; +#else +template class NonCopyablePersistentTraits; +template class PersistentBase; +template class WeakCallbackData; +template > +class Persistent; +#endif // NODE_MODULE_VERSION + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +# include "nan_maybe_43_inl.h" // NOLINT(build/include) +#else +# include "nan_maybe_pre_43_inl.h" // NOLINT(build/include) +#endif + +#include "nan_converters.h" // NOLINT(build/include) +#include "nan_new.h" // NOLINT(build/include) + +#if NAUV_UVVERSION < 0x000b17 +#define NAUV_WORK_CB(func) \ + void func(uv_async_t *async, int) +#else +#define NAUV_WORK_CB(func) \ + void func(uv_async_t *async) +#endif + +#if NAUV_UVVERSION >= 0x000b0b + +typedef uv_key_t nauv_key_t; + +inline int nauv_key_create(nauv_key_t *key) { + return uv_key_create(key); +} + +inline void nauv_key_delete(nauv_key_t *key) { + uv_key_delete(key); +} + +inline void* nauv_key_get(nauv_key_t *key) { + return uv_key_get(key); +} + +inline void nauv_key_set(nauv_key_t *key, void *value) { + uv_key_set(key, value); +} + +#else + +/* Implement thread local storage for older versions of libuv. + * This is essentially a backport of libuv commit 5d2434bf + * written by Ben Noordhuis, adjusted for names and inline. + */ + +#ifndef WIN32 + +typedef pthread_key_t nauv_key_t; + +inline int nauv_key_create(nauv_key_t* key) { + return -pthread_key_create(key, NULL); +} + +inline void nauv_key_delete(nauv_key_t* key) { + if (pthread_key_delete(*key)) + abort(); +} + +inline void* nauv_key_get(nauv_key_t* key) { + return pthread_getspecific(*key); +} + +inline void nauv_key_set(nauv_key_t* key, void* value) { + if (pthread_setspecific(*key, value)) + abort(); +} + +#else + +typedef struct { + DWORD tls_index; +} nauv_key_t; + +inline int nauv_key_create(nauv_key_t* key) { + key->tls_index = TlsAlloc(); + if (key->tls_index == TLS_OUT_OF_INDEXES) + return UV_ENOMEM; + return 0; +} + +inline void nauv_key_delete(nauv_key_t* key) { + if (TlsFree(key->tls_index) == FALSE) + abort(); + key->tls_index = TLS_OUT_OF_INDEXES; +} + +inline void* nauv_key_get(nauv_key_t* key) { + void* value = TlsGetValue(key->tls_index); + if (value == NULL) + if (GetLastError() != ERROR_SUCCESS) + abort(); + return value; +} + +inline void nauv_key_set(nauv_key_t* key, void* value) { + if (TlsSetValue(key->tls_index, value) == FALSE) + abort(); +} + +#endif +#endif + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION +template +v8::Local New(v8::Handle); +#endif + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + typedef v8::WeakCallbackType WeakCallbackType; +#else +struct WeakCallbackType { + enum E {kParameter, kInternalFields}; + E type; + WeakCallbackType(E other) : type(other) {} // NOLINT(runtime/explicit) + inline bool operator==(E other) { return other == this->type; } + inline bool operator!=(E other) { return !operator==(other); } +}; +#endif + +template class WeakCallbackInfo; + +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +# include "nan_persistent_12_inl.h" // NOLINT(build/include) +#else +# include "nan_persistent_pre_12_inl.h" // NOLINT(build/include) +#endif + +namespace imp { + static const size_t kMaxLength = 0x3fffffff; + // v8::String::REPLACE_INVALID_UTF8 was introduced + // in node.js v0.10.29 and v0.8.27. +#if NODE_MAJOR_VERSION > 0 || \ + NODE_MINOR_VERSION > 10 || \ + NODE_MINOR_VERSION == 10 && NODE_PATCH_VERSION >= 29 || \ + NODE_MINOR_VERSION == 8 && NODE_PATCH_VERSION >= 27 + static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8; +#else + static const unsigned kReplaceInvalidUtf8 = 0; +#endif +} // end of namespace imp + +//=== HandleScope ============================================================== + +class HandleScope { + v8::HandleScope scope; + + public: +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + inline HandleScope() : scope(v8::Isolate::GetCurrent()) {} + inline static int NumberOfHandles() { + return v8::HandleScope::NumberOfHandles(v8::Isolate::GetCurrent()); + } +#else + inline HandleScope() : scope() {} + inline static int NumberOfHandles() { + return v8::HandleScope::NumberOfHandles(); + } +#endif + + private: + // Make it hard to create heap-allocated or illegal handle scopes by + // disallowing certain operations. + HandleScope(const HandleScope &); + void operator=(const HandleScope &); + void *operator new(size_t size); + void operator delete(void *, size_t) { + abort(); + } +}; + +class EscapableHandleScope { + public: +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + inline EscapableHandleScope() : scope(v8::Isolate::GetCurrent()) {} + + inline static int NumberOfHandles() { + return v8::EscapableHandleScope::NumberOfHandles(v8::Isolate::GetCurrent()); + } + + template + inline v8::Local Escape(v8::Local value) { + return scope.Escape(value); + } + + private: + v8::EscapableHandleScope scope; +#else + inline EscapableHandleScope() : scope() {} + + inline static int NumberOfHandles() { + return v8::HandleScope::NumberOfHandles(); + } + + template + inline v8::Local Escape(v8::Local value) { + return scope.Close(value); + } + + private: + v8::HandleScope scope; +#endif + + private: + // Make it hard to create heap-allocated or illegal handle scopes by + // disallowing certain operations. + EscapableHandleScope(const EscapableHandleScope &); + void operator=(const EscapableHandleScope &); + void *operator new(size_t size); + void operator delete(void *, size_t) { + abort(); + } +}; + +//=== TryCatch ================================================================= + +class TryCatch { + v8::TryCatch try_catch_; + friend void FatalException(const TryCatch&); + + public: +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + TryCatch() : try_catch_(v8::Isolate::GetCurrent()) {} +#endif + + inline bool HasCaught() const { return try_catch_.HasCaught(); } + + inline bool CanContinue() const { return try_catch_.CanContinue(); } + + inline v8::Local ReThrow() { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + return New(try_catch_.ReThrow()); +#else + return try_catch_.ReThrow(); +#endif + } + + inline v8::Local Exception() const { + return try_catch_.Exception(); + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + inline v8::MaybeLocal StackTrace() const { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(try_catch_.StackTrace(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); + } +#else + inline MaybeLocal StackTrace() const { + return try_catch_.StackTrace(); + } +#endif + + inline v8::Local Message() const { + return try_catch_.Message(); + } + + inline void Reset() { try_catch_.Reset(); } + + inline void SetVerbose(bool value) { try_catch_.SetVerbose(value); } + + inline void SetCaptureMessage(bool value) { + try_catch_.SetCaptureMessage(value); + } +}; + +v8::Local MakeCallback(v8::Local target, + v8::Local func, + int argc, + v8::Local* argv); +v8::Local MakeCallback(v8::Local target, + v8::Local symbol, + int argc, + v8::Local* argv); +v8::Local MakeCallback(v8::Local target, + const char* method, + int argc, + v8::Local* argv); + +// === AsyncResource =========================================================== + +class AsyncResource { + public: + AsyncResource( + v8::Local name + , v8::Local resource = New()) { +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + + if (resource.IsEmpty()) { + resource = New(); + } + + context = node::EmitAsyncInit(isolate, resource, name); +#endif + } + + AsyncResource( + const char* name + , v8::Local resource = New()) { +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + + if (resource.IsEmpty()) { + resource = New(); + } + + v8::Local name_string = + New(name).ToLocalChecked(); + context = node::EmitAsyncInit(isolate, resource, name_string); +#endif + } + + ~AsyncResource() { +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + node::EmitAsyncDestroy(isolate, context); +#endif + } + + inline MaybeLocal runInAsyncScope( + v8::Local target + , v8::Local func + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION + return MakeCallback(target, func, argc, argv); +#else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, func, argc, argv, context); +#endif + } + + inline MaybeLocal runInAsyncScope( + v8::Local target + , v8::Local symbol + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION + return MakeCallback(target, symbol, argc, argv); +#else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, symbol, argc, argv, context); +#endif + } + + inline MaybeLocal runInAsyncScope( + v8::Local target + , const char* method + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION + return MakeCallback(target, method, argc, argv); +#else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, method, argc, argv, context); +#endif + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(AsyncResource) +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + node::async_context context; +#endif +}; + +inline uv_loop_t* GetCurrentEventLoop() { +#if NODE_MAJOR_VERSION >= 10 || \ + NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3 || \ + NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION >= 10 + return node::GetCurrentEventLoop(v8::Isolate::GetCurrent()); +#else + return uv_default_loop(); +#endif +} + +//============ ================================================================= + +/* node 0.12 */ +#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION + inline + void SetCounterFunction(v8::CounterLookupCallback cb) { + v8::Isolate::GetCurrent()->SetCounterFunction(cb); + } + + inline + void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) { + v8::Isolate::GetCurrent()->SetCreateHistogramFunction(cb); + } + + inline + void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) { + v8::Isolate::GetCurrent()->SetAddHistogramSampleFunction(cb); + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + inline bool IdleNotification(int idle_time_in_ms) { + return v8::Isolate::GetCurrent()->IdleNotificationDeadline( + idle_time_in_ms * 0.001); + } +# else + inline bool IdleNotification(int idle_time_in_ms) { + return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms); + } +#endif + + inline void LowMemoryNotification() { + v8::Isolate::GetCurrent()->LowMemoryNotification(); + } + + inline void ContextDisposedNotification() { + v8::Isolate::GetCurrent()->ContextDisposedNotification(); + } +#else + inline + void SetCounterFunction(v8::CounterLookupCallback cb) { + v8::V8::SetCounterFunction(cb); + } + + inline + void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) { + v8::V8::SetCreateHistogramFunction(cb); + } + + inline + void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) { + v8::V8::SetAddHistogramSampleFunction(cb); + } + + inline bool IdleNotification(int idle_time_in_ms) { + return v8::V8::IdleNotification(idle_time_in_ms); + } + + inline void LowMemoryNotification() { + v8::V8::LowMemoryNotification(); + } + + inline void ContextDisposedNotification() { + v8::V8::ContextDisposedNotification(); + } +#endif + +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) // Node 0.12 + inline v8::Local Undefined() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::Undefined(v8::Isolate::GetCurrent()))); +# else + return v8::Undefined(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local Null() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::Null(v8::Isolate::GetCurrent()))); +# else + return v8::Null(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local True() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::True(v8::Isolate::GetCurrent()))); +# else + return v8::True(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local False() { +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(v8::False(v8::Isolate::GetCurrent()))); +# else + return v8::False(v8::Isolate::GetCurrent()); +# endif + } + + inline v8::Local EmptyString() { + return v8::String::Empty(v8::Isolate::GetCurrent()); + } + + inline int AdjustExternalMemory(int bc) { + return static_cast( + v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(bc)); + } + + inline void SetTemplate( + v8::Local templ + , const char *name + , v8::Local value) { + templ->Set(v8::Isolate::GetCurrent(), name, value); + } + + inline void SetTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes) { + templ->Set(name, value, attributes); + } + + inline v8::Local GetCurrentContext() { + return v8::Isolate::GetCurrent()->GetCurrentContext(); + } + + inline void* GetInternalFieldPointer( + v8::Local object + , int index) { + return object->GetAlignedPointerFromInternalField(index); + } + + inline void SetInternalFieldPointer( + v8::Local object + , int index + , void* value) { + object->SetAlignedPointerInInternalField(index, value); + } + +# define NAN_GC_CALLBACK(name) \ + void name(v8::Isolate *isolate, v8::GCType type, v8::GCCallbackFlags flags) + +#if NODE_MODULE_VERSION <= NODE_4_0_MODULE_VERSION + typedef v8::Isolate::GCEpilogueCallback GCEpilogueCallback; + typedef v8::Isolate::GCPrologueCallback GCPrologueCallback; +#else + typedef v8::Isolate::GCCallback GCEpilogueCallback; + typedef v8::Isolate::GCCallback GCPrologueCallback; +#endif + + inline void AddGCEpilogueCallback( + GCEpilogueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::Isolate::GetCurrent()->AddGCEpilogueCallback(callback, gc_type_filter); + } + + inline void RemoveGCEpilogueCallback( + GCEpilogueCallback callback) { + v8::Isolate::GetCurrent()->RemoveGCEpilogueCallback(callback); + } + + inline void AddGCPrologueCallback( + GCPrologueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::Isolate::GetCurrent()->AddGCPrologueCallback(callback, gc_type_filter); + } + + inline void RemoveGCPrologueCallback( + GCPrologueCallback callback) { + v8::Isolate::GetCurrent()->RemoveGCPrologueCallback(callback); + } + + inline void GetHeapStatistics( + v8::HeapStatistics *heap_statistics) { + v8::Isolate::GetCurrent()->GetHeapStatistics(heap_statistics); + } + +# define X(NAME) \ + inline v8::Local NAME(const char *msg) { \ + EscapableHandleScope scope; \ + return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline \ + v8::Local NAME(v8::Local msg) { \ + return v8::Exception::NAME(msg); \ + } \ + \ + inline void Throw ## NAME(const char *msg) { \ + HandleScope scope; \ + v8::Isolate::GetCurrent()->ThrowException( \ + v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline void Throw ## NAME(v8::Local msg) { \ + HandleScope scope; \ + v8::Isolate::GetCurrent()->ThrowException( \ + v8::Exception::NAME(msg)); \ + } + + X(Error) + X(RangeError) + X(ReferenceError) + X(SyntaxError) + X(TypeError) + +# undef X + + inline void ThrowError(v8::Local error) { + v8::Isolate::GetCurrent()->ThrowException(error); + } + + inline MaybeLocal NewBuffer( + char *data + , size_t length +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + , node::Buffer::FreeCallback callback +#else + , node::smalloc::FreeCallback callback +#endif + , void *hint + ) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(length <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::New( + v8::Isolate::GetCurrent(), data, length, callback, hint); +#else + return node::Buffer::New(v8::Isolate::GetCurrent(), data, length, callback, + hint); +#endif + } + + inline MaybeLocal CopyBuffer( + const char *data + , uint32_t size + ) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::Copy( + v8::Isolate::GetCurrent(), data, size); +#else + return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); +#endif + } + + inline MaybeLocal NewBuffer(uint32_t size) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::New( + v8::Isolate::GetCurrent(), size); +#else + return node::Buffer::New(v8::Isolate::GetCurrent(), size); +#endif + } + + inline MaybeLocal NewBuffer( + char* data + , uint32_t size + ) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION + return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); +#else + return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size); +#endif + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + inline MaybeLocal + NewOneByteString(const uint8_t * value, int length = -1) { + return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value, + v8::NewStringType::kNormal, length); + } + + inline MaybeLocal CompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source source(s, origin); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source) + .FromMaybe(v8::Local())); + } + + inline MaybeLocal CompileScript( + v8::Local s + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source source(s); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source) + .FromMaybe(v8::Local())); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(script->BindToCurrentContext() + ->Run(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(script->Run(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); + } +#else + inline MaybeLocal + NewOneByteString(const uint8_t * value, int length = -1) { + return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value, + v8::String::kNormalString, length); + } + + inline MaybeLocal CompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + v8::ScriptCompiler::Source source(s, origin); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); + } + + inline MaybeLocal CompileScript( + v8::Local s + ) { + v8::ScriptCompiler::Source source(s); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + EscapableHandleScope scope; + return scope.Escape(script->BindToCurrentContext()->Run()); + } + + inline MaybeLocal RunScript( + v8::Local script + ) { + return script->Run(); + } +#endif + + NAN_DEPRECATED inline v8::Local MakeCallback( + v8::Local target + , v8::Local func + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(node::MakeCallback( + v8::Isolate::GetCurrent(), target, func, argc, argv))); +#else +# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + AsyncResource res("nan:makeCallback"); + return res.runInAsyncScope(target, func, argc, argv) + .FromMaybe(v8::Local()); +# else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, func, argc, argv); +# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION +#endif // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + } + + NAN_DEPRECATED inline v8::Local MakeCallback( + v8::Local target + , v8::Local symbol + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(node::MakeCallback( + v8::Isolate::GetCurrent(), target, symbol, argc, argv))); +#else +# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + AsyncResource res("nan:makeCallback"); + return res.runInAsyncScope(target, symbol, argc, argv) + .FromMaybe(v8::Local()); +# else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, symbol, argc, argv); +# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION +#endif // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + } + + NAN_DEPRECATED inline v8::Local MakeCallback( + v8::Local target + , const char* method + , int argc + , v8::Local* argv) { +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + return scope.Escape(New(node::MakeCallback( + v8::Isolate::GetCurrent(), target, method, argc, argv))); +#else +# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + AsyncResource res("nan:makeCallback"); + return res.runInAsyncScope(target, method, argc, argv) + .FromMaybe(v8::Local()); +# else + return node::MakeCallback( + v8::Isolate::GetCurrent(), target, method, argc, argv); +# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION +#endif // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + } + + inline void FatalException(const TryCatch& try_catch) { + node::FatalException(v8::Isolate::GetCurrent(), try_catch.try_catch_); + } + + inline v8::Local ErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return node::ErrnoException(v8::Isolate::GetCurrent(), errorno, syscall, + message, path); + } + + NAN_DEPRECATED inline v8::Local NanErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return ErrnoException(errorno, syscall, message, path); + } + + template + inline void SetIsolateData( + v8::Isolate *isolate + , T *data + ) { + isolate->SetData(0, data); + } + + template + inline T *GetIsolateData( + v8::Isolate *isolate + ) { + return static_cast(isolate->GetData(0)); + } + +class Utf8String { + public: + inline explicit Utf8String(v8::Local from) : + length_(0), str_(str_st_) { + HandleScope scope; + if (!from.IsEmpty()) { +#if NODE_MAJOR_VERSION >= 10 + v8::Local context = GetCurrentContext(); + v8::Local string = + from->ToString(context).FromMaybe(v8::Local()); +#else + v8::Local string = from->ToString(); +#endif + if (!string.IsEmpty()) { + size_t len = 3 * string->Length() + 1; + assert(len <= INT_MAX); + if (len > sizeof (str_st_)) { + str_ = static_cast(malloc(len)); + assert(str_ != 0); + } + const int flags = + v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8; +#if NODE_MAJOR_VERSION >= 11 + length_ = string->WriteUtf8(v8::Isolate::GetCurrent(), str_, static_cast(len), 0, flags); +#else + // See https://github.com/nodejs/nan/issues/832. + // Disable the warning as there is no way around it. +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + length_ = string->WriteUtf8(str_, static_cast(len), 0, flags); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // NODE_MAJOR_VERSION < 11 + str_[length_] = '\0'; + } + } + } + + inline int length() const { + return length_; + } + + inline char* operator*() { return str_; } + inline const char* operator*() const { return str_; } + + inline ~Utf8String() { + if (str_ != str_st_) { + free(str_); + } + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String) + + int length_; + char *str_; + char str_st_[1024]; +}; + +#else // Node 0.8 and 0.10 + inline v8::Local Undefined() { + EscapableHandleScope scope; + return scope.Escape(New(v8::Undefined())); + } + + inline v8::Local Null() { + EscapableHandleScope scope; + return scope.Escape(New(v8::Null())); + } + + inline v8::Local True() { + EscapableHandleScope scope; + return scope.Escape(New(v8::True())); + } + + inline v8::Local False() { + EscapableHandleScope scope; + return scope.Escape(New(v8::False())); + } + + inline v8::Local EmptyString() { + return v8::String::Empty(); + } + + inline int AdjustExternalMemory(int bc) { + return static_cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(bc)); + } + + inline void SetTemplate( + v8::Local templ + , const char *name + , v8::Local value) { + templ->Set(name, value); + } + + inline void SetTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes) { + templ->Set(name, value, attributes); + } + + inline v8::Local GetCurrentContext() { + return v8::Context::GetCurrent(); + } + + inline void* GetInternalFieldPointer( + v8::Local object + , int index) { + return object->GetPointerFromInternalField(index); + } + + inline void SetInternalFieldPointer( + v8::Local object + , int index + , void* value) { + object->SetPointerInInternalField(index, value); + } + +# define NAN_GC_CALLBACK(name) \ + void name(v8::GCType type, v8::GCCallbackFlags flags) + + inline void AddGCEpilogueCallback( + v8::GCEpilogueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::V8::AddGCEpilogueCallback(callback, gc_type_filter); + } + inline void RemoveGCEpilogueCallback( + v8::GCEpilogueCallback callback) { + v8::V8::RemoveGCEpilogueCallback(callback); + } + inline void AddGCPrologueCallback( + v8::GCPrologueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::V8::AddGCPrologueCallback(callback, gc_type_filter); + } + inline void RemoveGCPrologueCallback( + v8::GCPrologueCallback callback) { + v8::V8::RemoveGCPrologueCallback(callback); + } + inline void GetHeapStatistics( + v8::HeapStatistics *heap_statistics) { + v8::V8::GetHeapStatistics(heap_statistics); + } + +# define X(NAME) \ + inline v8::Local NAME(const char *msg) { \ + EscapableHandleScope scope; \ + return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline \ + v8::Local NAME(v8::Local msg) { \ + return v8::Exception::NAME(msg); \ + } \ + \ + inline void Throw ## NAME(const char *msg) { \ + HandleScope scope; \ + v8::ThrowException(v8::Exception::NAME(New(msg).ToLocalChecked())); \ + } \ + \ + inline \ + void Throw ## NAME(v8::Local errmsg) { \ + HandleScope scope; \ + v8::ThrowException(v8::Exception::NAME(errmsg)); \ + } + + X(Error) + X(RangeError) + X(ReferenceError) + X(SyntaxError) + X(TypeError) + +# undef X + + inline void ThrowError(v8::Local error) { + v8::ThrowException(error); + } + + inline MaybeLocal NewBuffer( + char *data + , size_t length + , node::Buffer::free_callback callback + , void *hint + ) { + EscapableHandleScope scope; + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(length <= imp::kMaxLength && "too large buffer"); + return scope.Escape( + New(node::Buffer::New(data, length, callback, hint)->handle_)); + } + + inline MaybeLocal CopyBuffer( + const char *data + , uint32_t size + ) { + EscapableHandleScope scope; + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); +#if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION + return scope.Escape(New(node::Buffer::New(data, size)->handle_)); +#else + return scope.Escape( + New(node::Buffer::New(const_cast(data), size)->handle_)); +#endif + } + + inline MaybeLocal NewBuffer(uint32_t size) { + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + EscapableHandleScope scope; + assert(size <= imp::kMaxLength && "too large buffer"); + return scope.Escape(New(node::Buffer::New(size)->handle_)); + } + + inline void FreeData(char *data, void *hint) { + (void) hint; // unused + delete[] data; + } + + inline MaybeLocal NewBuffer( + char* data + , uint32_t size + ) { + EscapableHandleScope scope; + // arbitrary buffer lengths requires + // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION + assert(size <= imp::kMaxLength && "too large buffer"); + return scope.Escape( + New(node::Buffer::New(data, size, FreeData, NULL)->handle_)); + } + +namespace imp { +inline void +widenString(std::vector *ws, const uint8_t *s, int l) { + size_t len = static_cast(l); + if (l < 0) { + len = strlen(reinterpret_cast(s)); + } + assert(len <= INT_MAX && "string too long"); + ws->resize(len); + std::copy(s, s + len, ws->begin()); // NOLINT(build/include_what_you_use) +} +} // end of namespace imp + + inline MaybeLocal + NewOneByteString(const uint8_t * value, int length = -1) { + std::vector wideString; // NOLINT(build/include_what_you_use) + imp::widenString(&wideString, value, length); + return v8::String::New(wideString.data(), + static_cast(wideString.size())); + } + + inline MaybeLocal CompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + return v8::Script::Compile(s, const_cast(&origin)); + } + + inline MaybeLocal CompileScript( + v8::Local s + ) { + return v8::Script::Compile(s); + } + + inline + MaybeLocal RunScript(v8::Local script) { + return script->Run(); + } + + inline v8::Local MakeCallback( + v8::Local target + , v8::Local func + , int argc + , v8::Local* argv) { + v8::HandleScope scope; + return scope.Close(New(node::MakeCallback(target, func, argc, argv))); + } + + inline v8::Local MakeCallback( + v8::Local target + , v8::Local symbol + , int argc + , v8::Local* argv) { + v8::HandleScope scope; + return scope.Close(New(node::MakeCallback(target, symbol, argc, argv))); + } + + inline v8::Local MakeCallback( + v8::Local target + , const char* method + , int argc + , v8::Local* argv) { + v8::HandleScope scope; + return scope.Close(New(node::MakeCallback(target, method, argc, argv))); + } + + inline void FatalException(const TryCatch& try_catch) { + node::FatalException(const_cast(try_catch.try_catch_)); + } + + inline v8::Local ErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return node::ErrnoException(errorno, syscall, message, path); + } + + NAN_DEPRECATED inline v8::Local NanErrnoException( + int errorno + , const char* syscall = NULL + , const char* message = NULL + , const char* path = NULL) { + return ErrnoException(errorno, syscall, message, path); + } + + + template + inline void SetIsolateData( + v8::Isolate *isolate + , T *data + ) { + isolate->SetData(data); + } + + template + inline T *GetIsolateData( + v8::Isolate *isolate + ) { + return static_cast(isolate->GetData()); + } + +class Utf8String { + public: + inline explicit Utf8String(v8::Local from) : + length_(0), str_(str_st_) { + v8::HandleScope scope; + if (!from.IsEmpty()) { + v8::Local string = from->ToString(); + if (!string.IsEmpty()) { + size_t len = 3 * string->Length() + 1; + assert(len <= INT_MAX); + if (len > sizeof (str_st_)) { + str_ = static_cast(malloc(len)); + assert(str_ != 0); + } + const int flags = + v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8; + length_ = string->WriteUtf8(str_, static_cast(len), 0, flags); + str_[length_] = '\0'; + } + } + } + + inline int length() const { + return length_; + } + + inline char* operator*() { return str_; } + inline const char* operator*() const { return str_; } + + inline ~Utf8String() { + if (str_ != str_st_) { + free(str_); + } + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String) + + int length_; + char *str_; + char str_st_[1024]; +}; + +#endif // NODE_MODULE_VERSION + +typedef void (*FreeCallback)(char *data, void *hint); + +typedef const FunctionCallbackInfo& NAN_METHOD_ARGS_TYPE; +typedef void NAN_METHOD_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_GETTER_ARGS_TYPE; +typedef void NAN_GETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_SETTER_ARGS_TYPE; +typedef void NAN_SETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_GETTER_ARGS_TYPE; +typedef void NAN_PROPERTY_GETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_SETTER_ARGS_TYPE; +typedef void NAN_PROPERTY_SETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_ENUMERATOR_ARGS_TYPE; +typedef void NAN_PROPERTY_ENUMERATOR_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_DELETER_ARGS_TYPE; +typedef void NAN_PROPERTY_DELETER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_PROPERTY_QUERY_ARGS_TYPE; +typedef void NAN_PROPERTY_QUERY_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_INDEX_GETTER_ARGS_TYPE; +typedef void NAN_INDEX_GETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& NAN_INDEX_SETTER_ARGS_TYPE; +typedef void NAN_INDEX_SETTER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_INDEX_ENUMERATOR_ARGS_TYPE; +typedef void NAN_INDEX_ENUMERATOR_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_INDEX_DELETER_ARGS_TYPE; +typedef void NAN_INDEX_DELETER_RETURN_TYPE; + +typedef const PropertyCallbackInfo& + NAN_INDEX_QUERY_ARGS_TYPE; +typedef void NAN_INDEX_QUERY_RETURN_TYPE; + +#define NAN_METHOD(name) \ + Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info) +#define NAN_GETTER(name) \ + Nan::NAN_GETTER_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_GETTER_ARGS_TYPE info) +#define NAN_SETTER(name) \ + Nan::NAN_SETTER_RETURN_TYPE name( \ + v8::Local property \ + , v8::Local value \ + , Nan::NAN_SETTER_ARGS_TYPE info) +#define NAN_PROPERTY_GETTER(name) \ + Nan::NAN_PROPERTY_GETTER_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_PROPERTY_GETTER_ARGS_TYPE info) +#define NAN_PROPERTY_SETTER(name) \ + Nan::NAN_PROPERTY_SETTER_RETURN_TYPE name( \ + v8::Local property \ + , v8::Local value \ + , Nan::NAN_PROPERTY_SETTER_ARGS_TYPE info) +#define NAN_PROPERTY_ENUMERATOR(name) \ + Nan::NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name( \ + Nan::NAN_PROPERTY_ENUMERATOR_ARGS_TYPE info) +#define NAN_PROPERTY_DELETER(name) \ + Nan::NAN_PROPERTY_DELETER_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_PROPERTY_DELETER_ARGS_TYPE info) +#define NAN_PROPERTY_QUERY(name) \ + Nan::NAN_PROPERTY_QUERY_RETURN_TYPE name( \ + v8::Local property \ + , Nan::NAN_PROPERTY_QUERY_ARGS_TYPE info) +# define NAN_INDEX_GETTER(name) \ + Nan::NAN_INDEX_GETTER_RETURN_TYPE name( \ + uint32_t index \ + , Nan::NAN_INDEX_GETTER_ARGS_TYPE info) +#define NAN_INDEX_SETTER(name) \ + Nan::NAN_INDEX_SETTER_RETURN_TYPE name( \ + uint32_t index \ + , v8::Local value \ + , Nan::NAN_INDEX_SETTER_ARGS_TYPE info) +#define NAN_INDEX_ENUMERATOR(name) \ + Nan::NAN_INDEX_ENUMERATOR_RETURN_TYPE \ + name(Nan::NAN_INDEX_ENUMERATOR_ARGS_TYPE info) +#define NAN_INDEX_DELETER(name) \ + Nan::NAN_INDEX_DELETER_RETURN_TYPE name( \ + uint32_t index \ + , Nan::NAN_INDEX_DELETER_ARGS_TYPE info) +#define NAN_INDEX_QUERY(name) \ + Nan::NAN_INDEX_QUERY_RETURN_TYPE name( \ + uint32_t index \ + , Nan::NAN_INDEX_QUERY_ARGS_TYPE info) + +class Callback { + public: + Callback() {} + + explicit Callback(const v8::Local &fn) : handle_(fn) {} + + ~Callback() { + handle_.Reset(); + } + + bool operator==(const Callback &other) const { + return handle_ == other.handle_; + } + + bool operator!=(const Callback &other) const { + return !operator==(other); + } + + inline + v8::Local operator*() const { return GetFunction(); } + + NAN_DEPRECATED inline v8::Local operator()( + v8::Local target + , int argc = 0 + , v8::Local argv[] = 0) const { +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); +# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + AsyncResource async("nan:Callback:operator()"); + return Call_(isolate, target, argc, argv, &async) + .FromMaybe(v8::Local()); +# else + return Call_(isolate, target, argc, argv); +# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION +#else + return Call_(target, argc, argv); +#endif // NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + } + + NAN_DEPRECATED inline v8::Local operator()( + int argc = 0 + , v8::Local argv[] = 0) const { +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); +# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + AsyncResource async("nan:Callback:operator()"); + return scope.Escape(Call_(isolate, isolate->GetCurrentContext()->Global(), + argc, argv, &async) + .FromMaybe(v8::Local())); +# else + return scope.Escape( + Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv)); +# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION +#else + v8::HandleScope scope; + return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv)); +#endif // NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + } + + inline MaybeLocal operator()( + AsyncResource* resource + , int argc = 0 + , v8::Local argv[] = 0) const { + return this->Call(argc, argv, resource); + } + + inline MaybeLocal operator()( + AsyncResource* resource + , v8::Local target + , int argc = 0 + , v8::Local argv[] = 0) const { + return this->Call(target, argc, argv, resource); + } + + // TODO(kkoopa): remove + inline void SetFunction(const v8::Local &fn) { + Reset(fn); + } + + inline void Reset(const v8::Local &fn) { + handle_.Reset(fn); + } + + inline void Reset() { + handle_.Reset(); + } + + inline v8::Local GetFunction() const { + return New(handle_); + } + + inline bool IsEmpty() const { + return handle_.IsEmpty(); + } + + // Deprecated: For async callbacks Use the versions that accept an + // AsyncResource. If this callback does not correspond to an async resource, + // that is, it is a synchronous function call on a non-empty JS stack, you + // should Nan::Call instead. + NAN_DEPRECATED inline v8::Local + Call(v8::Local target + , int argc + , v8::Local argv[]) const { +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); +# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + AsyncResource async("nan:Callback:Call"); + return Call_(isolate, target, argc, argv, &async) + .FromMaybe(v8::Local()); +# else + return Call_(isolate, target, argc, argv); +# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION +#else + return Call_(target, argc, argv); +#endif + } + + // Deprecated: For async callbacks Use the versions that accept an + // AsyncResource. If this callback does not correspond to an async resource, + // that is, it is a synchronous function call on a non-empty JS stack, you + // should Nan::Call instead. + NAN_DEPRECATED inline v8::Local + Call(int argc, v8::Local argv[]) const { +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); +# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + AsyncResource async("nan:Callback:Call"); + return scope.Escape(Call_(isolate, isolate->GetCurrentContext()->Global(), + argc, argv, &async) + .FromMaybe(v8::Local())); +# else + return scope.Escape( + Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv)); +# endif // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION +#else + v8::HandleScope scope; + return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv)); +#endif + } + + inline MaybeLocal + Call(v8::Local target + , int argc + , v8::Local argv[] + , AsyncResource* resource) const { +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + return Call_(isolate, target, argc, argv, resource); +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + return Call_(isolate, target, argc, argv); +#else + return Call_(target, argc, argv); +#endif + } + + inline MaybeLocal + Call(int argc, v8::Local argv[], AsyncResource* resource) const { +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + return Call(isolate->GetCurrentContext()->Global(), argc, argv, resource); +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv)); +#else + v8::HandleScope scope; + return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv)); +#endif + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(Callback) + Persistent handle_; + +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + MaybeLocal Call_(v8::Isolate *isolate + , v8::Local target + , int argc + , v8::Local argv[] + , AsyncResource* resource) const { + EscapableHandleScope scope; + v8::Local func = New(handle_); + auto maybe = resource->runInAsyncScope(target, func, argc, argv); + v8::Local local; + if (!maybe.ToLocal(&local)) return MaybeLocal(); + return scope.Escape(local); + } +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Local Call_(v8::Isolate *isolate + , v8::Local target + , int argc + , v8::Local argv[]) const { + EscapableHandleScope scope; + + v8::Local callback = New(handle_); +# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION + return scope.Escape(New(node::MakeCallback( + isolate + , target + , callback + , argc + , argv + ))); +# else + return scope.Escape(node::MakeCallback( + isolate + , target + , callback + , argc + , argv + )); +# endif + } +#else + v8::Local Call_(v8::Local target + , int argc + , v8::Local argv[]) const { + EscapableHandleScope scope; + + v8::Local callback = New(handle_); + return scope.Escape(New(node::MakeCallback( + target + , callback + , argc + , argv + ))); + } +#endif +}; + +inline MaybeLocal Call( + const Nan::Callback& callback + , v8::Local recv + , int argc + , v8::Local argv[]) { + return Call(*callback, recv, argc, argv); +} + +inline MaybeLocal Call( + const Nan::Callback& callback + , int argc + , v8::Local argv[]) { +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + Call(*callback, isolate->GetCurrentContext()->Global(), argc, argv) + .FromMaybe(v8::Local())); +#else + EscapableHandleScope scope; + return scope.Escape( + Call(*callback, v8::Context::GetCurrent()->Global(), argc, argv) + .FromMaybe(v8::Local())); +#endif +} + +inline MaybeLocal Call( + v8::Local symbol + , v8::Local recv + , int argc + , v8::Local argv[]) { + EscapableHandleScope scope; + v8::Local fn_v = + Get(recv, symbol).FromMaybe(v8::Local()); + if (fn_v.IsEmpty() || !fn_v->IsFunction()) return v8::Local(); + v8::Local fn = fn_v.As(); + return scope.Escape( + Call(fn, recv, argc, argv).FromMaybe(v8::Local())); +} + +inline MaybeLocal Call( + const char* method + , v8::Local recv + , int argc + , v8::Local argv[]) { + EscapableHandleScope scope; + v8::Local method_string = + New(method).ToLocalChecked(); + return scope.Escape( + Call(method_string, recv, argc, argv).FromMaybe(v8::Local())); +} + +/* abstract */ class AsyncWorker { + public: + explicit AsyncWorker(Callback *callback_, + const char* resource_name = "nan:AsyncWorker") + : callback(callback_), errmsg_(NULL) { + request.data = this; + + HandleScope scope; + v8::Local obj = New(); + persistentHandle.Reset(obj); + async_resource = new AsyncResource(resource_name, obj); + } + + virtual ~AsyncWorker() { + HandleScope scope; + + if (!persistentHandle.IsEmpty()) + persistentHandle.Reset(); + delete callback; + delete[] errmsg_; + delete async_resource; + } + + virtual void WorkComplete() { + HandleScope scope; + + if (errmsg_ == NULL) + HandleOKCallback(); + else + HandleErrorCallback(); + delete callback; + callback = NULL; + } + + inline void SaveToPersistent( + const char *key, const v8::Local &value) { + HandleScope scope; + Set(New(persistentHandle), New(key).ToLocalChecked(), value).FromJust(); + } + + inline void SaveToPersistent( + const v8::Local &key, const v8::Local &value) { + HandleScope scope; + Set(New(persistentHandle), key, value).FromJust(); + } + + inline void SaveToPersistent( + uint32_t index, const v8::Local &value) { + HandleScope scope; + Set(New(persistentHandle), index, value).FromJust(); + } + + inline v8::Local GetFromPersistent(const char *key) const { + EscapableHandleScope scope; + return scope.Escape( + Get(New(persistentHandle), New(key).ToLocalChecked()) + .FromMaybe(v8::Local())); + } + + inline v8::Local + GetFromPersistent(const v8::Local &key) const { + EscapableHandleScope scope; + return scope.Escape( + Get(New(persistentHandle), key) + .FromMaybe(v8::Local())); + } + + inline v8::Local GetFromPersistent(uint32_t index) const { + EscapableHandleScope scope; + return scope.Escape( + Get(New(persistentHandle), index) + .FromMaybe(v8::Local())); + } + + virtual void Execute() = 0; + + uv_work_t request; + + virtual void Destroy() { + delete this; + } + + protected: + Persistent persistentHandle; + Callback *callback; + AsyncResource *async_resource; + + virtual void HandleOKCallback() { + HandleScope scope; + + callback->Call(0, NULL, async_resource); + } + + virtual void HandleErrorCallback() { + HandleScope scope; + + v8::Local argv[] = { + v8::Exception::Error(New(ErrorMessage()).ToLocalChecked()) + }; + callback->Call(1, argv, async_resource); + } + + void SetErrorMessage(const char *msg) { + delete[] errmsg_; + + size_t size = strlen(msg) + 1; + errmsg_ = new char[size]; + memcpy(errmsg_, msg, size); + } + + const char* ErrorMessage() const { + return errmsg_; + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(AsyncWorker) + char *errmsg_; +}; + +/* abstract */ class AsyncBareProgressWorkerBase : public AsyncWorker { + public: + explicit AsyncBareProgressWorkerBase( + Callback *callback_, + const char* resource_name = "nan:AsyncBareProgressWorkerBase") + : AsyncWorker(callback_, resource_name) { + uv_async_init( + GetCurrentEventLoop() + , &async + , AsyncProgress_ + ); + async.data = this; + } + + virtual ~AsyncBareProgressWorkerBase() { + } + + virtual void WorkProgress() = 0; + + virtual void Destroy() { + uv_close(reinterpret_cast(&async), AsyncClose_); + } + + private: + inline static NAUV_WORK_CB(AsyncProgress_) { + AsyncBareProgressWorkerBase *worker = + static_cast(async->data); + worker->WorkProgress(); + } + + inline static void AsyncClose_(uv_handle_t* handle) { + AsyncBareProgressWorkerBase *worker = + static_cast(handle->data); + delete worker; + } + + protected: + uv_async_t async; +}; + +template +/* abstract */ +class AsyncBareProgressWorker : public AsyncBareProgressWorkerBase { + public: + explicit AsyncBareProgressWorker( + Callback *callback_, + const char* resource_name = "nan:AsyncBareProgressWorker") + : AsyncBareProgressWorkerBase(callback_, resource_name) { + uv_mutex_init(&async_lock); + } + + virtual ~AsyncBareProgressWorker() { + uv_mutex_destroy(&async_lock); + } + + class ExecutionProgress { + friend class AsyncBareProgressWorker; + public: + void Signal() const { + uv_mutex_lock(&that_->async_lock); + uv_async_send(&that_->async); + uv_mutex_unlock(&that_->async_lock); + } + + void Send(const T* data, size_t count) const { + that_->SendProgress_(data, count); + } + + private: + explicit ExecutionProgress(AsyncBareProgressWorker *that) : that_(that) {} + NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress) + AsyncBareProgressWorker* const that_; + }; + + virtual void Execute(const ExecutionProgress& progress) = 0; + virtual void HandleProgressCallback(const T *data, size_t size) = 0; + + protected: + uv_mutex_t async_lock; + + private: + void Execute() /*final override*/ { + ExecutionProgress progress(this); + Execute(progress); + } + + virtual void SendProgress_(const T *data, size_t count) = 0; +}; + +template +/* abstract */ +class AsyncProgressWorkerBase : public AsyncBareProgressWorker { + public: + explicit AsyncProgressWorkerBase( + Callback *callback_, + const char* resource_name = "nan:AsyncProgressWorkerBase") + : AsyncBareProgressWorker(callback_, resource_name), asyncdata_(NULL), + asyncsize_(0) { + } + + virtual ~AsyncProgressWorkerBase() { + delete[] asyncdata_; + } + + void WorkProgress() { + uv_mutex_lock(&this->async_lock); + T *data = asyncdata_; + size_t size = asyncsize_; + asyncdata_ = NULL; + asyncsize_ = 0; + uv_mutex_unlock(&this->async_lock); + + // Don't send progress events after we've already completed. + if (this->callback) { + this->HandleProgressCallback(data, size); + } + delete[] data; + } + + private: + void SendProgress_(const T *data, size_t count) { + T *new_data = new T[count]; + { + T *it = new_data; + std::copy(data, data + count, it); + } + + uv_mutex_lock(&this->async_lock); + T *old_data = asyncdata_; + asyncdata_ = new_data; + asyncsize_ = count; + uv_async_send(&this->async); + uv_mutex_unlock(&this->async_lock); + + delete[] old_data; + } + + T *asyncdata_; + size_t asyncsize_; +}; + +// This ensures compatibility to the previous un-templated AsyncProgressWorker +// class definition. +typedef AsyncProgressWorkerBase AsyncProgressWorker; + +template +/* abstract */ +class AsyncBareProgressQueueWorker : public AsyncBareProgressWorkerBase { + public: + explicit AsyncBareProgressQueueWorker( + Callback *callback_, + const char* resource_name = "nan:AsyncBareProgressQueueWorker") + : AsyncBareProgressWorkerBase(callback_, resource_name) { + } + + virtual ~AsyncBareProgressQueueWorker() { + } + + class ExecutionProgress { + friend class AsyncBareProgressQueueWorker; + public: + void Send(const T* data, size_t count) const { + that_->SendProgress_(data, count); + } + + private: + explicit ExecutionProgress(AsyncBareProgressQueueWorker *that) + : that_(that) {} + NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress) + AsyncBareProgressQueueWorker* const that_; + }; + + virtual void Execute(const ExecutionProgress& progress) = 0; + virtual void HandleProgressCallback(const T *data, size_t size) = 0; + + private: + void Execute() /*final override*/ { + ExecutionProgress progress(this); + Execute(progress); + } + + virtual void SendProgress_(const T *data, size_t count) = 0; +}; + +template +/* abstract */ +class AsyncProgressQueueWorker : public AsyncBareProgressQueueWorker { + public: + explicit AsyncProgressQueueWorker( + Callback *callback_, + const char* resource_name = "nan:AsyncProgressQueueWorker") + : AsyncBareProgressQueueWorker(callback_) { + uv_mutex_init(&async_lock); + } + + virtual ~AsyncProgressQueueWorker() { + uv_mutex_lock(&async_lock); + + while (!asyncdata_.empty()) { + std::pair &datapair = asyncdata_.front(); + T *data = datapair.first; + + asyncdata_.pop(); + + delete[] data; + } + + uv_mutex_unlock(&async_lock); + uv_mutex_destroy(&async_lock); + } + + void WorkComplete() { + WorkProgress(); + AsyncWorker::WorkComplete(); + } + + void WorkProgress() { + uv_mutex_lock(&async_lock); + + while (!asyncdata_.empty()) { + std::pair &datapair = asyncdata_.front(); + + T *data = datapair.first; + size_t size = datapair.second; + + asyncdata_.pop(); + uv_mutex_unlock(&async_lock); + + // Don't send progress events after we've already completed. + if (this->callback) { + this->HandleProgressCallback(data, size); + } + + delete[] data; + + uv_mutex_lock(&async_lock); + } + + uv_mutex_unlock(&async_lock); + } + + private: + void SendProgress_(const T *data, size_t count) { + T *new_data = new T[count]; + { + T *it = new_data; + std::copy(data, data + count, it); + } + + uv_mutex_lock(&async_lock); + asyncdata_.push(std::pair(new_data, count)); + uv_mutex_unlock(&async_lock); + + uv_async_send(&this->async); + } + + uv_mutex_t async_lock; + std::queue > asyncdata_; +}; + +inline void AsyncExecute (uv_work_t* req) { + AsyncWorker *worker = static_cast(req->data); + worker->Execute(); +} + +inline void AsyncExecuteComplete (uv_work_t* req) { + AsyncWorker* worker = static_cast(req->data); + worker->WorkComplete(); + worker->Destroy(); +} + +inline void AsyncQueueWorker (AsyncWorker* worker) { + uv_queue_work( + GetCurrentEventLoop() + , &worker->request + , AsyncExecute + , reinterpret_cast(AsyncExecuteComplete) + ); +} + +namespace imp { + +inline +ExternalOneByteStringResource const* +GetExternalResource(v8::Local str) { +#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION + return str->GetExternalAsciiStringResource(); +#else + return str->GetExternalOneByteStringResource(); +#endif +} + +inline +bool +IsExternal(v8::Local str) { +#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION + return str->IsExternalAscii(); +#else + return str->IsExternalOneByte(); +#endif +} + +} // end of namespace imp + +enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; + +#if NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION +# include "nan_string_bytes.h" // NOLINT(build/include) +#endif + +inline v8::Local Encode( + const void *buf, size_t len, enum Encoding encoding = BINARY) { +#if (NODE_MODULE_VERSION >= ATOM_0_21_MODULE_VERSION) + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + node::encoding node_enc = static_cast(encoding); + + if (encoding == UCS2) { + return node::Encode( + isolate + , reinterpret_cast(buf) + , len / 2); + } else { + return node::Encode( + isolate + , reinterpret_cast(buf) + , len + , node_enc); + } +#elif (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + return node::Encode( + v8::Isolate::GetCurrent() + , buf, len + , static_cast(encoding)); +#else +# if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION + return node::Encode(buf, len, static_cast(encoding)); +# else + return imp::Encode(reinterpret_cast(buf), len, encoding); +# endif +#endif +} + +inline ssize_t DecodeBytes( + v8::Local val, enum Encoding encoding = BINARY) { +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + return node::DecodeBytes( + v8::Isolate::GetCurrent() + , val + , static_cast(encoding)); +#else +# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION) + if (encoding == BUFFER) { + return node::DecodeBytes(val, node::BINARY); + } +# endif + return node::DecodeBytes(val, static_cast(encoding)); +#endif +} + +inline ssize_t DecodeWrite( + char *buf + , size_t len + , v8::Local val + , enum Encoding encoding = BINARY) { +#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION) + return node::DecodeWrite( + v8::Isolate::GetCurrent() + , buf + , len + , val + , static_cast(encoding)); +#else +# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION) + if (encoding == BUFFER) { + return node::DecodeWrite(buf, len, val, node::BINARY); + } +# endif + return node::DecodeWrite( + buf + , len + , val + , static_cast(encoding)); +#endif +} + +inline void SetPrototypeTemplate( + v8::Local templ + , const char *name + , v8::Local value +) { + HandleScope scope; + SetTemplate(templ->PrototypeTemplate(), name, value); +} + +inline void SetPrototypeTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes +) { + HandleScope scope; + SetTemplate(templ->PrototypeTemplate(), name, value, attributes); +} + +inline void SetInstanceTemplate( + v8::Local templ + , const char *name + , v8::Local value +) { + HandleScope scope; + SetTemplate(templ->InstanceTemplate(), name, value); +} + +inline void SetInstanceTemplate( + v8::Local templ + , v8::Local name + , v8::Local value + , v8::PropertyAttribute attributes +) { + HandleScope scope; + SetTemplate(templ->InstanceTemplate(), name, value, attributes); +} + +namespace imp { + +// Note(@agnat): Helper to distinguish different receiver types. The first +// version deals with receivers derived from v8::Template. The second version +// handles everything else. The final argument only serves as discriminator and +// is unused. +template +inline +void +SetMethodAux(T recv, + v8::Local name, + v8::Local tpl, + v8::Template *) { + recv->Set(name, tpl); +} + +template +inline +void +SetMethodAux(T recv, + v8::Local name, + v8::Local tpl, + ...) { + Set(recv, name, GetFunction(tpl).ToLocalChecked()); +} + +} // end of namespace imp + +template class HandleType> +inline void SetMethod( + HandleType recv + , const char *name + , FunctionCallback callback) { + HandleScope scope; + v8::Local t = New(callback); + v8::Local fn_name = New(name).ToLocalChecked(); + t->SetClassName(fn_name); + // Note(@agnat): Pass an empty T* as discriminator. See note on + // SetMethodAux(...) above + imp::SetMethodAux(recv, fn_name, t, static_cast(0)); +} + +inline void SetPrototypeMethod( + v8::Local recv + , const char* name, FunctionCallback callback) { + HandleScope scope; + v8::Local t = New( + callback + , v8::Local() + , New(recv)); + v8::Local fn_name = New(name).ToLocalChecked(); + recv->PrototypeTemplate()->Set(fn_name, t); + t->SetClassName(fn_name); +} + +//=== Accessors and Such ======================================================= + +inline void SetAccessor( + v8::Local tpl + , v8::Local name + , GetterCallback getter + , SetterCallback setter = 0 + , v8::Local data = v8::Local() + , v8::AccessControl settings = v8::DEFAULT + , v8::PropertyAttribute attribute = v8::None + , imp::Sig signature = imp::Sig()) { + HandleScope scope; + + imp::NativeGetter getter_ = + imp::GetterCallbackWrapper; + imp::NativeSetter setter_ = + setter ? imp::SetterCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kAccessorFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kGetterIndex + , New(reinterpret_cast(getter))); + + if (setter != 0) { + obj->SetInternalField( + imp::kSetterIndex + , New(reinterpret_cast(setter))); + } + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + + tpl->SetAccessor( + name + , getter_ + , setter_ + , obj + , settings + , attribute + , signature); +} + +inline bool SetAccessor( + v8::Local obj + , v8::Local name + , GetterCallback getter + , SetterCallback setter = 0 + , v8::Local data = v8::Local() + , v8::AccessControl settings = v8::DEFAULT + , v8::PropertyAttribute attribute = v8::None) { + HandleScope scope; + + imp::NativeGetter getter_ = + imp::GetterCallbackWrapper; + imp::NativeSetter setter_ = + setter ? imp::SetterCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kAccessorFieldCount); + v8::Local dataobj = NewInstance(otpl).ToLocalChecked(); + + dataobj->SetInternalField( + imp::kGetterIndex + , New(reinterpret_cast(getter))); + + if (!data.IsEmpty()) { + dataobj->SetInternalField(imp::kDataIndex, data); + } + + if (setter) { + dataobj->SetInternalField( + imp::kSetterIndex + , New(reinterpret_cast(setter))); + } + +#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) + return obj->SetAccessor( + GetCurrentContext() + , name + , getter_ + , setter_ + , dataobj + , settings + , attribute).FromMaybe(false); +#else + return obj->SetAccessor( + name + , getter_ + , setter_ + , dataobj + , settings + , attribute); +#endif +} + +inline void SetNamedPropertyHandler( + v8::Local tpl + , PropertyGetterCallback getter + , PropertySetterCallback setter = 0 + , PropertyQueryCallback query = 0 + , PropertyDeleterCallback deleter = 0 + , PropertyEnumeratorCallback enumerator = 0 + , v8::Local data = v8::Local()) { + HandleScope scope; + + imp::NativePropertyGetter getter_ = + imp::PropertyGetterCallbackWrapper; + imp::NativePropertySetter setter_ = + setter ? imp::PropertySetterCallbackWrapper : 0; + imp::NativePropertyQuery query_ = + query ? imp::PropertyQueryCallbackWrapper : 0; + imp::NativePropertyDeleter *deleter_ = + deleter ? imp::PropertyDeleterCallbackWrapper : 0; + imp::NativePropertyEnumerator enumerator_ = + enumerator ? imp::PropertyEnumeratorCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kPropertyFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + obj->SetInternalField( + imp::kPropertyGetterIndex + , New(reinterpret_cast(getter))); + + if (setter) { + obj->SetInternalField( + imp::kPropertySetterIndex + , New(reinterpret_cast(setter))); + } + + if (query) { + obj->SetInternalField( + imp::kPropertyQueryIndex + , New(reinterpret_cast(query))); + } + + if (deleter) { + obj->SetInternalField( + imp::kPropertyDeleterIndex + , New(reinterpret_cast(deleter))); + } + + if (enumerator) { + obj->SetInternalField( + imp::kPropertyEnumeratorIndex + , New(reinterpret_cast(enumerator))); + } + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + tpl->SetHandler(v8::NamedPropertyHandlerConfiguration( + getter_, setter_, query_, deleter_, enumerator_, obj)); +#else + tpl->SetNamedPropertyHandler( + getter_ + , setter_ + , query_ + , deleter_ + , enumerator_ + , obj); +#endif +} + +inline void SetIndexedPropertyHandler( + v8::Local tpl + , IndexGetterCallback getter + , IndexSetterCallback setter = 0 + , IndexQueryCallback query = 0 + , IndexDeleterCallback deleter = 0 + , IndexEnumeratorCallback enumerator = 0 + , v8::Local data = v8::Local()) { + HandleScope scope; + + imp::NativeIndexGetter getter_ = + imp::IndexGetterCallbackWrapper; + imp::NativeIndexSetter setter_ = + setter ? imp::IndexSetterCallbackWrapper : 0; + imp::NativeIndexQuery query_ = + query ? imp::IndexQueryCallbackWrapper : 0; + imp::NativeIndexDeleter deleter_ = + deleter ? imp::IndexDeleterCallbackWrapper : 0; + imp::NativeIndexEnumerator enumerator_ = + enumerator ? imp::IndexEnumeratorCallbackWrapper : 0; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kIndexPropertyFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + obj->SetInternalField( + imp::kIndexPropertyGetterIndex + , New(reinterpret_cast(getter))); + + if (setter) { + obj->SetInternalField( + imp::kIndexPropertySetterIndex + , New(reinterpret_cast(setter))); + } + + if (query) { + obj->SetInternalField( + imp::kIndexPropertyQueryIndex + , New(reinterpret_cast(query))); + } + + if (deleter) { + obj->SetInternalField( + imp::kIndexPropertyDeleterIndex + , New(reinterpret_cast(deleter))); + } + + if (enumerator) { + obj->SetInternalField( + imp::kIndexPropertyEnumeratorIndex + , New(reinterpret_cast(enumerator))); + } + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + tpl->SetHandler(v8::IndexedPropertyHandlerConfiguration( + getter_, setter_, query_, deleter_, enumerator_, obj)); +#else + tpl->SetIndexedPropertyHandler( + getter_ + , setter_ + , query_ + , deleter_ + , enumerator_ + , obj); +#endif +} + +inline void SetCallHandler( + v8::Local tpl + , FunctionCallback callback + , v8::Local data = v8::Local()) { + HandleScope scope; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , New(reinterpret_cast(callback))); + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + + tpl->SetCallHandler(imp::FunctionCallbackWrapper, obj); +} + + +inline void SetCallAsFunctionHandler( + v8::Local tpl, + FunctionCallback callback, + v8::Local data = v8::Local()) { + HandleScope scope; + + v8::Local otpl = New(); + otpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(otpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , New(reinterpret_cast(callback))); + + if (!data.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, data); + } + + tpl->SetCallAsFunctionHandler(imp::FunctionCallbackWrapper, obj); +} + +//=== Weak Persistent Handling ================================================= + +#include "nan_weak.h" // NOLINT(build/include) + +//=== ObjectWrap =============================================================== + +#include "nan_object_wrap.h" // NOLINT(build/include) + +//=== HiddenValue/Private ====================================================== + +#include "nan_private.h" // NOLINT(build/include) + +//=== Export ================================================================== + +inline +void +Export(ADDON_REGISTER_FUNCTION_ARGS_TYPE target, const char *name, + FunctionCallback f) { + HandleScope scope; + + Set(target, New(name).ToLocalChecked(), + GetFunction(New(f)).ToLocalChecked()); +} + +//=== Tap Reverse Binding ===================================================== + +struct Tap { + explicit Tap(v8::Local t) : t_() { + HandleScope scope; + + t_.Reset(To(t).ToLocalChecked()); + } + + ~Tap() { t_.Reset(); } // not sure if neccessary + + inline void plan(int i) { + HandleScope scope; + v8::Local arg = New(i); + Call("plan", New(t_), 1, &arg); + } + + inline void ok(bool isOk, const char *msg = NULL) { + HandleScope scope; + v8::Local args[2]; + args[0] = New(isOk); + if (msg) args[1] = New(msg).ToLocalChecked(); + Call("ok", New(t_), msg ? 2 : 1, args); + } + + inline void pass(const char * msg = NULL) { + HandleScope scope; + v8::Local hmsg; + if (msg) hmsg = New(msg).ToLocalChecked(); + Call("pass", New(t_), msg ? 1 : 0, &hmsg); + } + + inline void end() { + HandleScope scope; + Call("end", New(t_), 0, NULL); + } + + private: + Persistent t_; +}; + +#define NAN_STRINGIZE2(x) #x +#define NAN_STRINGIZE(x) NAN_STRINGIZE2(x) +#define NAN_TEST_EXPRESSION(expression) \ + ( expression ), __FILE__ ":" NAN_STRINGIZE(__LINE__) ": " #expression + +#define NAN_EXPORT(target, function) Export(target, #function, function) + +#undef TYPE_CHECK + +//=== Generic Maybefication =================================================== + +namespace imp { + +template struct Maybefier; + +template struct Maybefier > { + inline static MaybeLocal convert(v8::Local v) { + return v; + } +}; + +template struct Maybefier > { + inline static MaybeLocal convert(MaybeLocal v) { + return v; + } +}; + +} // end of namespace imp + +template class MaybeMaybe> +inline MaybeLocal +MakeMaybe(MaybeMaybe v) { + return imp::Maybefier >::convert(v); +} + +//=== TypedArrayContents ======================================================= + +#include "nan_typedarray_contents.h" // NOLINT(build/include) + +//=== JSON ===================================================================== + +#include "nan_json.h" // NOLINT(build/include) + +} // end of namespace Nan + +#endif // NAN_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks.h new file mode 100644 index 00000000..53ede846 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks.h @@ -0,0 +1,88 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CALLBACKS_H_ +#define NAN_CALLBACKS_H_ + +template class FunctionCallbackInfo; +template class PropertyCallbackInfo; +template class Global; + +typedef void(*FunctionCallback)(const FunctionCallbackInfo&); +typedef void(*GetterCallback) + (v8::Local, const PropertyCallbackInfo&); +typedef void(*SetterCallback)( + v8::Local, + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertyGetterCallback)( + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertySetterCallback)( + v8::Local, + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertyEnumeratorCallback) + (const PropertyCallbackInfo&); +typedef void(*PropertyDeleterCallback)( + v8::Local, + const PropertyCallbackInfo&); +typedef void(*PropertyQueryCallback)( + v8::Local, + const PropertyCallbackInfo&); +typedef void(*IndexGetterCallback)( + uint32_t, + const PropertyCallbackInfo&); +typedef void(*IndexSetterCallback)( + uint32_t, + v8::Local, + const PropertyCallbackInfo&); +typedef void(*IndexEnumeratorCallback) + (const PropertyCallbackInfo&); +typedef void(*IndexDeleterCallback)( + uint32_t, + const PropertyCallbackInfo&); +typedef void(*IndexQueryCallback)( + uint32_t, + const PropertyCallbackInfo&); + +namespace imp { +typedef v8::Local Sig; + +static const int kDataIndex = 0; + +static const int kFunctionIndex = 1; +static const int kFunctionFieldCount = 2; + +static const int kGetterIndex = 1; +static const int kSetterIndex = 2; +static const int kAccessorFieldCount = 3; + +static const int kPropertyGetterIndex = 1; +static const int kPropertySetterIndex = 2; +static const int kPropertyEnumeratorIndex = 3; +static const int kPropertyDeleterIndex = 4; +static const int kPropertyQueryIndex = 5; +static const int kPropertyFieldCount = 6; + +static const int kIndexPropertyGetterIndex = 1; +static const int kIndexPropertySetterIndex = 2; +static const int kIndexPropertyEnumeratorIndex = 3; +static const int kIndexPropertyDeleterIndex = 4; +static const int kIndexPropertyQueryIndex = 5; +static const int kIndexPropertyFieldCount = 6; + +} // end of namespace imp + +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +# include "nan_callbacks_12_inl.h" // NOLINT(build/include) +#else +# include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include) +#endif + +#endif // NAN_CALLBACKS_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks_12_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks_12_inl.h new file mode 100644 index 00000000..c27b18d8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks_12_inl.h @@ -0,0 +1,514 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CALLBACKS_12_INL_H_ +#define NAN_CALLBACKS_12_INL_H_ + +template +class ReturnValue { + v8::ReturnValue value_; + + public: + template + explicit inline ReturnValue(const v8::ReturnValue &value) : + value_(value) {} + template + explicit inline ReturnValue(const ReturnValue& that) + : value_(that.value_) { + TYPE_CHECK(T, S); + } + + // Handle setters + template inline void Set(const v8::Local &handle) { + TYPE_CHECK(T, S); + value_.Set(handle); + } + + template inline void Set(const Global &handle) { + TYPE_CHECK(T, S); +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && \ + (V8_MINOR_VERSION > 5 || (V8_MINOR_VERSION == 5 && \ + defined(V8_BUILD_NUMBER) && V8_BUILD_NUMBER >= 8)))) + value_.Set(handle); +#else + value_.Set(*reinterpret_cast*>(&handle)); + const_cast &>(handle).Reset(); +#endif + } + + // Fast primitive setters + inline void Set(bool value) { + TYPE_CHECK(T, v8::Boolean); + value_.Set(value); + } + + inline void Set(double i) { + TYPE_CHECK(T, v8::Number); + value_.Set(i); + } + + inline void Set(int32_t i) { + TYPE_CHECK(T, v8::Integer); + value_.Set(i); + } + + inline void Set(uint32_t i) { + TYPE_CHECK(T, v8::Integer); + value_.Set(i); + } + + // Fast JS primitive setters + inline void SetNull() { + TYPE_CHECK(T, v8::Primitive); + value_.SetNull(); + } + + inline void SetUndefined() { + TYPE_CHECK(T, v8::Primitive); + value_.SetUndefined(); + } + + inline void SetEmptyString() { + TYPE_CHECK(T, v8::String); + value_.SetEmptyString(); + } + + // Convenience getter for isolate + inline v8::Isolate *GetIsolate() const { + return value_.GetIsolate(); + } + + // Pointer setter: Uncompilable to prevent inadvertent misuse. + template + inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); } +}; + +template +class FunctionCallbackInfo { + const v8::FunctionCallbackInfo &info_; + const v8::Local data_; + + public: + explicit inline FunctionCallbackInfo( + const v8::FunctionCallbackInfo &info + , v8::Local data) : + info_(info) + , data_(data) {} + + inline ReturnValue GetReturnValue() const { + return ReturnValue(info_.GetReturnValue()); + } + +#if NODE_MAJOR_VERSION < 10 + inline v8::Local Callee() const { return info_.Callee(); } +#endif + inline v8::Local Data() const { return data_; } + inline v8::Local Holder() const { return info_.Holder(); } + inline bool IsConstructCall() const { return info_.IsConstructCall(); } + inline int Length() const { return info_.Length(); } + inline v8::Local operator[](int i) const { return info_[i]; } + inline v8::Local This() const { return info_.This(); } + inline v8::Isolate *GetIsolate() const { return info_.GetIsolate(); } + + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kCalleeIndex = 5; + static const int kContextSaveIndex = 6; + static const int kArgsLength = 7; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo) +}; + +template +class PropertyCallbackInfo { + const v8::PropertyCallbackInfo &info_; + const v8::Local data_; + + public: + explicit inline PropertyCallbackInfo( + const v8::PropertyCallbackInfo &info + , const v8::Local data) : + info_(info) + , data_(data) {} + + inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); } + inline v8::Local Data() const { return data_; } + inline v8::Local This() const { return info_.This(); } + inline v8::Local Holder() const { return info_.Holder(); } + inline ReturnValue GetReturnValue() const { + return ReturnValue(info_.GetReturnValue()); + } + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kThisIndex = 5; + static const int kArgsLength = 6; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfo) +}; + +namespace imp { +static +void FunctionCallbackWrapper(const v8::FunctionCallbackInfo &info) { + v8::Local obj = info.Data().As(); + FunctionCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kFunctionIndex).As()->Value())); + FunctionCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + callback(cbinfo); +} + +typedef void (*NativeFunction)(const v8::FunctionCallbackInfo &); + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +static +void GetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + GetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kGetterIndex).As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (*NativeGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void SetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + SetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kSetterIndex).As()->Value())); + callback(property.As(), value, cbinfo); +} + +typedef void (*NativeSetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); +#else +static +void GetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + GetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kGetterIndex).As()->Value())); + callback(property, cbinfo); +} + +typedef void (*NativeGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void SetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + SetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kSetterIndex).As()->Value())); + callback(property, value, cbinfo); +} + +typedef void (*NativeSetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); +#endif + +#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +static +void PropertyGetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyGetterIndex) + .As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (*NativePropertyGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertySetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertySetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertySetterIndex) + .As()->Value())); + callback(property.As(), value, cbinfo); +} + +typedef void (*NativePropertySetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); + +static +void PropertyEnumeratorCallbackWrapper( + const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyEnumeratorCallback callback = + reinterpret_cast(reinterpret_cast( + obj->GetInternalField(kPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); +} + +typedef void (*NativePropertyEnumerator) + (const v8::PropertyCallbackInfo &); + +static +void PropertyDeleterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyDeleterIndex) + .As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (NativePropertyDeleter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertyQueryCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyQueryIndex) + .As()->Value())); + callback(property.As(), cbinfo); +} + +typedef void (*NativePropertyQuery) + (v8::Local, const v8::PropertyCallbackInfo &); +#else +static +void PropertyGetterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyGetterIndex) + .As()->Value())); + callback(property, cbinfo); +} + +typedef void (*NativePropertyGetter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertySetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertySetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertySetterIndex) + .As()->Value())); + callback(property, value, cbinfo); +} + +typedef void (*NativePropertySetter)( + v8::Local + , v8::Local + , const v8::PropertyCallbackInfo &); + +static +void PropertyEnumeratorCallbackWrapper( + const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyEnumeratorCallback callback = + reinterpret_cast(reinterpret_cast( + obj->GetInternalField(kPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); +} + +typedef void (*NativePropertyEnumerator) + (const v8::PropertyCallbackInfo &); + +static +void PropertyDeleterCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyDeleterIndex) + .As()->Value())); + callback(property, cbinfo); +} + +typedef void (NativePropertyDeleter) + (v8::Local, const v8::PropertyCallbackInfo &); + +static +void PropertyQueryCallbackWrapper( + v8::Local property + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyQueryIndex) + .As()->Value())); + callback(property, cbinfo); +} + +typedef void (*NativePropertyQuery) + (v8::Local, const v8::PropertyCallbackInfo &); +#endif + +static +void IndexGetterCallbackWrapper( + uint32_t index, const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyGetterIndex) + .As()->Value())); + callback(index, cbinfo); +} + +typedef void (*NativeIndexGetter) + (uint32_t, const v8::PropertyCallbackInfo &); + +static +void IndexSetterCallbackWrapper( + uint32_t index + , v8::Local value + , const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexSetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertySetterIndex) + .As()->Value())); + callback(index, value, cbinfo); +} + +typedef void (*NativeIndexSetter)( + uint32_t + , v8::Local + , const v8::PropertyCallbackInfo &); + +static +void IndexEnumeratorCallbackWrapper( + const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexEnumeratorCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField( + kIndexPropertyEnumeratorIndex).As()->Value())); + callback(cbinfo); +} + +typedef void (*NativeIndexEnumerator) + (const v8::PropertyCallbackInfo &); + +static +void IndexDeleterCallbackWrapper( + uint32_t index, const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyDeleterIndex) + .As()->Value())); + callback(index, cbinfo); +} + +typedef void (*NativeIndexDeleter) + (uint32_t, const v8::PropertyCallbackInfo &); + +static +void IndexQueryCallbackWrapper( + uint32_t index, const v8::PropertyCallbackInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyQueryIndex) + .As()->Value())); + callback(index, cbinfo); +} + +typedef void (*NativeIndexQuery) + (uint32_t, const v8::PropertyCallbackInfo &); +} // end of namespace imp + +#endif // NAN_CALLBACKS_12_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks_pre_12_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks_pre_12_inl.h new file mode 100644 index 00000000..c9ba4993 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_callbacks_pre_12_inl.h @@ -0,0 +1,520 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CALLBACKS_PRE_12_INL_H_ +#define NAN_CALLBACKS_PRE_12_INL_H_ + +namespace imp { +template class ReturnValueImp; +} // end of namespace imp + +template +class ReturnValue { + v8::Isolate *isolate_; + v8::Persistent *value_; + friend class imp::ReturnValueImp; + + public: + template + explicit inline ReturnValue(v8::Isolate *isolate, v8::Persistent *p) : + isolate_(isolate), value_(p) {} + template + explicit inline ReturnValue(const ReturnValue& that) + : isolate_(that.isolate_), value_(that.value_) { + TYPE_CHECK(T, S); + } + + // Handle setters + template inline void Set(const v8::Local &handle) { + TYPE_CHECK(T, S); + value_->Dispose(); + *value_ = v8::Persistent::New(handle); + } + + template inline void Set(const Global &handle) { + TYPE_CHECK(T, S); + value_->Dispose(); + *value_ = v8::Persistent::New(handle.persistent); + const_cast &>(handle).Reset(); + } + + // Fast primitive setters + inline void Set(bool value) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Boolean); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Boolean::New(value)); + } + + inline void Set(double i) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Number); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Number::New(i)); + } + + inline void Set(int32_t i) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Integer); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Int32::New(i)); + } + + inline void Set(uint32_t i) { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Integer); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Uint32::NewFromUnsigned(i)); + } + + // Fast JS primitive setters + inline void SetNull() { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Primitive); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Null()); + } + + inline void SetUndefined() { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::Primitive); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::Undefined()); + } + + inline void SetEmptyString() { + v8::HandleScope scope; + + TYPE_CHECK(T, v8::String); + value_->Dispose(); + *value_ = v8::Persistent::New(v8::String::Empty()); + } + + // Convenience getter for isolate + inline v8::Isolate *GetIsolate() const { + return isolate_; + } + + // Pointer setter: Uncompilable to prevent inadvertent misuse. + template + inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); } +}; + +template +class FunctionCallbackInfo { + const v8::Arguments &args_; + v8::Local data_; + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline FunctionCallbackInfo( + const v8::Arguments &args + , v8::Local data) : + args_(args) + , data_(data) + , return_value_(args.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Undefined())) {} + + inline ~FunctionCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return ReturnValue(return_value_); + } + + inline v8::Local Callee() const { return args_.Callee(); } + inline v8::Local Data() const { return data_; } + inline v8::Local Holder() const { return args_.Holder(); } + inline bool IsConstructCall() const { return args_.IsConstructCall(); } + inline int Length() const { return args_.Length(); } + inline v8::Local operator[](int i) const { return args_[i]; } + inline v8::Local This() const { return args_.This(); } + inline v8::Isolate *GetIsolate() const { return args_.GetIsolate(); } + + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kCalleeIndex = 5; + static const int kContextSaveIndex = 6; + static const int kArgsLength = 7; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo) +}; + +template +class PropertyCallbackInfoBase { + const v8::AccessorInfo &info_; + const v8::Local data_; + + public: + explicit inline PropertyCallbackInfoBase( + const v8::AccessorInfo &info + , const v8::Local data) : + info_(info) + , data_(data) {} + + inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); } + inline v8::Local Data() const { return data_; } + inline v8::Local This() const { return info_.This(); } + inline v8::Local Holder() const { return info_.Holder(); } + + protected: + static const int kHolderIndex = 0; + static const int kIsolateIndex = 1; + static const int kReturnValueDefaultValueIndex = 2; + static const int kReturnValueIndex = 3; + static const int kDataIndex = 4; + static const int kThisIndex = 5; + static const int kArgsLength = 6; + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfoBase) +}; + +template +class PropertyCallbackInfo : public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Undefined())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { return return_value_; } +}; + +template<> +class PropertyCallbackInfo : + public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Local())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return return_value_; + } +}; + +template<> +class PropertyCallbackInfo : + public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Local())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return return_value_; + } +}; + +template<> +class PropertyCallbackInfo : + public PropertyCallbackInfoBase { + ReturnValue return_value_; + v8::Persistent retval_; + + public: + explicit inline PropertyCallbackInfo( + const v8::AccessorInfo &info + , const v8::Local data) : + PropertyCallbackInfoBase(info, data) + , return_value_(info.GetIsolate(), &retval_) + , retval_(v8::Persistent::New(v8::Local())) {} + + inline ~PropertyCallbackInfo() { + retval_.Dispose(); + retval_.Clear(); + } + + inline ReturnValue GetReturnValue() const { + return return_value_; + } +}; + +namespace imp { +template +class ReturnValueImp : public ReturnValue { + public: + explicit ReturnValueImp(ReturnValue that) : + ReturnValue(that) {} + inline v8::Handle Value() { + return *ReturnValue::value_; + } +}; + +static +v8::Handle FunctionCallbackWrapper(const v8::Arguments &args) { + v8::Local obj = args.Data().As(); + FunctionCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kFunctionIndex).As()->Value())); + FunctionCallbackInfo + cbinfo(args, obj->GetInternalField(kDataIndex)); + callback(cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeFunction)(const v8::Arguments &); + +static +v8::Handle GetterCallbackWrapper( + v8::Local property, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + GetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kGetterIndex).As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeGetter) + (v8::Local, const v8::AccessorInfo &); + +static +void SetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + SetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kSetterIndex).As()->Value())); + callback(property, value, cbinfo); +} + +typedef void (*NativeSetter) + (v8::Local, v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertyGetterCallbackWrapper( + v8::Local property, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyGetterIndex) + .As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertyGetter) + (v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertySetterCallbackWrapper( + v8::Local property + , v8::Local value + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertySetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertySetterIndex) + .As()->Value())); + callback(property, value, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertySetter) + (v8::Local, v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertyEnumeratorCallbackWrapper( + const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyEnumeratorCallback callback = + reinterpret_cast(reinterpret_cast( + obj->GetInternalField(kPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertyEnumerator) + (const v8::AccessorInfo &); + +static +v8::Handle PropertyDeleterCallbackWrapper( + v8::Local property + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyDeleterIndex) + .As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (NativePropertyDeleter) + (v8::Local, const v8::AccessorInfo &); + +static +v8::Handle PropertyQueryCallbackWrapper( + v8::Local property, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + PropertyQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kPropertyQueryIndex) + .As()->Value())); + callback(property, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativePropertyQuery) + (v8::Local, const v8::AccessorInfo &); + +static +v8::Handle IndexGetterCallbackWrapper( + uint32_t index, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexGetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyGetterIndex) + .As()->Value())); + callback(index, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexGetter) + (uint32_t, const v8::AccessorInfo &); + +static +v8::Handle IndexSetterCallbackWrapper( + uint32_t index + , v8::Local value + , const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexSetterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertySetterIndex) + .As()->Value())); + callback(index, value, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexSetter) + (uint32_t, v8::Local, const v8::AccessorInfo &); + +static +v8::Handle IndexEnumeratorCallbackWrapper( + const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexEnumeratorCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyEnumeratorIndex) + .As()->Value())); + callback(cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexEnumerator) + (const v8::AccessorInfo &); + +static +v8::Handle IndexDeleterCallbackWrapper( + uint32_t index, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexDeleterCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyDeleterIndex) + .As()->Value())); + callback(index, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexDeleter) + (uint32_t, const v8::AccessorInfo &); + +static +v8::Handle IndexQueryCallbackWrapper( + uint32_t index, const v8::AccessorInfo &info) { + v8::Local obj = info.Data().As(); + PropertyCallbackInfo + cbinfo(info, obj->GetInternalField(kDataIndex)); + IndexQueryCallback callback = reinterpret_cast( + reinterpret_cast( + obj->GetInternalField(kIndexPropertyQueryIndex) + .As()->Value())); + callback(index, cbinfo); + return ReturnValueImp(cbinfo.GetReturnValue()).Value(); +} + +typedef v8::Handle (*NativeIndexQuery) + (uint32_t, const v8::AccessorInfo &); +} // end of namespace imp + +#endif // NAN_CALLBACKS_PRE_12_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters.h new file mode 100644 index 00000000..c0b32729 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters.h @@ -0,0 +1,72 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CONVERTERS_H_ +#define NAN_CONVERTERS_H_ + +namespace imp { +template struct ToFactoryBase { + typedef MaybeLocal return_t; +}; +template struct ValueFactoryBase { typedef Maybe return_t; }; + +template struct ToFactory; + +template<> +struct ToFactory : ToFactoryBase { + static inline return_t convert(v8::Local val) { + if (val.IsEmpty() || !val->IsFunction()) return MaybeLocal(); + return MaybeLocal(val.As()); + } +}; + +#define X(TYPE) \ + template<> \ + struct ToFactory : ToFactoryBase { \ + static inline return_t convert(v8::Local val); \ + }; + +X(Boolean) +X(Number) +X(String) +X(Object) +X(Integer) +X(Uint32) +X(Int32) + +#undef X + +#define X(TYPE) \ + template<> \ + struct ToFactory : ValueFactoryBase { \ + static inline return_t convert(v8::Local val); \ + }; + +X(bool) +X(double) +X(int64_t) +X(uint32_t) +X(int32_t) + +#undef X +} // end of namespace imp + +template +inline +typename imp::ToFactory::return_t To(v8::Local val) { + return imp::ToFactory::convert(val); +} + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +# include "nan_converters_43_inl.h" +#else +# include "nan_converters_pre_43_inl.h" +#endif + +#endif // NAN_CONVERTERS_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters_43_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters_43_inl.h new file mode 100644 index 00000000..41b72deb --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters_43_inl.h @@ -0,0 +1,68 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CONVERTERS_43_INL_H_ +#define NAN_CONVERTERS_43_INL_H_ + +#define X(TYPE) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ + v8::EscapableHandleScope scope(isolate); \ + return scope.Escape( \ + val->To ## TYPE(isolate->GetCurrentContext()) \ + .FromMaybe(v8::Local())); \ +} + +X(Number) +X(String) +X(Object) +X(Integer) +X(Uint32) +X(Int32) +// V8 <= 7.0 +#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0) +X(Boolean) +#else +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ + v8::EscapableHandleScope scope(isolate); \ + return scope.Escape(val->ToBoolean(isolate)); \ +} +#endif + +#undef X + +#define X(TYPE, NAME) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ + v8::HandleScope scope(isolate); \ + return val->NAME ## Value(isolate->GetCurrentContext()); \ +} + +X(double, Number) +X(int64_t, Integer) +X(uint32_t, Uint32) +X(int32_t, Int32) +// V8 <= 7.0 +#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0) +X(bool, Boolean) +#else +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + v8::Isolate *isolate = v8::Isolate::GetCurrent(); \ + v8::HandleScope scope(isolate); \ + return Just(val->BooleanValue(isolate)); \ +} +#endif + +#undef X + +#endif // NAN_CONVERTERS_43_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters_pre_43_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters_pre_43_inl.h new file mode 100644 index 00000000..ae0518aa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_converters_pre_43_inl.h @@ -0,0 +1,42 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_CONVERTERS_PRE_43_INL_H_ +#define NAN_CONVERTERS_PRE_43_INL_H_ + +#define X(TYPE) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + return val->To ## TYPE(); \ +} + +X(Boolean) +X(Number) +X(String) +X(Object) +X(Integer) +X(Uint32) +X(Int32) + +#undef X + +#define X(TYPE, NAME) \ +imp::ToFactory::return_t \ +imp::ToFactory::convert(v8::Local val) { \ + return Just(val->NAME ## Value()); \ +} + +X(bool, Boolean) +X(double, Number) +X(int64_t, Integer) +X(uint32_t, Uint32) +X(int32_t, Int32) + +#undef X + +#endif // NAN_CONVERTERS_PRE_43_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_define_own_property_helper.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_define_own_property_helper.h new file mode 100644 index 00000000..d710ef22 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_define_own_property_helper.h @@ -0,0 +1,29 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_DEFINE_OWN_PROPERTY_HELPER_H_ +#define NAN_DEFINE_OWN_PROPERTY_HELPER_H_ + +namespace imp { + +inline Maybe DefineOwnPropertyHelper( + v8::PropertyAttribute current + , v8::Handle obj + , v8::Handle key + , v8::Handle value + , v8::PropertyAttribute attribs = v8::None) { + return !(current & v8::DontDelete) || // configurable OR + (!(current & v8::ReadOnly) && // writable AND + !((attribs ^ current) & ~v8::ReadOnly)) // same excluding RO + ? Just(obj->ForceSet(key, value, attribs)) + : Nothing(); +} + +} // end of namespace imp + +#endif // NAN_DEFINE_OWN_PROPERTY_HELPER_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_implementation_12_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_implementation_12_inl.h new file mode 100644 index 00000000..8756e6ee --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_implementation_12_inl.h @@ -0,0 +1,429 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_IMPLEMENTATION_12_INL_H_ +#define NAN_IMPLEMENTATION_12_INL_H_ +//============================================================================== +// node v0.11 implementation +//============================================================================== + +namespace imp { + +//=== Array ==================================================================== + +Factory::return_t +Factory::New() { + return v8::Array::New(v8::Isolate::GetCurrent()); +} + +Factory::return_t +Factory::New(int length) { + return v8::Array::New(v8::Isolate::GetCurrent(), length); +} + +//=== Boolean ================================================================== + +Factory::return_t +Factory::New(bool value) { + return v8::Boolean::New(v8::Isolate::GetCurrent(), value); +} + +//=== Boolean Object =========================================================== + +Factory::return_t +Factory::New(bool value) { +#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) + return v8::BooleanObject::New( + v8::Isolate::GetCurrent(), value).As(); +#else + return v8::BooleanObject::New(value).As(); +#endif +} + +//=== Context ================================================================== + +Factory::return_t +Factory::New( v8::ExtensionConfiguration* extensions + , v8::Local tmpl + , v8::Local obj) { + return v8::Context::New(v8::Isolate::GetCurrent(), extensions, tmpl, obj); +} + +//=== Date ===================================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New(double value) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(v8::Date::New(isolate->GetCurrentContext(), value) + .FromMaybe(v8::Local()).As()); +} +#else +Factory::return_t +Factory::New(double value) { + return v8::Date::New(v8::Isolate::GetCurrent(), value).As(); +} +#endif + +//=== External ================================================================= + +Factory::return_t +Factory::New(void * value) { + return v8::External::New(v8::Isolate::GetCurrent(), value); +} + +//=== Function ================================================================= + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::Local tpl = v8::ObjectTemplate::New(isolate); + tpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(tpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , v8::External::New(isolate, reinterpret_cast(callback))); + + v8::Local val = v8::Local::New(isolate, data); + + if (!val.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, val); + } + +#if NODE_MAJOR_VERSION >= 10 + v8::Local context = isolate->GetCurrentContext(); + v8::Local function = + v8::Function::New(context, imp::FunctionCallbackWrapper, obj) + .ToLocalChecked(); +#else + v8::Local function = + v8::Function::New(isolate, imp::FunctionCallbackWrapper, obj); +#endif + + return scope.Escape(function); +} + +//=== Function Template ======================================================== + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data + , v8::Local signature) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + if (callback) { + v8::EscapableHandleScope scope(isolate); + v8::Local tpl = v8::ObjectTemplate::New(isolate); + tpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = NewInstance(tpl).ToLocalChecked(); + + obj->SetInternalField( + imp::kFunctionIndex + , v8::External::New(isolate, reinterpret_cast(callback))); + v8::Local val = v8::Local::New(isolate, data); + + if (!val.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, val); + } + + return scope.Escape(v8::FunctionTemplate::New( isolate + , imp::FunctionCallbackWrapper + , obj + , signature)); + } else { + return v8::FunctionTemplate::New(isolate, 0, data, signature); + } +} + +//=== Number =================================================================== + +Factory::return_t +Factory::New(double value) { + return v8::Number::New(v8::Isolate::GetCurrent(), value); +} + +//=== Number Object ============================================================ + +Factory::return_t +Factory::New(double value) { + return v8::NumberObject::New( v8::Isolate::GetCurrent() + , value).As(); +} + +//=== Integer, Int32 and Uint32 ================================================ + +template +typename IntegerFactory::return_t +IntegerFactory::New(int32_t value) { + return To(T::New(v8::Isolate::GetCurrent(), value)); +} + +template +typename IntegerFactory::return_t +IntegerFactory::New(uint32_t value) { + return To(T::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); +} + +Factory::return_t +Factory::New(int32_t value) { + return To( + v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); +} + +Factory::return_t +Factory::New(uint32_t value) { + return To( + v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); +} + +//=== Object =================================================================== + +Factory::return_t +Factory::New() { + return v8::Object::New(v8::Isolate::GetCurrent()); +} + +//=== Object Template ========================================================== + +Factory::return_t +Factory::New() { + return v8::ObjectTemplate::New(v8::Isolate::GetCurrent()); +} + +//=== RegExp =================================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New( + v8::Local pattern + , v8::RegExp::Flags flags) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + v8::RegExp::New(isolate->GetCurrentContext(), pattern, flags) + .FromMaybe(v8::Local())); +} +#else +Factory::return_t +Factory::New( + v8::Local pattern + , v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); +} +#endif + +//=== Script =================================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New( v8::Local source) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source src(source); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src) + .FromMaybe(v8::Local())); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::ScriptCompiler::Source src(source, origin); + return scope.Escape( + v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src) + .FromMaybe(v8::Local())); +} +#else +Factory::return_t +Factory::New( v8::Local source) { + v8::ScriptCompiler::Source src(source); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::ScriptCompiler::Source src(source, origin); + return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); +} +#endif + +//=== Signature ================================================================ + +Factory::return_t +Factory::New(Factory::FTH receiver) { + return v8::Signature::New(v8::Isolate::GetCurrent(), receiver); +} + +//=== String =================================================================== + +Factory::return_t +Factory::New() { + return v8::String::Empty(v8::Isolate::GetCurrent()); +} + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New(const char * value, int length) { + return v8::String::NewFromUtf8( + v8::Isolate::GetCurrent(), value, v8::NewStringType::kNormal, length); +} + +Factory::return_t +Factory::New(std::string const& value) { + assert(value.size() <= INT_MAX && "string too long"); + return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), + value.data(), v8::NewStringType::kNormal, static_cast(value.size())); +} + +Factory::return_t +Factory::New(const uint16_t * value, int length) { + return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value, + v8::NewStringType::kNormal, length); +} + +Factory::return_t +Factory::New(v8::String::ExternalStringResource * value) { + return v8::String::NewExternalTwoByte(v8::Isolate::GetCurrent(), value); +} + +Factory::return_t +Factory::New(ExternalOneByteStringResource * value) { + return v8::String::NewExternalOneByte(v8::Isolate::GetCurrent(), value); +} +#else +Factory::return_t +Factory::New(const char * value, int length) { + return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value, + v8::String::kNormalString, length); +} + +Factory::return_t +Factory::New( + std::string const& value) /* NOLINT(build/include_what_you_use) */ { + assert(value.size() <= INT_MAX && "string too long"); + return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value.data(), + v8::String::kNormalString, + static_cast(value.size())); +} + +Factory::return_t +Factory::New(const uint16_t * value, int length) { + return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value, + v8::String::kNormalString, length); +} + +Factory::return_t +Factory::New(v8::String::ExternalStringResource * value) { + return v8::String::NewExternal(v8::Isolate::GetCurrent(), value); +} + +Factory::return_t +Factory::New(ExternalOneByteStringResource * value) { + return v8::String::NewExternal(v8::Isolate::GetCurrent(), value); +} +#endif + +//=== String Object ============================================================ + +// See https://github.com/nodejs/nan/pull/811#discussion_r224594980. +// Disable the warning as there is no way around it. +// TODO(bnoordhuis) Use isolate-based version in Node.js v12. +Factory::return_t +Factory::New(v8::Local value) { +// V8 > 7.0 +#if V8_MAJOR_VERSION > 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION > 0) + return v8::StringObject::New(v8::Isolate::GetCurrent(), value).As(); +#else +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + return v8::StringObject::New(value).As(); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif +} + +//=== Unbound Script =========================================================== + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +Factory::return_t +Factory::New(v8::Local source) { + v8::ScriptCompiler::Source src(source); + return v8::ScriptCompiler::CompileUnboundScript( + v8::Isolate::GetCurrent(), &src); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::ScriptCompiler::Source src(source, origin); + return v8::ScriptCompiler::CompileUnboundScript( + v8::Isolate::GetCurrent(), &src); +} +#else +Factory::return_t +Factory::New(v8::Local source) { + v8::ScriptCompiler::Source src(source); + return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src); +} + +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + v8::ScriptCompiler::Source src(source, origin); + return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src); +} +#endif + +} // end of namespace imp + +//=== Presistents and Handles ================================================== + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION +template +inline v8::Local New(v8::Handle h) { + return v8::Local::New(v8::Isolate::GetCurrent(), h); +} +#endif + +template +inline v8::Local New(v8::Persistent const& p) { + return v8::Local::New(v8::Isolate::GetCurrent(), p); +} + +template +inline v8::Local New(Persistent const& p) { + return v8::Local::New(v8::Isolate::GetCurrent(), p); +} + +template +inline v8::Local New(Global const& p) { + return v8::Local::New(v8::Isolate::GetCurrent(), p); +} + +#endif // NAN_IMPLEMENTATION_12_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_implementation_pre_12_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_implementation_pre_12_inl.h new file mode 100644 index 00000000..1472421a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_implementation_pre_12_inl.h @@ -0,0 +1,263 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_IMPLEMENTATION_PRE_12_INL_H_ +#define NAN_IMPLEMENTATION_PRE_12_INL_H_ + +//============================================================================== +// node v0.10 implementation +//============================================================================== + +namespace imp { + +//=== Array ==================================================================== + +Factory::return_t +Factory::New() { + return v8::Array::New(); +} + +Factory::return_t +Factory::New(int length) { + return v8::Array::New(length); +} + +//=== Boolean ================================================================== + +Factory::return_t +Factory::New(bool value) { + return v8::Boolean::New(value)->ToBoolean(); +} + +//=== Boolean Object =========================================================== + +Factory::return_t +Factory::New(bool value) { + return v8::BooleanObject::New(value).As(); +} + +//=== Context ================================================================== + +Factory::return_t +Factory::New( v8::ExtensionConfiguration* extensions + , v8::Local tmpl + , v8::Local obj) { + v8::Persistent ctx = v8::Context::New(extensions, tmpl, obj); + v8::Local lctx = v8::Local::New(ctx); + ctx.Dispose(); + return lctx; +} + +//=== Date ===================================================================== + +Factory::return_t +Factory::New(double value) { + return v8::Date::New(value).As(); +} + +//=== External ================================================================= + +Factory::return_t +Factory::New(void * value) { + return v8::External::New(value); +} + +//=== Function ================================================================= + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data) { + v8::HandleScope scope; + + return scope.Close(Factory::New( + callback, data, v8::Local()) + ->GetFunction()); +} + + +//=== FunctionTemplate ========================================================= + +Factory::return_t +Factory::New( FunctionCallback callback + , v8::Local data + , v8::Local signature) { + if (callback) { + v8::HandleScope scope; + + v8::Local tpl = v8::ObjectTemplate::New(); + tpl->SetInternalFieldCount(imp::kFunctionFieldCount); + v8::Local obj = tpl->NewInstance(); + + obj->SetInternalField( + imp::kFunctionIndex + , v8::External::New(reinterpret_cast(callback))); + + v8::Local val = v8::Local::New(data); + + if (!val.IsEmpty()) { + obj->SetInternalField(imp::kDataIndex, val); + } + + // Note(agnat): Emulate length argument here. Unfortunately, I couldn't find + // a way. Have at it though... + return scope.Close( + v8::FunctionTemplate::New(imp::FunctionCallbackWrapper + , obj + , signature)); + } else { + return v8::FunctionTemplate::New(0, data, signature); + } +} + +//=== Number =================================================================== + +Factory::return_t +Factory::New(double value) { + return v8::Number::New(value); +} + +//=== Number Object ============================================================ + +Factory::return_t +Factory::New(double value) { + return v8::NumberObject::New(value).As(); +} + +//=== Integer, Int32 and Uint32 ================================================ + +template +typename IntegerFactory::return_t +IntegerFactory::New(int32_t value) { + return To(T::New(value)); +} + +template +typename IntegerFactory::return_t +IntegerFactory::New(uint32_t value) { + return To(T::NewFromUnsigned(value)); +} + +Factory::return_t +Factory::New(int32_t value) { + return To(v8::Uint32::NewFromUnsigned(value)); +} + +Factory::return_t +Factory::New(uint32_t value) { + return To(v8::Uint32::NewFromUnsigned(value)); +} + + +//=== Object =================================================================== + +Factory::return_t +Factory::New() { + return v8::Object::New(); +} + +//=== Object Template ========================================================== + +Factory::return_t +Factory::New() { + return v8::ObjectTemplate::New(); +} + +//=== RegExp =================================================================== + +Factory::return_t +Factory::New( + v8::Local pattern + , v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); +} + +//=== Script =================================================================== + +Factory::return_t +Factory::New( v8::Local source) { + return v8::Script::New(source); +} +Factory::return_t +Factory::New( v8::Local source + , v8::ScriptOrigin const& origin) { + return v8::Script::New(source, const_cast(&origin)); +} + +//=== Signature ================================================================ + +Factory::return_t +Factory::New(Factory::FTH receiver) { + return v8::Signature::New(receiver); +} + +//=== String =================================================================== + +Factory::return_t +Factory::New() { + return v8::String::Empty(); +} + +Factory::return_t +Factory::New(const char * value, int length) { + return v8::String::New(value, length); +} + +Factory::return_t +Factory::New( + std::string const& value) /* NOLINT(build/include_what_you_use) */ { + assert(value.size() <= INT_MAX && "string too long"); + return v8::String::New(value.data(), static_cast(value.size())); +} + +Factory::return_t +Factory::New(const uint16_t * value, int length) { + return v8::String::New(value, length); +} + +Factory::return_t +Factory::New(v8::String::ExternalStringResource * value) { + return v8::String::NewExternal(value); +} + +Factory::return_t +Factory::New(v8::String::ExternalAsciiStringResource * value) { + return v8::String::NewExternal(value); +} + +//=== String Object ============================================================ + +Factory::return_t +Factory::New(v8::Local value) { + return v8::StringObject::New(value).As(); +} + +} // end of namespace imp + +//=== Presistents and Handles ================================================== + +template +inline v8::Local New(v8::Handle h) { + return v8::Local::New(h); +} + +template +inline v8::Local New(v8::Persistent const& p) { + return v8::Local::New(p); +} + +template +inline v8::Local New(Persistent const& p) { + return v8::Local::New(p.persistent); +} + +template +inline v8::Local New(Global const& p) { + return v8::Local::New(p.persistent); +} + +#endif // NAN_IMPLEMENTATION_PRE_12_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_json.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_json.h new file mode 100644 index 00000000..33ac8ba6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_json.h @@ -0,0 +1,166 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_JSON_H_ +#define NAN_JSON_H_ + +#if NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION +#define NAN_JSON_H_NEED_PARSE 1 +#else +#define NAN_JSON_H_NEED_PARSE 0 +#endif // NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION + +#if NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION +#define NAN_JSON_H_NEED_STRINGIFY 0 +#else +#define NAN_JSON_H_NEED_STRINGIFY 1 +#endif // NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION + +class JSON { + public: + JSON() { +#if NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY + Nan::HandleScope scope; + + Nan::MaybeLocal maybe_global_json = Nan::Get( + Nan::GetCurrentContext()->Global(), + Nan::New("JSON").ToLocalChecked() + ); + + assert(!maybe_global_json.IsEmpty() && "global JSON is empty"); + v8::Local val_global_json = maybe_global_json.ToLocalChecked(); + + assert(val_global_json->IsObject() && "global JSON is not an object"); + Nan::MaybeLocal maybe_obj_global_json = + Nan::To(val_global_json); + + assert(!maybe_obj_global_json.IsEmpty() && "global JSON object is empty"); + v8::Local global_json = maybe_obj_global_json.ToLocalChecked(); + +#if NAN_JSON_H_NEED_PARSE + Nan::MaybeLocal maybe_parse_method = Nan::Get( + global_json, Nan::New("parse").ToLocalChecked() + ); + + assert(!maybe_parse_method.IsEmpty() && "JSON.parse is empty"); + v8::Local parse_method = maybe_parse_method.ToLocalChecked(); + + assert(parse_method->IsFunction() && "JSON.parse is not a function"); + parse_cb_.Reset(parse_method.As()); +#endif // NAN_JSON_H_NEED_PARSE + +#if NAN_JSON_H_NEED_STRINGIFY + Nan::MaybeLocal maybe_stringify_method = Nan::Get( + global_json, Nan::New("stringify").ToLocalChecked() + ); + + assert(!maybe_stringify_method.IsEmpty() && "JSON.stringify is empty"); + v8::Local stringify_method = + maybe_stringify_method.ToLocalChecked(); + + assert( + stringify_method->IsFunction() && "JSON.stringify is not a function" + ); + stringify_cb_.Reset(stringify_method.As()); +#endif // NAN_JSON_H_NEED_STRINGIFY +#endif // NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY + } + + inline + Nan::MaybeLocal Parse(v8::Local json_string) { + Nan::EscapableHandleScope scope; +#if NAN_JSON_H_NEED_PARSE + return scope.Escape(parse(json_string)); +#else + Nan::MaybeLocal result; +#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION && \ + NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION + result = v8::JSON::Parse(json_string); +#else +#if NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION + v8::Local context_or_isolate = Nan::GetCurrentContext(); +#else + v8::Isolate* context_or_isolate = v8::Isolate::GetCurrent(); +#endif // NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION + result = v8::JSON::Parse(context_or_isolate, json_string); +#endif // NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION && + // NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION + if (result.IsEmpty()) return v8::Local(); + return scope.Escape(result.ToLocalChecked()); +#endif // NAN_JSON_H_NEED_PARSE + } + + inline + Nan::MaybeLocal Stringify(v8::Local json_object) { + Nan::EscapableHandleScope scope; + Nan::MaybeLocal result = +#if NAN_JSON_H_NEED_STRINGIFY + Nan::To(stringify(json_object)); +#else + v8::JSON::Stringify(Nan::GetCurrentContext(), json_object); +#endif // NAN_JSON_H_NEED_STRINGIFY + if (result.IsEmpty()) return v8::Local(); + return scope.Escape(result.ToLocalChecked()); + } + + inline + Nan::MaybeLocal Stringify(v8::Local json_object, + v8::Local gap) { + Nan::EscapableHandleScope scope; + Nan::MaybeLocal result = +#if NAN_JSON_H_NEED_STRINGIFY + Nan::To(stringify(json_object, gap)); +#else + v8::JSON::Stringify(Nan::GetCurrentContext(), json_object, gap); +#endif // NAN_JSON_H_NEED_STRINGIFY + if (result.IsEmpty()) return v8::Local(); + return scope.Escape(result.ToLocalChecked()); + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(JSON) +#if NAN_JSON_H_NEED_PARSE + Nan::Callback parse_cb_; +#endif // NAN_JSON_H_NEED_PARSE +#if NAN_JSON_H_NEED_STRINGIFY + Nan::Callback stringify_cb_; +#endif // NAN_JSON_H_NEED_STRINGIFY + +#if NAN_JSON_H_NEED_PARSE + inline v8::Local parse(v8::Local arg) { + assert(!parse_cb_.IsEmpty() && "parse_cb_ is empty"); + AsyncResource resource("nan:JSON.parse"); + return parse_cb_.Call(1, &arg, &resource).FromMaybe(v8::Local()); + } +#endif // NAN_JSON_H_NEED_PARSE + +#if NAN_JSON_H_NEED_STRINGIFY + inline v8::Local stringify(v8::Local arg) { + assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty"); + AsyncResource resource("nan:JSON.stringify"); + return stringify_cb_.Call(1, &arg, &resource) + .FromMaybe(v8::Local()); + } + + inline v8::Local stringify(v8::Local arg, + v8::Local gap) { + assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty"); + + v8::Local argv[] = { + arg, + Nan::Null(), + gap + }; + AsyncResource resource("nan:JSON.stringify"); + return stringify_cb_.Call(3, argv, &resource) + .FromMaybe(v8::Local()); + } +#endif // NAN_JSON_H_NEED_STRINGIFY +}; + +#endif // NAN_JSON_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_maybe_43_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_maybe_43_inl.h new file mode 100644 index 00000000..91783da6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_maybe_43_inl.h @@ -0,0 +1,369 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_MAYBE_43_INL_H_ +#define NAN_MAYBE_43_INL_H_ + +template +using MaybeLocal = v8::MaybeLocal; + +template +using Maybe = v8::Maybe; + +template +inline Maybe Nothing() { + return v8::Nothing(); +} + +template +inline Maybe Just(const T& t) { + return v8::Just(t); +} + +inline +MaybeLocal ToDetailString(v8::Local val) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(val->ToDetailString(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal ToArrayIndex(v8::Local val) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(val->ToArrayIndex(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +Maybe Equals(v8::Local a, v8::Local(b)) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return a->Equals(isolate->GetCurrentContext(), b); +} + +inline +MaybeLocal NewInstance(v8::Local h) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(h->NewInstance(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal NewInstance( + v8::Local h + , int argc + , v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(h->NewInstance(isolate->GetCurrentContext(), argc, argv) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal NewInstance(v8::Local h) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(h->NewInstance(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + + +inline MaybeLocal GetFunction( + v8::Local t) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(t->GetFunction(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe Set( + v8::Local obj + , v8::Local key + , v8::Local value) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Set(isolate->GetCurrentContext(), key, value); +} + +inline Maybe Set( + v8::Local obj + , uint32_t index + , v8::Local value) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Set(isolate->GetCurrentContext(), index, value); +} + +#if NODE_MODULE_VERSION < NODE_4_0_MODULE_VERSION +#include "nan_define_own_property_helper.h" // NOLINT(build/include) +#endif + +inline Maybe DefineOwnProperty( + v8::Local obj + , v8::Local key + , v8::Local value + , v8::PropertyAttribute attribs = v8::None) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); +#if NODE_MODULE_VERSION >= NODE_4_0_MODULE_VERSION + return obj->DefineOwnProperty(isolate->GetCurrentContext(), key, value, + attribs); +#else + Maybe maybeCurrent = + obj->GetPropertyAttributes(isolate->GetCurrentContext(), key); + if (maybeCurrent.IsNothing()) { + return Nothing(); + } + v8::PropertyAttribute current = maybeCurrent.FromJust(); + return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs); +#endif +} + +NAN_DEPRECATED inline Maybe ForceSet( + v8::Local obj + , v8::Local key + , v8::Local value + , v8::PropertyAttribute attribs = v8::None) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); +#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION + return key->IsName() + ? obj->DefineOwnProperty(isolate->GetCurrentContext(), + key.As(), value, attribs) + : Nothing(); +#else + return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs); +#endif +} + +inline MaybeLocal Get( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->Get(isolate->GetCurrentContext(), key) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal Get(v8::Local obj, uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->Get(isolate->GetCurrentContext(), index) + .FromMaybe(v8::Local())); +} + +inline v8::PropertyAttribute GetPropertyAttributes( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->GetPropertyAttributes(isolate->GetCurrentContext(), key) + .FromJust(); +} + +inline Maybe Has( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Has(isolate->GetCurrentContext(), key); +} + +inline Maybe Has(v8::Local obj, uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Has(isolate->GetCurrentContext(), index); +} + +inline Maybe Delete( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Delete(isolate->GetCurrentContext(), key); +} + +inline +Maybe Delete(v8::Local obj, uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->Delete(isolate->GetCurrentContext(), index); +} + +inline +MaybeLocal GetPropertyNames(v8::Local obj) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->GetPropertyNames(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal GetOwnPropertyNames(v8::Local obj) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->GetOwnPropertyNames(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe SetPrototype( + v8::Local obj + , v8::Local prototype) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->SetPrototype(isolate->GetCurrentContext(), prototype); +} + +inline MaybeLocal ObjectProtoToString( + v8::Local obj) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->ObjectProtoToString(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe HasOwnProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasOwnProperty(isolate->GetCurrentContext(), key); +} + +inline Maybe HasRealNamedProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasRealNamedProperty(isolate->GetCurrentContext(), key); +} + +inline Maybe HasRealIndexedProperty( + v8::Local obj + , uint32_t index) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasRealIndexedProperty(isolate->GetCurrentContext(), index); +} + +inline Maybe HasRealNamedCallbackProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return obj->HasRealNamedCallbackProperty(isolate->GetCurrentContext(), key); +} + +inline MaybeLocal GetRealNamedPropertyInPrototypeChain( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(obj->GetRealNamedPropertyInPrototypeChain( + isolate->GetCurrentContext(), key) + .FromMaybe(v8::Local())); +} + +inline MaybeLocal GetRealNamedProperty( + v8::Local obj + , v8::Local key) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + obj->GetRealNamedProperty(isolate->GetCurrentContext(), key) + .FromMaybe(v8::Local())); +} + +inline MaybeLocal CallAsFunction( + v8::Local obj + , v8::Local recv + , int argc + , v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + obj->CallAsFunction(isolate->GetCurrentContext(), recv, argc, argv) + .FromMaybe(v8::Local())); +} + +inline MaybeLocal CallAsConstructor( + v8::Local obj + , int argc, v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape( + obj->CallAsConstructor(isolate->GetCurrentContext(), argc, argv) + .FromMaybe(v8::Local())); +} + +inline +MaybeLocal GetSourceLine(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(msg->GetSourceLine(isolate->GetCurrentContext()) + .FromMaybe(v8::Local())); +} + +inline Maybe GetLineNumber(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return msg->GetLineNumber(isolate->GetCurrentContext()); +} + +inline Maybe GetStartColumn(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return msg->GetStartColumn(isolate->GetCurrentContext()); +} + +inline Maybe GetEndColumn(v8::Local msg) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::HandleScope scope(isolate); + return msg->GetEndColumn(isolate->GetCurrentContext()); +} + +inline MaybeLocal CloneElementAt( + v8::Local array + , uint32_t index) { +#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION) + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::Local context = isolate->GetCurrentContext(); + v8::Local elem; + v8::Local obj; + if (!array->Get(context, index).ToLocal(&elem)) { + return scope.Escape(obj); + } + if (!elem->ToObject(context).ToLocal(&obj)) { + return scope.Escape(v8::Local()); + } + return scope.Escape(obj->Clone()); +#else + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(array->CloneElementAt(isolate->GetCurrentContext(), index) + .FromMaybe(v8::Local())); +#endif +} + +inline MaybeLocal Call( + v8::Local fun + , v8::Local recv + , int argc + , v8::Local argv[]) { + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + return scope.Escape(fun->Call(isolate->GetCurrentContext(), recv, argc, argv) + .FromMaybe(v8::Local())); +} + +#endif // NAN_MAYBE_43_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_maybe_pre_43_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_maybe_pre_43_inl.h new file mode 100644 index 00000000..3847296d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_maybe_pre_43_inl.h @@ -0,0 +1,316 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_MAYBE_PRE_43_INL_H_ +#define NAN_MAYBE_PRE_43_INL_H_ + +template +class MaybeLocal { + public: + inline MaybeLocal() : val_(v8::Local()) {} + + template +# if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION + inline + MaybeLocal(v8::Local that) : val_(that) {} // NOLINT(runtime/explicit) +# else + inline + MaybeLocal(v8::Local that) : // NOLINT(runtime/explicit) + val_(*reinterpret_cast*>(&that)) {} +# endif + + inline bool IsEmpty() const { return val_.IsEmpty(); } + + template + inline bool ToLocal(v8::Local *out) const { + *out = val_; + return !IsEmpty(); + } + + inline v8::Local ToLocalChecked() const { +#if defined(V8_ENABLE_CHECKS) + assert(!IsEmpty() && "ToLocalChecked is Empty"); +#endif // V8_ENABLE_CHECKS + return val_; + } + + template + inline v8::Local FromMaybe(v8::Local default_value) const { + return IsEmpty() ? default_value : v8::Local(val_); + } + + private: + v8::Local val_; +}; + +template +class Maybe { + public: + inline bool IsNothing() const { return !has_value_; } + inline bool IsJust() const { return has_value_; } + + inline T FromJust() const { +#if defined(V8_ENABLE_CHECKS) + assert(IsJust() && "FromJust is Nothing"); +#endif // V8_ENABLE_CHECKS + return value_; + } + + inline T FromMaybe(const T& default_value) const { + return has_value_ ? value_ : default_value; + } + + inline bool operator==(const Maybe &other) const { + return (IsJust() == other.IsJust()) && + (!IsJust() || FromJust() == other.FromJust()); + } + + inline bool operator!=(const Maybe &other) const { + return !operator==(other); + } + + private: + Maybe() : has_value_(false) {} + explicit Maybe(const T& t) : has_value_(true), value_(t) {} + bool has_value_; + T value_; + + template + friend Maybe Nothing(); + template + friend Maybe Just(const U& u); +}; + +template +inline Maybe Nothing() { + return Maybe(); +} + +template +inline Maybe Just(const T& t) { + return Maybe(t); +} + +inline +MaybeLocal ToDetailString(v8::Handle val) { + return MaybeLocal(val->ToDetailString()); +} + +inline +MaybeLocal ToArrayIndex(v8::Handle val) { + return MaybeLocal(val->ToArrayIndex()); +} + +inline +Maybe Equals(v8::Handle a, v8::Handle(b)) { + return Just(a->Equals(b)); +} + +inline +MaybeLocal NewInstance(v8::Handle h) { + return MaybeLocal(h->NewInstance()); +} + +inline +MaybeLocal NewInstance( + v8::Local h + , int argc + , v8::Local argv[]) { + return MaybeLocal(h->NewInstance(argc, argv)); +} + +inline +MaybeLocal NewInstance(v8::Handle h) { + return MaybeLocal(h->NewInstance()); +} + +inline +MaybeLocal GetFunction(v8::Handle t) { + return MaybeLocal(t->GetFunction()); +} + +inline Maybe Set( + v8::Handle obj + , v8::Handle key + , v8::Handle value) { + return Just(obj->Set(key, value)); +} + +inline Maybe Set( + v8::Handle obj + , uint32_t index + , v8::Handle value) { + return Just(obj->Set(index, value)); +} + +#include "nan_define_own_property_helper.h" // NOLINT(build/include) + +inline Maybe DefineOwnProperty( + v8::Handle obj + , v8::Handle key + , v8::Handle value + , v8::PropertyAttribute attribs = v8::None) { + v8::PropertyAttribute current = obj->GetPropertyAttributes(key); + return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs); +} + +NAN_DEPRECATED inline Maybe ForceSet( + v8::Handle obj + , v8::Handle key + , v8::Handle value + , v8::PropertyAttribute attribs = v8::None) { + return Just(obj->ForceSet(key, value, attribs)); +} + +inline MaybeLocal Get( + v8::Handle obj + , v8::Handle key) { + return MaybeLocal(obj->Get(key)); +} + +inline MaybeLocal Get( + v8::Handle obj + , uint32_t index) { + return MaybeLocal(obj->Get(index)); +} + +inline Maybe GetPropertyAttributes( + v8::Handle obj + , v8::Handle key) { + return Just(obj->GetPropertyAttributes(key)); +} + +inline Maybe Has( + v8::Handle obj + , v8::Handle key) { + return Just(obj->Has(key)); +} + +inline Maybe Has( + v8::Handle obj + , uint32_t index) { + return Just(obj->Has(index)); +} + +inline Maybe Delete( + v8::Handle obj + , v8::Handle key) { + return Just(obj->Delete(key)); +} + +inline Maybe Delete( + v8::Handle obj + , uint32_t index) { + return Just(obj->Delete(index)); +} + +inline +MaybeLocal GetPropertyNames(v8::Handle obj) { + return MaybeLocal(obj->GetPropertyNames()); +} + +inline +MaybeLocal GetOwnPropertyNames(v8::Handle obj) { + return MaybeLocal(obj->GetOwnPropertyNames()); +} + +inline Maybe SetPrototype( + v8::Handle obj + , v8::Handle prototype) { + return Just(obj->SetPrototype(prototype)); +} + +inline MaybeLocal ObjectProtoToString( + v8::Handle obj) { + return MaybeLocal(obj->ObjectProtoToString()); +} + +inline Maybe HasOwnProperty( + v8::Handle obj + , v8::Handle key) { + return Just(obj->HasOwnProperty(key)); +} + +inline Maybe HasRealNamedProperty( + v8::Handle obj + , v8::Handle key) { + return Just(obj->HasRealNamedProperty(key)); +} + +inline Maybe HasRealIndexedProperty( + v8::Handle obj + , uint32_t index) { + return Just(obj->HasRealIndexedProperty(index)); +} + +inline Maybe HasRealNamedCallbackProperty( + v8::Handle obj + , v8::Handle key) { + return Just(obj->HasRealNamedCallbackProperty(key)); +} + +inline MaybeLocal GetRealNamedPropertyInPrototypeChain( + v8::Handle obj + , v8::Handle key) { + return MaybeLocal( + obj->GetRealNamedPropertyInPrototypeChain(key)); +} + +inline MaybeLocal GetRealNamedProperty( + v8::Handle obj + , v8::Handle key) { + return MaybeLocal(obj->GetRealNamedProperty(key)); +} + +inline MaybeLocal CallAsFunction( + v8::Handle obj + , v8::Handle recv + , int argc + , v8::Handle argv[]) { + return MaybeLocal(obj->CallAsFunction(recv, argc, argv)); +} + +inline MaybeLocal CallAsConstructor( + v8::Handle obj + , int argc + , v8::Local argv[]) { + return MaybeLocal(obj->CallAsConstructor(argc, argv)); +} + +inline +MaybeLocal GetSourceLine(v8::Handle msg) { + return MaybeLocal(msg->GetSourceLine()); +} + +inline Maybe GetLineNumber(v8::Handle msg) { + return Just(msg->GetLineNumber()); +} + +inline Maybe GetStartColumn(v8::Handle msg) { + return Just(msg->GetStartColumn()); +} + +inline Maybe GetEndColumn(v8::Handle msg) { + return Just(msg->GetEndColumn()); +} + +inline MaybeLocal CloneElementAt( + v8::Handle array + , uint32_t index) { + return MaybeLocal(array->CloneElementAt(index)); +} + +inline MaybeLocal Call( + v8::Local fun + , v8::Local recv + , int argc + , v8::Local argv[]) { + return MaybeLocal(fun->Call(recv, argc, argv)); +} + +#endif // NAN_MAYBE_PRE_43_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_new.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_new.h new file mode 100644 index 00000000..cdf8bbe4 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_new.h @@ -0,0 +1,340 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_NEW_H_ +#define NAN_NEW_H_ + +namespace imp { // scnr + +// TODO(agnat): Generalize +template v8::Local To(v8::Local i); + +template <> +inline +v8::Local +To(v8::Local i) { + return Nan::To(i).ToLocalChecked(); +} + +template <> +inline +v8::Local +To(v8::Local i) { + return Nan::To(i).ToLocalChecked(); +} + +template <> +inline +v8::Local +To(v8::Local i) { + return Nan::To(i).ToLocalChecked(); +} + +template struct FactoryBase { + typedef v8::Local return_t; +}; + +template struct MaybeFactoryBase { + typedef MaybeLocal return_t; +}; + +template struct Factory; + +template <> +struct Factory : FactoryBase { + static inline return_t New(); + static inline return_t New(int length); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(bool value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(bool value); +}; + +template <> +struct Factory : FactoryBase { + static inline + return_t + New( v8::ExtensionConfiguration* extensions = NULL + , v8::Local tmpl = v8::Local() + , v8::Local obj = v8::Local()); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New(double value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(void *value); +}; + +template <> +struct Factory : FactoryBase { + static inline + return_t + New( FunctionCallback callback + , v8::Local data = v8::Local()); +}; + +template <> +struct Factory : FactoryBase { + static inline + return_t + New( FunctionCallback callback = NULL + , v8::Local data = v8::Local() + , v8::Local signature = v8::Local()); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(double value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(double value); +}; + +template +struct IntegerFactory : FactoryBase { + typedef typename FactoryBase::return_t return_t; + static inline return_t New(int32_t value); + static inline return_t New(uint32_t value); +}; + +template <> +struct Factory : IntegerFactory {}; + +template <> +struct Factory : IntegerFactory {}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(int32_t value); + static inline return_t New(uint32_t value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New( + v8::Local pattern, v8::RegExp::Flags flags); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New( v8::Local source); + static inline return_t New( v8::Local source + , v8::ScriptOrigin const& origin); +}; + +template <> +struct Factory : FactoryBase { + typedef v8::Local FTH; + static inline return_t New(FTH receiver = FTH()); +}; + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New(); + static inline return_t New(const char *value, int length = -1); + static inline return_t New(const uint16_t *value, int length = -1); + static inline return_t New(std::string const& value); + + static inline return_t New(v8::String::ExternalStringResource * value); + static inline return_t New(ExternalOneByteStringResource * value); +}; + +template <> +struct Factory : FactoryBase { + static inline return_t New(v8::Local value); +}; + +} // end of namespace imp + +#if (NODE_MODULE_VERSION >= 12) + +namespace imp { + +template <> +struct Factory : MaybeFactoryBase { + static inline return_t New( v8::Local source); + static inline return_t New( v8::Local source + , v8::ScriptOrigin const& origin); +}; + +} // end of namespace imp + +# include "nan_implementation_12_inl.h" + +#else // NODE_MODULE_VERSION >= 12 + +# include "nan_implementation_pre_12_inl.h" + +#endif + +//=== API ====================================================================== + +template +typename imp::Factory::return_t +New() { + return imp::Factory::New(); +} + +template +typename imp::Factory::return_t +New(A0 arg0) { + return imp::Factory::New(arg0); +} + +template +typename imp::Factory::return_t +New(A0 arg0, A1 arg1) { + return imp::Factory::New(arg0, arg1); +} + +template +typename imp::Factory::return_t +New(A0 arg0, A1 arg1, A2 arg2) { + return imp::Factory::New(arg0, arg1, arg2); +} + +template +typename imp::Factory::return_t +New(A0 arg0, A1 arg1, A2 arg2, A3 arg3) { + return imp::Factory::New(arg0, arg1, arg2, arg3); +} + +// Note(agnat): When passing overloaded function pointers to template functions +// as generic arguments the compiler needs help in picking the right overload. +// These two functions handle New and New with +// all argument variations. + +// v8::Function and v8::FunctionTemplate with one or two arguments +template +typename imp::Factory::return_t +New( FunctionCallback callback + , v8::Local data = v8::Local()) { + return imp::Factory::New(callback, data); +} + +// v8::Function and v8::FunctionTemplate with three arguments +template +typename imp::Factory::return_t +New( FunctionCallback callback + , v8::Local data = v8::Local() + , A2 a2 = A2()) { + return imp::Factory::New(callback, data, a2); +} + +// Convenience + +#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION +template inline v8::Local New(v8::Handle h); +#endif + +#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +template + inline v8::Local New(v8::Persistent const& p); +#else +template inline v8::Local New(v8::Persistent const& p); +#endif +template +inline v8::Local New(Persistent const& p); +template +inline v8::Local New(Global const& p); + +inline +imp::Factory::return_t +New(bool value) { + return New(value); +} + +inline +imp::Factory::return_t +New(int32_t value) { + return New(value); +} + +inline +imp::Factory::return_t +New(uint32_t value) { + return New(value); +} + +inline +imp::Factory::return_t +New(double value) { + return New(value); +} + +inline +imp::Factory::return_t +New(std::string const& value) { // NOLINT(build/include_what_you_use) + return New(value); +} + +inline +imp::Factory::return_t +New(const char * value, int length) { + return New(value, length); +} + +inline +imp::Factory::return_t +New(const uint16_t * value, int length) { + return New(value, length); +} + +inline +imp::Factory::return_t +New(const char * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(const uint16_t * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(v8::String::ExternalStringResource * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(ExternalOneByteStringResource * value) { + return New(value); +} + +inline +imp::Factory::return_t +New(v8::Local pattern, v8::RegExp::Flags flags) { + return New(pattern, flags); +} + +#endif // NAN_NEW_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_object_wrap.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_object_wrap.h new file mode 100644 index 00000000..386affaa --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_object_wrap.h @@ -0,0 +1,156 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_OBJECT_WRAP_H_ +#define NAN_OBJECT_WRAP_H_ + +class ObjectWrap { + public: + ObjectWrap() { + refs_ = 0; + } + + + virtual ~ObjectWrap() { + if (persistent().IsEmpty()) { + return; + } + + persistent().ClearWeak(); + persistent().Reset(); + } + + + template + static inline T* Unwrap(v8::Local object) { + assert(!object.IsEmpty()); + assert(object->InternalFieldCount() > 0); + // Cast to ObjectWrap before casting to T. A direct cast from void + // to T won't work right when T has more than one base class. + void* ptr = GetInternalFieldPointer(object, 0); + ObjectWrap* wrap = static_cast(ptr); + return static_cast(wrap); + } + + + inline v8::Local handle() const { + return New(handle_); + } + + + inline Persistent& persistent() { + return handle_; + } + + + protected: + inline void Wrap(v8::Local object) { + assert(persistent().IsEmpty()); + assert(object->InternalFieldCount() > 0); + SetInternalFieldPointer(object, 0, this); + persistent().Reset(object); + MakeWeak(); + } + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + + inline void MakeWeak() { + persistent().v8::PersistentBase::SetWeak( + this, WeakCallback, v8::WeakCallbackType::kParameter); +#if NODE_MAJOR_VERSION < 10 + // FIXME(bnoordhuis) Probably superfluous in older Node.js versions too. + persistent().MarkIndependent(); +#endif + } + +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + + inline void MakeWeak() { + persistent().v8::PersistentBase::SetWeak(this, WeakCallback); + persistent().MarkIndependent(); + } + +#else + + inline void MakeWeak() { + persistent().persistent.MakeWeak(this, WeakCallback); + persistent().MarkIndependent(); + } + +#endif + + /* Ref() marks the object as being attached to an event loop. + * Refed objects will not be garbage collected, even if + * all references are lost. + */ + virtual void Ref() { + assert(!persistent().IsEmpty()); + persistent().ClearWeak(); + refs_++; + } + + /* Unref() marks an object as detached from the event loop. This is its + * default state. When an object with a "weak" reference changes from + * attached to detached state it will be freed. Be careful not to access + * the object after making this call as it might be gone! + * (A "weak reference" means an object that only has a + * persistant handle.) + * + * DO NOT CALL THIS FROM DESTRUCTOR + */ + virtual void Unref() { + assert(!persistent().IsEmpty()); + assert(!persistent().IsWeak()); + assert(refs_ > 0); + if (--refs_ == 0) + MakeWeak(); + } + + int refs_; // ro + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap) +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + + static void + WeakCallback(v8::WeakCallbackInfo const& info) { + ObjectWrap* wrap = info.GetParameter(); + assert(wrap->refs_ == 0); + wrap->handle_.Reset(); + delete wrap; + } + +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + + static void + WeakCallback(v8::WeakCallbackData const& data) { + ObjectWrap* wrap = data.GetParameter(); + assert(wrap->refs_ == 0); + assert(wrap->handle_.IsNearDeath()); + wrap->handle_.Reset(); + delete wrap; + } + +#else + + static void WeakCallback(v8::Persistent value, void *data) { + ObjectWrap *wrap = static_cast(data); + assert(wrap->refs_ == 0); + assert(wrap->handle_.IsNearDeath()); + wrap->handle_.Reset(); + delete wrap; + } + +#endif + Persistent handle_; +}; + + +#endif // NAN_OBJECT_WRAP_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_persistent_12_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_persistent_12_inl.h new file mode 100644 index 00000000..d9649e86 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_persistent_12_inl.h @@ -0,0 +1,132 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_PERSISTENT_12_INL_H_ +#define NAN_PERSISTENT_12_INL_H_ + +template class Persistent : + public v8::Persistent { + public: + inline Persistent() : v8::Persistent() {} + + template inline Persistent(v8::Local that) : + v8::Persistent(v8::Isolate::GetCurrent(), that) {} + + template + inline + Persistent(const v8::Persistent &that) : // NOLINT(runtime/explicit) + v8::Persistent(v8::Isolate::GetCurrent(), that) {} + + inline void Reset() { v8::PersistentBase::Reset(); } + + template + inline void Reset(const v8::Local &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void Reset(const v8::PersistentBase &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type); + + private: + inline T *operator*() const { return *PersistentBase::persistent; } + + template + inline void Copy(const Persistent &that) { + TYPE_CHECK(T, S); + + this->Reset(); + + if (!that.IsEmpty()) { + this->Reset(that); + M::Copy(that, this); + } + } +}; + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +template +class Global : public v8::Global { + public: + inline Global() : v8::Global() {} + + template inline Global(v8::Local that) : + v8::Global(v8::Isolate::GetCurrent(), that) {} + + template + inline + Global(const v8::PersistentBase &that) : // NOLINT(runtime/explicit) + v8::Global(v8::Isolate::GetCurrent(), that) {} + + inline void Reset() { v8::PersistentBase::Reset(); } + + template + inline void Reset(const v8::Local &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void Reset(const v8::PersistentBase &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type) { + reinterpret_cast*>(this)->SetWeak( + parameter, callback, type); + } +}; +#else +template +class Global : public v8::UniquePersistent { + public: + inline Global() : v8::UniquePersistent() {} + + template inline Global(v8::Local that) : + v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} + + template + inline + Global(const v8::PersistentBase &that) : // NOLINT(runtime/explicit) + v8::UniquePersistent(v8::Isolate::GetCurrent(), that) {} + + inline void Reset() { v8::PersistentBase::Reset(); } + + template + inline void Reset(const v8::Local &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void Reset(const v8::PersistentBase &other) { + v8::PersistentBase::Reset(v8::Isolate::GetCurrent(), other); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type) { + reinterpret_cast*>(this)->SetWeak( + parameter, callback, type); + } +}; +#endif + +#endif // NAN_PERSISTENT_12_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_persistent_pre_12_inl.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_persistent_pre_12_inl.h new file mode 100644 index 00000000..4c9c59da --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_persistent_pre_12_inl.h @@ -0,0 +1,242 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_PERSISTENT_PRE_12_INL_H_ +#define NAN_PERSISTENT_PRE_12_INL_H_ + +template +class PersistentBase { + v8::Persistent persistent; + template + friend v8::Local New(const PersistentBase &p); + template + friend v8::Local New(const Persistent &p); + template + friend v8::Local New(const Global &p); + template friend class ReturnValue; + + public: + inline PersistentBase() : + persistent() {} + + inline void Reset() { + persistent.Dispose(); + persistent.Clear(); + } + + template + inline void Reset(const v8::Local &other) { + TYPE_CHECK(T, S); + + if (!persistent.IsEmpty()) { + persistent.Dispose(); + } + + if (other.IsEmpty()) { + persistent.Clear(); + } else { + persistent = v8::Persistent::New(other); + } + } + + template + inline void Reset(const PersistentBase &other) { + TYPE_CHECK(T, S); + + if (!persistent.IsEmpty()) { + persistent.Dispose(); + } + + if (other.IsEmpty()) { + persistent.Clear(); + } else { + persistent = v8::Persistent::New(other.persistent); + } + } + + inline bool IsEmpty() const { return persistent.IsEmpty(); } + + inline void Empty() { persistent.Clear(); } + + template + inline bool operator==(const PersistentBase &that) const { + return this->persistent == that.persistent; + } + + template + inline bool operator==(const v8::Local &that) const { + return this->persistent == that; + } + + template + inline bool operator!=(const PersistentBase &that) const { + return !operator==(that); + } + + template + inline bool operator!=(const v8::Local &that) const { + return !operator==(that); + } + + template + inline void SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type); + + inline void ClearWeak() { persistent.ClearWeak(); } + + inline void MarkIndependent() { persistent.MarkIndependent(); } + + inline bool IsIndependent() const { return persistent.IsIndependent(); } + + inline bool IsNearDeath() const { return persistent.IsNearDeath(); } + + inline bool IsWeak() const { return persistent.IsWeak(); } + + private: + inline explicit PersistentBase(v8::Persistent that) : + persistent(that) { } + inline explicit PersistentBase(T *val) : persistent(val) {} + template friend class Persistent; + template friend class Global; + friend class ObjectWrap; +}; + +template +class NonCopyablePersistentTraits { + public: + typedef Persistent > + NonCopyablePersistent; + static const bool kResetInDestructor = false; + template + inline static void Copy(const Persistent &source, + NonCopyablePersistent *dest) { + Uncompilable(); + } + + template inline static void Uncompilable() { + TYPE_CHECK(O, v8::Primitive); + } +}; + +template +struct CopyablePersistentTraits { + typedef Persistent > CopyablePersistent; + static const bool kResetInDestructor = true; + template + static inline void Copy(const Persistent &source, + CopyablePersistent *dest) {} +}; + +template class Persistent : + public PersistentBase { + public: + inline Persistent() {} + + template inline Persistent(v8::Handle that) + : PersistentBase(v8::Persistent::New(that)) { + TYPE_CHECK(T, S); + } + + inline Persistent(const Persistent &that) : PersistentBase() { + Copy(that); + } + + template + inline Persistent(const Persistent &that) : + PersistentBase() { + Copy(that); + } + + inline Persistent &operator=(const Persistent &that) { + Copy(that); + return *this; + } + + template + inline Persistent &operator=(const Persistent &that) { + Copy(that); + return *this; + } + + inline ~Persistent() { + if (M::kResetInDestructor) this->Reset(); + } + + private: + inline T *operator*() const { return *PersistentBase::persistent; } + + template + inline void Copy(const Persistent &that) { + TYPE_CHECK(T, S); + + this->Reset(); + + if (!that.IsEmpty()) { + this->persistent = v8::Persistent::New(that.persistent); + M::Copy(that, this); + } + } +}; + +template +class Global : public PersistentBase { + struct RValue { + inline explicit RValue(Global* obj) : object(obj) {} + Global* object; + }; + + public: + inline Global() : PersistentBase(0) { } + + template + inline Global(v8::Local that) // NOLINT(runtime/explicit) + : PersistentBase(v8::Persistent::New(that)) { + TYPE_CHECK(T, S); + } + + template + inline Global(const PersistentBase &that) // NOLINT(runtime/explicit) + : PersistentBase(that) { + TYPE_CHECK(T, S); + } + /** + * Move constructor. + */ + inline Global(RValue rvalue) // NOLINT(runtime/explicit) + : PersistentBase(rvalue.object->persistent) { + rvalue.object->Reset(); + } + inline ~Global() { this->Reset(); } + /** + * Move via assignment. + */ + template + inline Global &operator=(Global rhs) { + TYPE_CHECK(T, S); + this->Reset(rhs.persistent); + rhs.Reset(); + return *this; + } + /** + * Cast operator for moves. + */ + inline operator RValue() { return RValue(this); } + /** + * Pass allows returning uniques from functions, etc. + */ + Global Pass() { return Global(RValue(this)); } + + private: + Global(Global &); + void operator=(Global &); + template friend class ReturnValue; +}; + +#endif // NAN_PERSISTENT_PRE_12_INL_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_private.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_private.h new file mode 100644 index 00000000..15f44cc8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_private.h @@ -0,0 +1,73 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_PRIVATE_H_ +#define NAN_PRIVATE_H_ + +inline Maybe +HasPrivate(v8::Local object, v8::Local key) { + HandleScope scope; +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::Local context = isolate->GetCurrentContext(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + return object->HasPrivate(context, private_key); +#else + return Just(!object->GetHiddenValue(key).IsEmpty()); +#endif +} + +inline MaybeLocal +GetPrivate(v8::Local object, v8::Local key) { +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::EscapableHandleScope scope(isolate); + v8::Local context = isolate->GetCurrentContext(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + v8::MaybeLocal v = object->GetPrivate(context, private_key); + return scope.Escape(v.ToLocalChecked()); +#else + EscapableHandleScope scope; + v8::Local v = object->GetHiddenValue(key); + if (v.IsEmpty()) { + v = Undefined(); + } + return scope.Escape(v); +#endif +} + +inline Maybe SetPrivate( + v8::Local object, + v8::Local key, + v8::Local value) { +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + HandleScope scope; + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::Local context = isolate->GetCurrentContext(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + return object->SetPrivate(context, private_key, value); +#else + return Just(object->SetHiddenValue(key, value)); +#endif +} + +inline Maybe DeletePrivate( + v8::Local object, + v8::Local key) { +#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION + HandleScope scope; + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + v8::Local private_key = v8::Private::ForApi(isolate, key); + return object->DeletePrivate(isolate->GetCurrentContext(), private_key); +#else + return Just(object->DeleteHiddenValue(key)); +#endif +} + +#endif // NAN_PRIVATE_H_ + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_string_bytes.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_string_bytes.h new file mode 100644 index 00000000..a2e6437d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_string_bytes.h @@ -0,0 +1,305 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +#ifndef NAN_STRING_BYTES_H_ +#define NAN_STRING_BYTES_H_ + +// Decodes a v8::Local or Buffer to a raw char* + +namespace imp { + +using v8::Local; +using v8::Object; +using v8::String; +using v8::Value; + + +//// Base 64 //// + +#define base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4) + + + +//// HEX //// + +static bool contains_non_ascii_slow(const char* buf, size_t len) { + for (size_t i = 0; i < len; ++i) { + if (buf[i] & 0x80) return true; + } + return false; +} + + +static bool contains_non_ascii(const char* src, size_t len) { + if (len < 16) { + return contains_non_ascii_slow(src, len); + } + + const unsigned bytes_per_word = sizeof(void*); + const unsigned align_mask = bytes_per_word - 1; + const unsigned unaligned = reinterpret_cast(src) & align_mask; + + if (unaligned > 0) { + const unsigned n = bytes_per_word - unaligned; + if (contains_non_ascii_slow(src, n)) return true; + src += n; + len -= n; + } + + +#if defined(__x86_64__) || defined(_WIN64) + const uintptr_t mask = 0x8080808080808080ll; +#else + const uintptr_t mask = 0x80808080l; +#endif + + const uintptr_t* srcw = reinterpret_cast(src); + + for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) { + if (srcw[i] & mask) return true; + } + + const unsigned remainder = len & align_mask; + if (remainder > 0) { + const size_t offset = len - remainder; + if (contains_non_ascii_slow(src + offset, remainder)) return true; + } + + return false; +} + + +static void force_ascii_slow(const char* src, char* dst, size_t len) { + for (size_t i = 0; i < len; ++i) { + dst[i] = src[i] & 0x7f; + } +} + + +static void force_ascii(const char* src, char* dst, size_t len) { + if (len < 16) { + force_ascii_slow(src, dst, len); + return; + } + + const unsigned bytes_per_word = sizeof(void*); + const unsigned align_mask = bytes_per_word - 1; + const unsigned src_unalign = reinterpret_cast(src) & align_mask; + const unsigned dst_unalign = reinterpret_cast(dst) & align_mask; + + if (src_unalign > 0) { + if (src_unalign == dst_unalign) { + const unsigned unalign = bytes_per_word - src_unalign; + force_ascii_slow(src, dst, unalign); + src += unalign; + dst += unalign; + len -= src_unalign; + } else { + force_ascii_slow(src, dst, len); + return; + } + } + +#if defined(__x86_64__) || defined(_WIN64) + const uintptr_t mask = ~0x8080808080808080ll; +#else + const uintptr_t mask = ~0x80808080l; +#endif + + const uintptr_t* srcw = reinterpret_cast(src); + uintptr_t* dstw = reinterpret_cast(dst); + + for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) { + dstw[i] = srcw[i] & mask; + } + + const unsigned remainder = len & align_mask; + if (remainder > 0) { + const size_t offset = len - remainder; + force_ascii_slow(src + offset, dst + offset, remainder); + } +} + + +static size_t base64_encode(const char* src, + size_t slen, + char* dst, + size_t dlen) { + // We know how much we'll write, just make sure that there's space. + assert(dlen >= base64_encoded_size(slen) && + "not enough space provided for base64 encode"); + + dlen = base64_encoded_size(slen); + + unsigned a; + unsigned b; + unsigned c; + unsigned i; + unsigned k; + unsigned n; + + static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + + i = 0; + k = 0; + n = slen / 3 * 3; + + while (i < n) { + a = src[i + 0] & 0xff; + b = src[i + 1] & 0xff; + c = src[i + 2] & 0xff; + + dst[k + 0] = table[a >> 2]; + dst[k + 1] = table[((a & 3) << 4) | (b >> 4)]; + dst[k + 2] = table[((b & 0x0f) << 2) | (c >> 6)]; + dst[k + 3] = table[c & 0x3f]; + + i += 3; + k += 4; + } + + if (n != slen) { + switch (slen - n) { + case 1: + a = src[i + 0] & 0xff; + dst[k + 0] = table[a >> 2]; + dst[k + 1] = table[(a & 3) << 4]; + dst[k + 2] = '='; + dst[k + 3] = '='; + break; + + case 2: + a = src[i + 0] & 0xff; + b = src[i + 1] & 0xff; + dst[k + 0] = table[a >> 2]; + dst[k + 1] = table[((a & 3) << 4) | (b >> 4)]; + dst[k + 2] = table[(b & 0x0f) << 2]; + dst[k + 3] = '='; + break; + } + } + + return dlen; +} + + +static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) { + // We know how much we'll write, just make sure that there's space. + assert(dlen >= slen * 2 && + "not enough space provided for hex encode"); + + dlen = slen * 2; + for (uint32_t i = 0, k = 0; k < dlen; i += 1, k += 2) { + static const char hex[] = "0123456789abcdef"; + uint8_t val = static_cast(src[i]); + dst[k + 0] = hex[val >> 4]; + dst[k + 1] = hex[val & 15]; + } + + return dlen; +} + + + +static Local Encode(const char* buf, + size_t buflen, + enum Encoding encoding) { + assert(buflen <= node::Buffer::kMaxLength); + if (!buflen && encoding != BUFFER) + return New("").ToLocalChecked(); + + Local val; + switch (encoding) { + case BUFFER: + return CopyBuffer(buf, buflen).ToLocalChecked(); + + case ASCII: + if (contains_non_ascii(buf, buflen)) { + char* out = new char[buflen]; + force_ascii(buf, out, buflen); + val = New(out, buflen).ToLocalChecked(); + delete[] out; + } else { + val = New(buf, buflen).ToLocalChecked(); + } + break; + + case UTF8: + val = New(buf, buflen).ToLocalChecked(); + break; + + case BINARY: { + // TODO(isaacs) use ExternalTwoByteString? + const unsigned char *cbuf = reinterpret_cast(buf); + uint16_t * twobytebuf = new uint16_t[buflen]; + for (size_t i = 0; i < buflen; i++) { + // XXX is the following line platform independent? + twobytebuf[i] = cbuf[i]; + } + val = New(twobytebuf, buflen).ToLocalChecked(); + delete[] twobytebuf; + break; + } + + case BASE64: { + size_t dlen = base64_encoded_size(buflen); + char* dst = new char[dlen]; + + size_t written = base64_encode(buf, buflen, dst, dlen); + assert(written == dlen); + + val = New(dst, dlen).ToLocalChecked(); + delete[] dst; + break; + } + + case UCS2: { + const uint16_t* data = reinterpret_cast(buf); + val = New(data, buflen / 2).ToLocalChecked(); + break; + } + + case HEX: { + size_t dlen = buflen * 2; + char* dst = new char[dlen]; + size_t written = hex_encode(buf, buflen, dst, dlen); + assert(written == dlen); + + val = New(dst, dlen).ToLocalChecked(); + delete[] dst; + break; + } + + default: + assert(0 && "unknown encoding"); + break; + } + + return val; +} + +#undef base64_encoded_size + +} // end of namespace imp + +#endif // NAN_STRING_BYTES_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_typedarray_contents.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_typedarray_contents.h new file mode 100644 index 00000000..d28ae323 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_typedarray_contents.h @@ -0,0 +1,90 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_TYPEDARRAY_CONTENTS_H_ +#define NAN_TYPEDARRAY_CONTENTS_H_ + +template +class TypedArrayContents { + public: + inline explicit TypedArrayContents(v8::Local from) : + length_(0), data_(NULL) { + HandleScope scope; + + size_t length = 0; + void* data = NULL; + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + + if (from->IsArrayBufferView()) { + v8::Local array = + v8::Local::Cast(from); + + const size_t byte_length = array->ByteLength(); + const ptrdiff_t byte_offset = array->ByteOffset(); + v8::Local buffer = array->Buffer(); + + length = byte_length / sizeof(T); + data = static_cast(buffer->GetContents().Data()) + byte_offset; + } + +#else + + if (from->IsObject() && !from->IsNull()) { + v8::Local array = v8::Local::Cast(from); + + MaybeLocal buffer = Get(array, + New("buffer").ToLocalChecked()); + MaybeLocal byte_length = Get(array, + New("byteLength").ToLocalChecked()); + MaybeLocal byte_offset = Get(array, + New("byteOffset").ToLocalChecked()); + + if (!buffer.IsEmpty() && + !byte_length.IsEmpty() && byte_length.ToLocalChecked()->IsUint32() && + !byte_offset.IsEmpty() && byte_offset.ToLocalChecked()->IsUint32()) { + data = array->GetIndexedPropertiesExternalArrayData(); + if(data) { + length = byte_length.ToLocalChecked()->Uint32Value() / sizeof(T); + } + } + } + +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1900 || __cplusplus >= 201103L + assert(reinterpret_cast(data) % alignof (T) == 0); +#elif defined(_MSC_VER) && _MSC_VER >= 1600 || defined(__GNUC__) + assert(reinterpret_cast(data) % __alignof(T) == 0); +#else + assert(reinterpret_cast(data) % sizeof (T) == 0); +#endif + + length_ = length; + data_ = static_cast(data); + } + + inline size_t length() const { return length_; } + inline T* operator*() { return data_; } + inline const T* operator*() const { return data_; } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(TypedArrayContents) + + //Disable heap allocation + void *operator new(size_t size); + void operator delete(void *, size_t) { + abort(); + } + + size_t length_; + T* data_; +}; + +#endif // NAN_TYPEDARRAY_CONTENTS_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_weak.h b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_weak.h new file mode 100644 index 00000000..7e7ab07b --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/nan_weak.h @@ -0,0 +1,437 @@ +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +#ifndef NAN_WEAK_H_ +#define NAN_WEAK_H_ + +static const int kInternalFieldsInWeakCallback = 2; +static const int kNoInternalFieldIndex = -1; + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ + v8::WeakCallbackInfo > const& +# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION +# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ + v8::PhantomCallbackData > const& +# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \ + v8::PhantomCallbackData > const& +# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \ + v8::InternalFieldsCallbackData, void> const& +# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +# define NAN_WEAK_CALLBACK_DATA_TYPE_ \ + v8::WeakCallbackData > const& +# define NAN_WEAK_CALLBACK_SIG_ NAN_WEAK_CALLBACK_DATA_TYPE_ +#else +# define NAN_WEAK_CALLBACK_DATA_TYPE_ void * +# define NAN_WEAK_CALLBACK_SIG_ \ + v8::Persistent, NAN_WEAK_CALLBACK_DATA_TYPE_ +#endif + +template +class WeakCallbackInfo { + public: + typedef void (*Callback)(const WeakCallbackInfo& data); + WeakCallbackInfo( + Persistent *persistent + , Callback callback + , void *parameter + , void *field1 = 0 + , void *field2 = 0) : + callback_(callback), isolate_(0), parameter_(parameter) { + std::memcpy(&persistent_, persistent, sizeof (v8::Persistent)); + internal_fields_[0] = field1; + internal_fields_[1] = field2; + } + inline v8::Isolate *GetIsolate() const { return isolate_; } + inline T *GetParameter() const { return static_cast(parameter_); } + inline void *GetInternalField(int index) const { + assert((index == 0 || index == 1) && "internal field index out of bounds"); + if (index == 0) { + return internal_fields_[0]; + } else { + return internal_fields_[1]; + } + } + + private: + NAN_DISALLOW_ASSIGN_COPY_MOVE(WeakCallbackInfo) + Callback callback_; + v8::Isolate *isolate_; + void *parameter_; + void *internal_fields_[kInternalFieldsInWeakCallback]; + v8::Persistent persistent_; + template friend class Persistent; + template friend class PersistentBase; +#if NODE_MODULE_VERSION <= NODE_0_12_MODULE_VERSION +# if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + template + static void invoke(NAN_WEAK_CALLBACK_SIG_ data); + template + static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data); +# else + static void invoke(NAN_WEAK_CALLBACK_SIG_ data); + static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data); +# endif +#else +# if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + template + static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data); + template + static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data); +# else + static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data); + static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data); +# endif + static WeakCallbackInfo *unwrapparameter( + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data); + static WeakCallbackInfo *unwraptwofield( + NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data); +#endif +}; + + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) + +template +template +void +WeakCallbackInfo::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrapparameter(data); + if (isFirstPass) { + cbinfo->persistent_.Reset(); + data.SetSecondPassCallback(invokeparameter); + } else { + cbinfo->callback_(*cbinfo); + delete cbinfo; + } +} + +template +template +void +WeakCallbackInfo::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwraptwofield(data); + if (isFirstPass) { + cbinfo->persistent_.Reset(); + data.SetSecondPassCallback(invoketwofield); + } else { + cbinfo->callback_(*cbinfo); + delete cbinfo; + } +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwrapparameter( + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetParameter()); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwraptwofield( + NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetInternalField(0)); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_ +#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +# elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION + +template +void +WeakCallbackInfo::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrapparameter(data); + cbinfo->persistent_.Reset(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +void +WeakCallbackInfo::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwraptwofield(data); + cbinfo->persistent_.Reset(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwrapparameter( + NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetParameter()); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwraptwofield( + NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data.GetInternalField1()); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_ +#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ +#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION + +template +template +void WeakCallbackInfo::invoke(NAN_WEAK_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrap(data); + cbinfo->persistent_.Reset(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +template +WeakCallbackInfo *WeakCallbackInfo::unwrap( + NAN_WEAK_CALLBACK_DATA_TYPE_ data) { + void *parameter = data.GetParameter(); + WeakCallbackInfo *cbinfo = + static_cast*>(parameter); + cbinfo->isolate_ = data.GetIsolate(); + return cbinfo; +} + +#undef NAN_WEAK_CALLBACK_SIG_ +#undef NAN_WEAK_CALLBACK_DATA_TYPE_ +#else + +template +void WeakCallbackInfo::invoke(NAN_WEAK_CALLBACK_SIG_ data) { + WeakCallbackInfo *cbinfo = unwrap(data); + cbinfo->persistent_.Dispose(); + cbinfo->persistent_.Clear(); + cbinfo->callback_(*cbinfo); + delete cbinfo; +} + +template +WeakCallbackInfo *WeakCallbackInfo::unwrap( + NAN_WEAK_CALLBACK_DATA_TYPE_ data) { + WeakCallbackInfo *cbinfo = + static_cast*>(data); + cbinfo->isolate_ = v8::Isolate::GetCurrent(); + return cbinfo; +} + +#undef NAN_WEAK_CALLBACK_SIG_ +#undef NAN_WEAK_CALLBACK_DATA_TYPE_ +#endif + +#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \ + (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3)) +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

*wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetWeak( + wcbd + , WeakCallbackInfo

::template invokeparameter + , type); + } else { + v8::Local* self_v(reinterpret_cast*>(this)); + assert((*self_v)->IsObject()); + v8::Local self((*self_v).As()); + int count = self->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = self->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + self->SetAlignedPointerInInternalField(0, wcbd); + v8::PersistentBase::SetWeak( + static_cast*>(0) + , WeakCallbackInfo

::template invoketwofield + , type); + } +} +#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

*wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetPhantom( + wcbd + , WeakCallbackInfo

::invokeparameter); + } else { + v8::Local* self_v(reinterpret_cast*>(this)); + assert((*self_v)->IsObject()); + v8::Local self((*self_v).As()); + int count = self->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = self->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + self->SetAlignedPointerInInternalField(0, wcbd); + v8::PersistentBase::SetPhantom( + static_cast*>(0) + , WeakCallbackInfo

::invoketwofield + , 0 + , count > 1 ? 1 : kNoInternalFieldIndex); + } +} +#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

*wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetPhantom( + wcbd + , WeakCallbackInfo

::invokeparameter); + } else { + v8::Local* self_v(reinterpret_cast*>(this)); + assert((*self_v)->IsObject()); + v8::Local self((*self_v).As()); + int count = self->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = self->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + self->SetAlignedPointerInInternalField(0, wcbd); + v8::PersistentBase::SetPhantom( + WeakCallbackInfo

::invoketwofield + , 0 + , count > 1 ? 1 : kNoInternalFieldIndex); + } +} +#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION +template +template +inline void Persistent::SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

*wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , parameter); + v8::PersistentBase::SetWeak(wcbd, WeakCallbackInfo

::invoke); + } else { + v8::Local* self_v(reinterpret_cast*>(this)); + assert((*self_v)->IsObject()); + v8::Local self((*self_v).As()); + int count = self->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = self->GetAlignedPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + v8::PersistentBase::SetWeak(wcbd, WeakCallbackInfo

::invoke); + } +} +#else +template +template +inline void PersistentBase::SetWeak( + P *parameter + , typename WeakCallbackInfo

::Callback callback + , WeakCallbackType type) { + WeakCallbackInfo

*wcbd; + if (type == WeakCallbackType::kParameter) { + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , parameter); + persistent.MakeWeak(wcbd, WeakCallbackInfo

::invoke); + } else { + v8::Local* self_v(reinterpret_cast*>(this)); + assert((*self_v)->IsObject()); + v8::Local self((*self_v).As()); + int count = self->InternalFieldCount(); + void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0}; + for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) { + internal_fields[i] = self->GetPointerFromInternalField(i); + } + wcbd = new WeakCallbackInfo

( + reinterpret_cast*>(this) + , callback + , 0 + , internal_fields[0] + , internal_fields[1]); + persistent.MakeWeak(wcbd, WeakCallbackInfo

::invoke); + } +} +#endif + +#endif // NAN_WEAK_H_ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/package.json new file mode 100644 index 00000000..3498e80f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/package.json @@ -0,0 +1,98 @@ +{ + "_from": "nan@^2.13.2", + "_id": "nan@2.13.2", + "_inBundle": false, + "_integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", + "_location": "/node-red-contrib-johnny-five/nan", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "nan@^2.13.2", + "name": "nan", + "escapedName": "nan", + "rawSpec": "^2.13.2", + "saveSpec": null, + "fetchSpec": "^2.13.2" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/@serialport/bindings" + ], + "_resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "_shasum": "f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7", + "_spec": "nan@^2.13.2", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/@serialport/bindings", + "bugs": { + "url": "https://github.com/nodejs/nan/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Rod Vagg", + "email": "r@va.gg", + "url": "https://github.com/rvagg" + }, + { + "name": "Benjamin Byholm", + "email": "bbyholm@abo.fi", + "url": "https://github.com/kkoopa/" + }, + { + "name": "Trevor Norris", + "email": "trev.norris@gmail.com", + "url": "https://github.com/trevnorris" + }, + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "https://github.com/TooTallNate" + }, + { + "name": "Brett Lawson", + "email": "brett19@gmail.com", + "url": "https://github.com/brett19" + }, + { + "name": "Ben Noordhuis", + "email": "info@bnoordhuis.nl", + "url": "https://github.com/bnoordhuis" + }, + { + "name": "David Siegel", + "email": "david@artcom.de", + "url": "https://github.com/agnat" + }, + { + "name": "Michael Ira Krufky", + "email": "mkrufky@gmail.com", + "url": "https://github.com/mkrufky" + } + ], + "deprecated": false, + "description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 11 compatibility", + "devDependencies": { + "bindings": "~1.2.1", + "commander": "^2.8.1", + "glob": "^5.0.14", + "node-gyp": "~3.6.2", + "readable-stream": "^2.1.4", + "request": "=2.81.0", + "tap": "~0.7.1", + "xtend": "~4.0.0" + }, + "homepage": "https://github.com/nodejs/nan#readme", + "license": "MIT", + "main": "include_dirs.js", + "name": "nan", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/nan.git" + }, + "scripts": { + "docs": "doc/.build.sh", + "rebuild-tests": "node-gyp rebuild --msvs_version=2015 --directory test", + "test": "tap --gc --stderr test/js/*-test.js", + "test:worker": "node --experimental-worker test/tap-as-worker.js --gc --stderr test/js/*-test.js" + }, + "version": "2.13.2" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/1to2.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/1to2.js new file mode 100755 index 00000000..337f8bf2 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/1to2.js @@ -0,0 +1,412 @@ +#!/usr/bin/env node +/********************************************************************* + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2018 NAN contributors + * + * MIT License + ********************************************************************/ + +var commander = require('commander'), + fs = require('fs'), + glob = require('glob'), + groups = [], + total = 0, + warning1 = '/* ERROR: Rewrite using Buffer */\n', + warning2 = '\\/\\* ERROR\\: Rewrite using Buffer \\*\\/\\n', + length, + i; + +fs.readFile(__dirname + '/package.json', 'utf8', function (err, data) { + if (err) { + throw err; + } + + commander + .version(JSON.parse(data).version) + .usage('[options] ') + .parse(process.argv); + + if (!process.argv.slice(2).length) { + commander.outputHelp(); + } +}); + +/* construct strings representing regular expressions + each expression contains a unique group allowing for identification of the match + the index of this key group, relative to the regular expression in question, + is indicated by the first array member */ + +/* simple substistutions, key group is the entire match, 0 */ +groups.push([0, [ + '_NAN_', + 'NODE_SET_METHOD', + 'NODE_SET_PROTOTYPE_METHOD', + 'NanAsciiString', + 'NanEscapeScope', + 'NanReturnValue', + 'NanUcs2String'].join('|')]); + +/* substitutions of parameterless macros, key group is 1 */ +groups.push([1, ['(', [ + 'NanEscapableScope', + 'NanReturnNull', + 'NanReturnUndefined', + 'NanScope'].join('|'), ')\\(\\)'].join('')]); + +/* replace TryCatch with NanTryCatch once, gobbling possible namespace, key group 2 */ +groups.push([2, '(?:(?:v8\\:\\:)?|(Nan)?)(TryCatch)']); + +/* NanNew("string") will likely not fail a ToLocalChecked(), key group 1 */ +groups.push([1, ['(NanNew)', '(\\("[^\\"]*"[^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]); + +/* Removed v8 APIs, warn that the code needs rewriting using node::Buffer, key group 2 */ +groups.push([2, ['(', warning2, ')?', '^.*?(', [ + 'GetIndexedPropertiesExternalArrayDataLength', + 'GetIndexedPropertiesExternalArrayData', + 'GetIndexedPropertiesExternalArrayDataType', + 'GetIndexedPropertiesPixelData', + 'GetIndexedPropertiesPixelDataLength', + 'HasIndexedPropertiesInExternalArrayData', + 'HasIndexedPropertiesInPixelData', + 'SetIndexedPropertiesToExternalArrayData', + 'SetIndexedPropertiesToPixelData'].join('|'), ')'].join('')]); + +/* No need for NanScope in V8-exposed methods, key group 2 */ +groups.push([2, ['((', [ + 'NAN_METHOD', + 'NAN_GETTER', + 'NAN_SETTER', + 'NAN_PROPERTY_GETTER', + 'NAN_PROPERTY_SETTER', + 'NAN_PROPERTY_ENUMERATOR', + 'NAN_PROPERTY_DELETER', + 'NAN_PROPERTY_QUERY', + 'NAN_INDEX_GETTER', + 'NAN_INDEX_SETTER', + 'NAN_INDEX_ENUMERATOR', + 'NAN_INDEX_DELETER', + 'NAN_INDEX_QUERY'].join('|'), ')\\([^\\)]*\\)\\s*\\{)\\s*NanScope\\(\\)\\s*;'].join('')]); + +/* v8::Value::ToXXXXXXX returns v8::MaybeLocal, key group 3 */ +groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->(', [ + 'Boolean', + 'Number', + 'String', + 'Object', + 'Integer', + 'Uint32', + 'Int32'].join('|'), ')\\('].join('')]); + +/* v8::Value::XXXXXXXValue returns v8::Maybe, key group 3 */ +groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->((?:', [ + 'Boolean', + 'Number', + 'Integer', + 'Uint32', + 'Int32'].join('|'), ')Value)\\('].join('')]); + +/* NAN_WEAK_CALLBACK macro was removed, write out callback definition, key group 1 */ +groups.push([1, '(NAN_WEAK_CALLBACK)\\(([^\\s\\)]+)\\)']); + +/* node::ObjectWrap and v8::Persistent have been replaced with Nan implementations, key group 1 */ +groups.push([1, ['(', [ + 'NanDisposePersistent', + 'NanObjectWrapHandle'].join('|'), ')\\s*\\(\\s*([^\\s\\)]+)'].join('')]); + +/* Since NanPersistent there is no need for NanMakeWeakPersistent, key group 1 */ +groups.push([1, '(NanMakeWeakPersistent)\\s*\\(\\s*([^\\s,]+)\\s*,\\s*']); + +/* Many methods of v8::Object and others now return v8::MaybeLocal, key group 3 */ +groups.push([3, ['([\\s])([^\\s]+)->(', [ + 'GetEndColumn', + 'GetFunction', + 'GetLineNumber', + 'NewInstance', + 'GetPropertyNames', + 'GetOwnPropertyNames', + 'GetSourceLine', + 'GetStartColumn', + 'ObjectProtoToString', + 'ToArrayIndex', + 'ToDetailString', + 'CallAsConstructor', + 'CallAsFunction', + 'CloneElementAt', + 'Delete', + 'ForceSet', + 'Get', + 'GetPropertyAttributes', + 'GetRealNamedProperty', + 'GetRealNamedPropertyInPrototypeChain', + 'Has', + 'HasOwnProperty', + 'HasRealIndexedProperty', + 'HasRealNamedCallbackProperty', + 'HasRealNamedProperty', + 'Set', + 'SetAccessor', + 'SetIndexedPropertyHandler', + 'SetNamedPropertyHandler', + 'SetPrototype'].join('|'), ')\\('].join('')]); + +/* You should get an error if any of these fail anyways, + or handle the error better, it is indicated either way, key group 2 */ +groups.push([2, ['NanNew(<(?:v8\\:\\:)?(', ['Date', 'String', 'RegExp'].join('|'), ')>)(\\([^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]); + +/* v8::Value::Equals now returns a v8::Maybe, key group 3 */ +groups.push([3, '([\\s\\(\\)])([^\\s\\(\\)]+)->(Equals)\\(([^\\s\\)]+)']); + +/* NanPersistent makes this unnecessary, key group 1 */ +groups.push([1, '(NanAssignPersistent)(?:]+>)?\\(([^,]+),\\s*']); + +/* args has been renamed to info, key group 2 */ +groups.push([2, '(\\W)(args)(\\W)']) + +/* node::ObjectWrap was replaced with NanObjectWrap, key group 2 */ +groups.push([2, '(\\W)(?:node\\:\\:)?(ObjectWrap)(\\W)']); + +/* v8::Persistent was replaced with NanPersistent, key group 2 */ +groups.push([2, '(\\W)(?:v8\\:\\:)?(Persistent)(\\W)']); + +/* counts the number of capturing groups in a well-formed regular expression, + ignoring non-capturing groups and escaped parentheses */ +function groupcount(s) { + var positive = s.match(/\((?!\?)/g), + negative = s.match(/\\\(/g); + return (positive ? positive.length : 0) - (negative ? negative.length : 0); +} + +/* compute the absolute position of each key group in the joined master RegExp */ +for (i = 1, length = groups.length; i < length; i++) { + total += groupcount(groups[i - 1][1]); + groups[i][0] += total; +} + +/* create the master RegExp, whis is the union of all the groups' expressions */ +master = new RegExp(groups.map(function (a) { return a[1]; }).join('|'), 'gm'); + +/* replacement function for String.replace, receives 21 arguments */ +function replace() { + /* simple expressions */ + switch (arguments[groups[0][0]]) { + case '_NAN_': + return 'NAN_'; + case 'NODE_SET_METHOD': + return 'NanSetMethod'; + case 'NODE_SET_PROTOTYPE_METHOD': + return 'NanSetPrototypeMethod'; + case 'NanAsciiString': + return 'NanUtf8String'; + case 'NanEscapeScope': + return 'scope.Escape'; + case 'NanReturnNull': + return 'info.GetReturnValue().SetNull'; + case 'NanReturnValue': + return 'info.GetReturnValue().Set'; + case 'NanUcs2String': + return 'v8::String::Value'; + default: + } + + /* macros without arguments */ + switch (arguments[groups[1][0]]) { + case 'NanEscapableScope': + return 'NanEscapableScope scope' + case 'NanReturnUndefined': + return 'return'; + case 'NanScope': + return 'NanScope scope'; + default: + } + + /* TryCatch, emulate negative backref */ + if (arguments[groups[2][0]] === 'TryCatch') { + return arguments[groups[2][0] - 1] ? arguments[0] : 'NanTryCatch'; + } + + /* NanNew("foo") --> NanNew("foo").ToLocalChecked() */ + if (arguments[groups[3][0]] === 'NanNew') { + return [arguments[0], '.ToLocalChecked()'].join(''); + } + + /* insert warning for removed functions as comment on new line above */ + switch (arguments[groups[4][0]]) { + case 'GetIndexedPropertiesExternalArrayData': + case 'GetIndexedPropertiesExternalArrayDataLength': + case 'GetIndexedPropertiesExternalArrayDataType': + case 'GetIndexedPropertiesPixelData': + case 'GetIndexedPropertiesPixelDataLength': + case 'HasIndexedPropertiesInExternalArrayData': + case 'HasIndexedPropertiesInPixelData': + case 'SetIndexedPropertiesToExternalArrayData': + case 'SetIndexedPropertiesToPixelData': + return arguments[groups[4][0] - 1] ? arguments[0] : [warning1, arguments[0]].join(''); + default: + } + + /* remove unnecessary NanScope() */ + switch (arguments[groups[5][0]]) { + case 'NAN_GETTER': + case 'NAN_METHOD': + case 'NAN_SETTER': + case 'NAN_INDEX_DELETER': + case 'NAN_INDEX_ENUMERATOR': + case 'NAN_INDEX_GETTER': + case 'NAN_INDEX_QUERY': + case 'NAN_INDEX_SETTER': + case 'NAN_PROPERTY_DELETER': + case 'NAN_PROPERTY_ENUMERATOR': + case 'NAN_PROPERTY_GETTER': + case 'NAN_PROPERTY_QUERY': + case 'NAN_PROPERTY_SETTER': + return arguments[groups[5][0] - 1]; + default: + } + + /* Value converstion */ + switch (arguments[groups[6][0]]) { + case 'Boolean': + case 'Int32': + case 'Integer': + case 'Number': + case 'Object': + case 'String': + case 'Uint32': + return [arguments[groups[6][0] - 2], 'NanTo(', arguments[groups[6][0] - 1]].join(''); + default: + } + + /* other value conversion */ + switch (arguments[groups[7][0]]) { + case 'BooleanValue': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + case 'Int32Value': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + case 'IntegerValue': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + case 'Uint32Value': + return [arguments[groups[7][0] - 2], 'NanTo(', arguments[groups[7][0] - 1]].join(''); + default: + } + + /* NAN_WEAK_CALLBACK */ + if (arguments[groups[8][0]] === 'NAN_WEAK_CALLBACK') { + return ['template\nvoid ', + arguments[groups[8][0] + 1], '(const NanWeakCallbackInfo &data)'].join(''); + } + + /* use methods on NAN classes instead */ + switch (arguments[groups[9][0]]) { + case 'NanDisposePersistent': + return [arguments[groups[9][0] + 1], '.Reset('].join(''); + case 'NanObjectWrapHandle': + return [arguments[groups[9][0] + 1], '->handle('].join(''); + default: + } + + /* use method on NanPersistent instead */ + if (arguments[groups[10][0]] === 'NanMakeWeakPersistent') { + return arguments[groups[10][0] + 1] + '.SetWeak('; + } + + /* These return Maybes, the upper ones take no arguments */ + switch (arguments[groups[11][0]]) { + case 'GetEndColumn': + case 'GetFunction': + case 'GetLineNumber': + case 'GetOwnPropertyNames': + case 'GetPropertyNames': + case 'GetSourceLine': + case 'GetStartColumn': + case 'NewInstance': + case 'ObjectProtoToString': + case 'ToArrayIndex': + case 'ToDetailString': + return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1]].join(''); + case 'CallAsConstructor': + case 'CallAsFunction': + case 'CloneElementAt': + case 'Delete': + case 'ForceSet': + case 'Get': + case 'GetPropertyAttributes': + case 'GetRealNamedProperty': + case 'GetRealNamedPropertyInPrototypeChain': + case 'Has': + case 'HasOwnProperty': + case 'HasRealIndexedProperty': + case 'HasRealNamedCallbackProperty': + case 'HasRealNamedProperty': + case 'Set': + case 'SetAccessor': + case 'SetIndexedPropertyHandler': + case 'SetNamedPropertyHandler': + case 'SetPrototype': + return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1], ', '].join(''); + default: + } + + /* Automatic ToLocalChecked(), take it or leave it */ + switch (arguments[groups[12][0]]) { + case 'Date': + case 'String': + case 'RegExp': + return ['NanNew', arguments[groups[12][0] - 1], arguments[groups[12][0] + 1], '.ToLocalChecked()'].join(''); + default: + } + + /* NanEquals is now required for uniformity */ + if (arguments[groups[13][0]] === 'Equals') { + return [arguments[groups[13][0] - 1], 'NanEquals(', arguments[groups[13][0] - 1], ', ', arguments[groups[13][0] + 1]].join(''); + } + + /* use method on replacement class instead */ + if (arguments[groups[14][0]] === 'NanAssignPersistent') { + return [arguments[groups[14][0] + 1], '.Reset('].join(''); + } + + /* args --> info */ + if (arguments[groups[15][0]] === 'args') { + return [arguments[groups[15][0] - 1], 'info', arguments[groups[15][0] + 1]].join(''); + } + + /* ObjectWrap --> NanObjectWrap */ + if (arguments[groups[16][0]] === 'ObjectWrap') { + return [arguments[groups[16][0] - 1], 'NanObjectWrap', arguments[groups[16][0] + 1]].join(''); + } + + /* Persistent --> NanPersistent */ + if (arguments[groups[17][0]] === 'Persistent') { + return [arguments[groups[17][0] - 1], 'NanPersistent', arguments[groups[17][0] + 1]].join(''); + } + + /* This should not happen. A switch is probably missing a case if it does. */ + throw 'Unhandled match: ' + arguments[0]; +} + +/* reads a file, runs replacement and writes it back */ +function processFile(file) { + fs.readFile(file, {encoding: 'utf8'}, function (err, data) { + if (err) { + throw err; + } + + /* run replacement twice, might need more runs */ + fs.writeFile(file, data.replace(master, replace).replace(master, replace), function (err) { + if (err) { + throw err; + } + }); + }); +} + +/* process file names from command line and process the identified files */ +for (i = 2, length = process.argv.length; i < length; i++) { + glob(process.argv[i], function (err, matches) { + if (err) { + throw err; + } + matches.forEach(processFile); + }); +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/README.md new file mode 100644 index 00000000..7f07e4b8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/README.md @@ -0,0 +1,14 @@ +1to2 naively converts source code files from NAN 1 to NAN 2. There will be erroneous conversions, +false positives and missed opportunities. The input files are rewritten in place. Make sure that +you have backups. You will have to manually review the changes afterwards and do some touchups. + +```sh +$ tools/1to2.js + + Usage: 1to2 [options] + + Options: + + -h, --help output usage information + -V, --version output the version number +``` diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/package.json new file mode 100644 index 00000000..2dcdd789 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nan/tools/package.json @@ -0,0 +1,19 @@ +{ + "name": "1to2", + "version": "1.0.0", + "description": "NAN 1 -> 2 Migration Script", + "main": "1to2.js", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/nan.git" + }, + "contributors": [ + "Benjamin Byholm (https://github.com/kkoopa/)", + "Mathias Küsel (https://github.com/mathiask88/)" + ], + "dependencies": { + "glob": "~5.0.10", + "commander": "~2.8.1" + }, + "license": "MIT" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/.npmignore new file mode 100644 index 00000000..787e6db8 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/.npmignore @@ -0,0 +1,3 @@ +.settings +.project +node_modules \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/.travis.yml new file mode 100644 index 00000000..b7d56e5c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/.travis.yml @@ -0,0 +1,6 @@ +language: node_js + +# test on node version 0.10.35 +node_js: + - 0.10.35 + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/README.md new file mode 100644 index 00000000..78812060 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/README.md @@ -0,0 +1,254 @@ +# nanoTimer +# Current Version - 0.3.10 + +![](https://api.travis-ci.org/Krb686/nanoTimer.png) + +[![NPM](https://nodei.co/npm/nanotimer.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/nanotimer/) + +A much higher accuracy timer object that makes use of the node.js [hrtime](http://nodejs.org/api/process.html#process_process_hrtime) function call. + +The nanotimer recreates the internal javascript timing functions with higher resolution. + +##Note + +- 1) With the normal timing functions, instead of dealing with the obscurities of multiple setTimeout and +setInterval calls, now there is a concrete timer object, each of which can handle exactly 1 timeOut and +setInterval task. This also means a reference is not needed to clear an interval since each timer object is +unique. + +- 2) Timer objects use the non-blocking feature **setImmediate** for time counting and synchronization. This requires node v0.10.13 or greater + +- 3) Errors in timing are also non-cumulative. For example, when using the setInterval command, the timer counts +and compares the time difference since starting against the interval length specified and if it has run past the interval, +it resets. If the code had an error of 1 millisecond delay, the timer would actually count to 1001 milliseconds before resetting, and that +1 millisecond error would propagate through each cycle and add up very quickly! To solve that problem, rather than resetting +the interval variable each cycle, it is instead incremented with each cycle count. So on the 2nd cycle, it compares to 2000 milliseconds, +and it may run to 2001. Then 3000 milliseconds, running to 3001, and so on. This is only limited by the comparison variable potentially overflowing, so I +somewhat arbitrarily chose a value of 8 quadrillion (max is roughly 9 quadrillion in javascript) before it resets. Even using nanosecond resolution however, +the comparison variable would reach 8 quadrillion every 8 million seconds, or every 93.6ish days. + +##Usage + +```js + +var NanoTimer = require('nanotimer'); + +var timerA = new NanoTimer(); + + +``` + +Each NanoTimer object can run other functions that are already defined. This can be done in 2 ways, either with a literal function object, or with a function declaration. + +### By function object +```js +var NanoTimer = require('nanotimer'); +var timerObject = new NanoTimer(); + + +var countToOneBillion = function () { + var i = 0; + while(i < 1000000000){ + i++; + } +}; + +var microsecs = timerObject.time(countToOneBillion, 'u'); +console.log(microsecs); +``` + +or something like this: + +### by function declaration + +```js +var NanoTimer = require('nanotimer'); + +function main(){ + var timerObject = new NanoTimer(); + + var microsecs = timerObject.time(countToOneBillion, 'u'); + console.log(microsecs); +} + +function countToOneBillion(){ + var i = 0; + while(i < 1000000000){ + i++; + } +} + +main(); +``` + +##Full example + +```js +var NanoTimer = require('nanotimer'); + +var count = 10; + + +function main(){ + var timer = new NanoTimer(); + + timer.setInterval(countDown, '', '1s'); + timer.setTimeout(liftOff, [timer], '10s'); + + + +} + +function countDown(){ + console.log('T - ' + count); + count--; +} + +function liftOff(timer){ + timer.clearInterval(); + console.log('And we have liftoff!'); +} + +main(); +``` + +### In the above example, the interval can also be cleared another way rather than having to pass in the timer object to the liftOff task. +Instead, it can be done by specifying a callback to setTimeout, since the timer object will exist in that scope. Like so: + +```js +timer.setTimeout(liftOff, '', '10s', function(){ + timer.clearInterval(); +}); +``` + + +## .setTimeout(task, args, timeout, [callback]) +* Calls function 'task' with argument(s) 'args' after specified amount of time, 'timeout'. +* timeout, specified as a number plus a letter concatenated into a string. ex - '200u', '150n', '35m', '10s'. +* callback is optional. If it is specified, it is called when setTimeout runs it's assigned task, and it is sent a parameter that +tells the actual amount of time that passed before the specifed task was run, in nanoseconds. + +```js +console.log("It's gonna be legen-wait for it..."); + +timerA.setTimeout(dary, '', '2s'); + +function dary(){ + console.log("dary!!"); +} +``` + +## .setInterval(task, args, interval, [callback]) +* Repeatedly calls function 'task' with arguments 'args' after every interval amount of time. If interval is specified as 0, it will run as fast as possible! +* This function is self correcting, error does not propagate through each cycle, as described above. +* interval, specified as a number plus a letter concatenated into a string. ex - '200u', '150n', '35m', '10s'. +* callback is optional, and is only called once the interval is cleared. + +```js +timerA.setInterval(task, '100m', function(err) { + if(err) { + //error + } +}); +``` + +## .time(task, args, format, [callback]) +* Returns the amount of time taken to run function 'task', called with arguments 'args'. +* format specifies the units time will be returned in. Options are 's' for seconds, 'm' for milliseconds, 'u' for microseconds, +and 'n' for nanoseconds. if no format is specified, returns the default array of [s, n] where s is seconds and n is nanoseconds. +* callback is optional + +### Synchronous Example: +```js + +var runtimeSeconds = timerA.time(doMath, 'u'); + +function doMath(){ + //do math +} + +``` + +### Asynchronous Use: (yes, it can time asynchronous stuff! here's how) + +In order to time something asynchronous, it's no surprise that the timer object must somehow be notified whenever that asynchronous task finishes. +To do that, you must have your function to be timed accept a callback as a parameter, and manually call that callback (to the timer function) inside of the asynchronous task's +callback. It's essentially a chain of callbacks, which is probably already familiar to you. Here's an example that times how long it takes to read a file. +Suppose you're using node.js's fs.ReadFile, which is asynchronous, then create a wrapper like so: +```js +var NanoTimer = require('nanotimer'); +var fs = require('fs'); + +var timer = new NanoTimer(); + + +timer.time(loadFile, '', 'u', function(time){ + console.log("It took " + time + " microseconds to read that file!"); +}); + +function loadFile(callback){ + fs.readFile('testReadFile.js', function(err, data){ + if(err) throw err; + console.log(data); + + callback(); + }); +} +``` + +Once again, just two changes from normal. First, your function to be timed, in this case 'loadFile' (which is just a proxy function to perfom fs.readFile) must +accept a callback parameter. Second, in the callback of whatever asynchronous task is being performed inside the proxy, the callback passed in must be called after everything +is finished. That callback that you call manually immediately takes the 2nd reference time, and then calls your callback specified in timer.time, ending the process. + +## .clearInterval() +* Clears current running interval +```js +timer.clearInterval(); +``` + +## .clearTimeout() +* Clears current running timeOut +```js +timer.clearTimeout(); +``` + +#Logging +* Added preliminary logging feature. If a timer is created by passing in 'log', it will enable verbose logging from the timer, so you can +figure out the real amount of time being taken for setTimeout or setInterval +* Currently only works on setInterval, and displays the 'cycle time', or real interval time to demonstrate how error does not propagate. This will +be further expanded on. + +# Tests + +* Test suite used is mocha. +* Tests also require **should** +* In order for the test to perform properly, the timeout must be altered. +* I prefer running tests with `mocha -R spec -t 10000` + +![](https://raw.github.com/Krb686/nanotimer/master/test/nanotimer_0_2_6_test_partial.png "Test Results") + +# Performance + +Version 0.3.1 brings about a potentially massive performance boost over previous versions. + +Previous versions used a setImmediate loop running as fast as possible for checking when to execute, inside setTimeout and setInterval. +In 0.3.1, this has changed when using an intervalTime (setInterval), or delayTime (setTimeout) that is longer than 25ms. Execution will be deferred to the standard +javascript setTimeout, aimed for 25ms before scheduled execution, where the setImmediate loop will resume. + +The assumed error of javascript's setTimeout is 25ms. + +Below is a test case with setInterval set to 1 second. + +![](https://raw.github.com/Krb686/nanotimer/master/test/nanotimer_non_deferred.png "Non-Deferred") + +![](https://raw.github.com/Krb686/nanotimer/master/test/nanotimer_deferred.png "Deferred") + + + + + + + + + + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/lib/nanoTimer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/lib/nanoTimer.js new file mode 100644 index 00000000..f1d5b6e3 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/lib/nanoTimer.js @@ -0,0 +1,393 @@ +function NanoTimer(log){ + + var version = process.version; + var major = version.split('.')[0]; + major = major.split('v')[1]; + var minor = version.split('.')[1]; + if ((major == 0) && (minor < 10)){ + console.log('Error: Please update to the latest version of node! This library requires 0.10.x or later'); + process.exit(0); + } + + //Time reference variables + this.intervalT1 = null; + this.timeOutT1 = null; + this.intervalCount = 1; + + //Deferred reference indicator variables. Indicate whether the timer used/will use the deferred call. ie - delay/interval > 25ms + this.deferredInterval = false; + this.deferredTimeout = false; + + //Deferred reference variables. Used to clear the native js timeOut calls + this.deferredTimeoutRef = null; + this.deferredIntervalRef = null; + + //Callback reference variables. Used to be able to still successfully call callbacks when timeouts or intervals are cleared. + this.timeoutCallbackRef = null; + this.intervalCallbackRef = null; + + //Immediate reference variables. Used to clear functions scheduled with setImmediate from running in the event timeout/interval is cleared. + this.timeoutImmediateRef = null; + this.intervalImmediateRef = null; + + this.intervalErrorChecked = false; + + this.intervalType = ""; + + if(log){ + this.logging = true; + } +} + +NanoTimer.prototype.time = function(task, args, format, callback){ + //Asynchronous task + if(callback){ + var t1 = process.hrtime(); + + + if(args){ + + args.push(function(){ + var time = process.hrtime(t1); + if(format == 's'){ + callback(time[0] + time[1]/1000000000); + } else if (format == 'm'){ + callback(time[0]/1000 + time[1]/1000000); + } else if (format == 'u'){ + callback(time[0]/1000000 + time[1]/1000); + } else if (format == 'n'){ + callback(time[0]/1000000000 + time[1]); + } else { + callback(time); + } + }); + + task.apply(null, args); + } else { + task(function(){ + var time = process.hrtime(t1); + if(format == 's'){ + callback(time[0] + time[1]/1000000000); + } else if (format == 'm'){ + callback(time[0]/1000 + time[1]/1000000); + } else if (format == 'u'){ + callback(time[0]/1000000 + time[1]/1000); + } else if (format == 'n'){ + callback(time[0]/1000000000 + time[1]); + } else { + callback(time); + } + }); + } + + //Synchronous task + } else { + var t1 = process.hrtime(); + + if(args){ + task.apply(null, args); + } else{ + task(); + } + + var t2 = process.hrtime(t1); + + if(format == 's'){ + return t2[0] + t2[1]/1000000000; + } else if (format == 'm'){ + return t2[0]/1000 + t2[1]/1000000; + } else if (format == 'u'){ + return t2[0]/1000000 + t2[1]/1000; + } else if (format == 'n'){ + return t2[0]/1000000000 + t2[1]; + } else { + return process.hrtime(t1); + } + } +}; + +NanoTimer.prototype.setInterval = function(task, args, interval, callback){ + + if(!this.intervalErrorChecked){ + //Task error handling + if(!task){ + console.log("A task function must be specified to setInterval"); + process.exit(1); + } else { + if(typeof(task) != "function"){ + console.log("Task argument to setInterval must be a function reference"); + process.exit(1); + } + } + + //Interval error handling + if(!interval){ + console.log("An interval argument must be specified"); + process.exit(1); + } else { + if(typeof(interval) != "string"){ + console.log("Interval argument to setInterval must be a string specified as an integer followed by 's' for seconds, 'm' for milli, 'u' for micro, and 'n' for nanoseconds. Ex. 2u"); + process.exit(1); + } + } + + //This ref is used if deferred timeout is cleared, so the callback can still be accessed + if(callback){ + if(typeof(callback) != "function"){ + console.log("Callback argument to setInterval must be a function reference"); + process.exit(1); + } else { + this.intervalCallbackRef = callback; + } + } + + this.intervalType = interval[interval.length-1]; + + if(this.intervalType == 's'){ + this.intervalTime = interval.slice(0, interval.length-1) * 1000000000; + } else if(this.intervalType == 'm'){ + this.intervalTime = interval.slice(0, interval.length-1) * 1000000; + } else if(this.intervalType == 'u'){ + this.intervalTime = interval.slice(0, interval.length-1) * 1000; + } else if(this.intervalType == 'n'){ + this.intervalTime = interval.slice(0, interval.length-1); + } else { + console.log('Error with argument: ' + interval + ': Incorrect interval format. Format is an integer followed by "s" for seconds, "m" for milli, "u" for micro, and "n" for nanoseconds. Ex. 2u'); + process.exit(1); + } + + this.intervalErrorChecked = true; + } + + //Avoid dereferencing inside of function objects later + //Must be performed on every execution + var thisTimer = this; + + if(this.intervalTime > 0){ + + //Check and set constant t1 value. + if(this.intervalT1 == null){ + this.intervalT1 = process.hrtime(); + } + + //Check for overflow. Every 8,000,000 seconds (92.6 days), this will overflow + //and the reference time T1 will be re-acquired. This is the only case in which error will + //propagate. + if(this.intervalTime*this.intervalCount > 8000000000000000){ + this.intervalT1 = process.hrtime(); + this.intervalCount = 1; + } + + + //Get comparison time + this.difArray = process.hrtime(this.intervalT1); + this.difTime = (this.difArray[0] * 1000000000) + this.difArray[1]; + + //If updated time < expected time, continue + //Otherwise, run task and update counter + if(this.difTime < (this.intervalTime*this.intervalCount)){ + + //Can potentially defer to less accurate setTimeout if intervaltime > 25ms + if(this.intervalTime > 25000000){ + if(this.deferredInterval == false){ + this.deferredInterval = true; + msDelay = (this.intervalTime - 25000000) / 1000000.0; + this.deferredIntervalRef = setTimeout(function(){thisTimer.setInterval(task, args, interval, callback);}, msDelay); + } else { + this.deferredIntervalRef = null; + this.intervalImmediateRef = setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } + } else { + this.intervalImmediateRef = setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } + } else { + + this.intervalImmediateRef = null; + + if(this.logging){ + console.log('nanotimer log: ' + 'cycle time at - ' + this.difTime); + } + + + + if(args){ + task.apply(null, args); + } else { + task(); + } + + //Check if the intervalT1 is still not NULL. If it is, that means the task cleared the interval so it should not run again. + if(this.intervalT1){ + this.intervalCount++; + this.deferredInterval = false; + this.intervalImmediateRef = setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } + } + + //If interval = 0, run as fast as possible. + } else { + + //Check and set constant t1 value. + if(this.intervalT1 == null){ + this.intervalT1 = process.hrtime(); + this.intervalContinue = true; + } + + if(this.intervalContinue == true) { + if(args){ + task.apply(null, args); + } else { + task(); + } + setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } else { + this.intervalT1 = null; + this.intervalCount = 1; + callback(); + } + } +}; + +NanoTimer.prototype.setTimeout = function(task, args, delay, callback){ + + //Task error handling + if(!task){ + console.log("A task function must be specified to setTimeout"); + process.exit(1); + } else { + if(typeof(task) != "function"){ + console.log("Task argument to setTimeout must be a function reference"); + process.exit(1); + } + } + + //Delay error handling + if(!delay){ + console.log("A delay argument must be specified"); + process.exit(1); + } else { + if(typeof(delay) != "string"){ + console.log("Delay argument to setTimeout must be a string specified as an integer followed by 's' for seconds, 'm' for milli, 'u' for micro, and 'n' for nanoseconds. Ex. 2u"); + process.exit(1); + } + } + + //This ref is used if deferred timeout is cleared, so the callback can still be accessed + if(callback){ + if(typeof(callback) != "function"){ + console.log("Callback argument to setTimeout must be a function reference"); + process.exit(1); + } else { + this.timeoutCallbackRef = callback; + } + } + + //Avoid dereferencing + var thisTimer = this; + + var delayType = delay[delay.length-1]; + + if(delayType == 's'){ + var delayTime = delay.slice(0, delay.length-1) * 1000000000; + } else if(delayType == 'm'){ + var delayTime = delay.slice(0, delay.length-1) * 1000000; + } else if(delayType == 'u'){ + var delayTime = delay.slice(0, delay.length-1) * 1000; + } else if(delayType == 'n'){ + var delayTime = delay.slice(0, delay.length-1); + } else { + console.log('Error with argument: ' + delay + ': Incorrect delay format. Format is an integer followed by "s" for seconds, "m" for milli, "u" for micro, and "n" for nanoseconds. Ex. 2u'); + process.exit(1); + } + + //Set marker + if(this.timeOutT1 == null){ + this.timeOutT1 = process.hrtime(); + } + + + var difArray = process.hrtime(this.timeOutT1); + var difTime = (difArray[0] * 1000000000) + difArray[1]; + + + if(difTime < delayTime){ + //Can potentially defer to less accurate setTimeout if delayTime > 25ms + if(delayTime > 25000000){ + if(this.deferredTimeout == false){ + this.deferredTimeout = true; + msDelay = (delayTime - 25000000) / 1000000.0; + this.deferredTimeoutRef = setTimeout(function(){thisTimer.setTimeout(task, args, delay, callback);}, msDelay); + } else { + this.deferredTimeoutRef = null; + this.timeoutImmediateRef = setImmediate(function(){thisTimer.setTimeout(task, args, delay, callback);}); + } + } else { + this.timeoutImmediateRef = setImmediate(function(){thisTimer.setTimeout(task, args, delay, callback);}); + } + } else { + this.timeoutImmediateRef = null; + this.timeOutT1 = null; + this.deferredTimeout = false; + + if(this.logging == true){ + console.log('nanotimer log: ' + 'actual wait - ' + difTime); + } + + if(args){ + task.apply(null, args); + } else{ + task(); + } + + if(callback){ + var data = {'waitTime':difTime}; + callback(data); + } + + } +}; + +NanoTimer.prototype.clearInterval = function(){ + if(this.deferredIntervalRef){ + clearTimeout(this.deferredIntervalRef); + + this.deferredInterval = false; + } + + if(this.intervalImmediateRef){ + clearImmediate(this.intervalImmediateRef); + } + + this.intervalT1 = null; + this.intervalCount = 1; + this.intervalErrorChecked = false; + + if(this.intervalCallbackRef){ + this.intervalCallbackRef(); + } +}; + +NanoTimer.prototype.clearTimeout = function(){ + + if(this.deferredTimeoutRef){ + clearTimeout(this.deferredTimeoutRef); + + var difArray = process.hrtime(this.timeOutT1); + var difTime = (difArray[0] * 1000000000) + difArray[1]; + + this.deferredTimeout = false; + } + + if(this.timeoutImmediateRef){ + clearImmediate(this.timeoutImmediateRef); + } + + this.timeOutT1 = null; + + if(this.timeoutCallbackRef){ + var data = {'waitTime':difTime}; + this.timeoutCallbackRef(data); + } +}; + +module.exports = NanoTimer; \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/lib/nanoTimerExp.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/lib/nanoTimerExp.js new file mode 100644 index 00000000..16ec6e7a --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/lib/nanoTimerExp.js @@ -0,0 +1,292 @@ +function NanoTimer(log){ + + var version = process.version; + var minor = version.split('.')[1]; + if (minor < 10){ + console.log('Error: Please update to the latest version of node!'); + process.exit(0); + } + + this.intervalContinue = false; + this.intervalT1 = null; + this.intervalCount = 0; + this.timeOutT1 = null; + this.deferredInterval = false; + this.deferredTimeout = false; + this.experimental = true; + + if(log){ + this.logging = true; + } +} + +NanoTimer.prototype.time = function(task, args, format, callback){ + //Asynchronous task + if(callback){ + var t1 = process.hrtime(); + + + if(args){ + + args.push(function(){ + var time = process.hrtime(t1); + if(format == 's'){ + callback(time[0] + time[1]/1000000000); + } else if (format == 'm'){ + callback(time[0]/1000 + time[1]/1000000); + } else if (format == 'u'){ + callback(time[0]/1000000 + time[1]/1000); + } else if (format == 'n'){ + callback(time[0]/1000000000 + time[1]); + } else { + callback(time); + } + }); + + task.apply(null, args); + } else { + task(function(){ + var time = process.hrtime(t1); + if(format == 's'){ + callback(time[0] + time[1]/1000000000); + } else if (format == 'm'){ + callback(time[0]/1000 + time[1]/1000000); + } else if (format == 'u'){ + callback(time[0]/1000000 + time[1]/1000); + } else if (format == 'n'){ + callback(time[0]/1000000000 + time[1]); + } else { + callback(time); + } + }); + } + + //Synchronous task + } else { + var t1 = process.hrtime(); + + if(args){ + task.apply(null, args); + } else{ + task(); + } + + var t2 = process.hrtime(t1); + + if(format == 's'){ + return t2[0] + t2[1]/1000000000; + } else if (format == 'm'){ + return t2[0]/1000 + t2[1]/1000000; + } else if (format == 'u'){ + return t2[0]/1000000 + t2[1]/1000; + } else if (format == 'n'){ + return t2[0]/1000000000 + t2[1]; + } else { + return process.hrtime(t1); + } + } +}; + +NanoTimer.prototype.setInterval = function(task, args, interval, callback){ + + //Avoid dereferencing inside of function objects later + var thisTimer = this; + + var intervalType = interval[interval.length-1]; + + if(intervalType == 's'){ + var intervalTime = interval.slice(0, interval.length-1) * 1000000000; + } else if(intervalType == 'm'){ + var intervalTime = interval.slice(0, interval.length-1) * 1000000; + } else if(intervalType == 'u'){ + var intervalTime = interval.slice(0, interval.length-1) * 1000; + } else if(intervalType == 'n'){ + var intervalTime = interval.slice(0, interval.length-1); + } else { + console.log('Error with argument: ' + interval + ': Incorrect interval format. Format is an integer followed by "s" for seconds, "m" for milli, "u" for micro, and "n" for nanoseconds. Ex. 2u'); + process.exit(1); + } + + if(intervalTime > 0){ + + //Check and set constant t1 value. + if(this.intervalT1 == null){ + this.intervalT1 = process.hrtime(); + this.intervalContinue = true; + } + + //Check for overflow. Every 8,000,000 seconds (92.6 days), this will overflow + //and the reference time T1 will be re-acquired. This is the only case in which error will + //propagate. + if(intervalTime*this.intervalCount > 8000000000000000){ + this.intervalT1 = process.hrtime(); + this.intervalCount = 0; + } + + //Get comparison time + this.difArray = process.hrtime(this.intervalT1); + this.difTime = (this.difArray[0] * 1000000000) + this.difArray[1]; + + //If updated time < expected time, continue + //Otherwise, run task and update counter + if(this.intervalContinue == true){ + if(this.difTime < (intervalTime*this.intervalCount)){ + + //Can potentially defer to less accurate setTimeout if intervaltime > 25ms + if(intervalTime > 25000000){ + if(this.deferredInterval == false){ + this.deferredInterval = true; + msDelay = (intervalTime - 25000000) / 1000000.0; + setTimeout(function(){thisTimer.setInterval(task, args, interval, callback);}, msDelay); + } else { + nextExec = (intervalTime*this.intervalCount); + timeLeft = (nextExec - this.difTime); + if(timeLeft < 25000){ + if(timeLeft < 3000){ + //blocking loop + while (this.difTime < nextExec){ + this.difArray = process.hrtime(this.intervalT1); + this.difTime = (this.difArray[0] * 1000000000) + this.difArray[1]; + } + if(args){ + task.apply(null, args); + } else { + task(); + } + this.intervalCount++; + this.deferredInterval = false; + if(this.logging){ + console.log('nanotimer log: ' + 'cycle time at - ' + this.difTime); + } + setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } else { + process.nextTick(function(){thisTimer.setInterval(task, args, interval, callback);}); + } + } else { + setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } + } + } else { + setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } + } + else{ + if(args){ + task.apply(null, args); + } else { + task(); + } + this.intervalCount++; + this.deferredInterval = false; + if(this.logging){ + console.log('nanotimer log: ' + 'cycle time at - ' + this.difTime); + } + setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } + } + + //Clean up for exit + else{ + this.intervalT1 = null; + this.intervalCount = 0; + if(callback){ + callback(); + } + } + + //If interval = 0, run as fast as possible. + } else { + + //Check and set constant t1 value. + if(this.intervalT1 == null){ + this.intervalT1 = process.hrtime(); + this.intervalContinue = true; + } + + if(this.intervalContinue == true) { + if(args){ + task.apply(null, args); + } else { + task(); + } + setImmediate(function(){thisTimer.setInterval(task, args, interval, callback);}); + } else { + this.intervalT1 = null; + this.intervalCount = 0; + callback(); + } + } +}; + +NanoTimer.prototype.setTimeout = function(task, args, delay, callback){ + + //Avoid dereferencing + var thisTimer = this; + + var delayType = delay[delay.length-1]; + + if(delayType == 's'){ + var delayTime = delay.slice(0, delay.length-1) * 1000000000; + } else if(delayType == 'm'){ + var delayTime = delay.slice(0, delay.length-1) * 1000000; + } else if(delayType == 'u'){ + var delayTime = delay.slice(0, delay.length-1) * 1000; + } else if(delayType == 'n'){ + var delayTime = delay.slice(0, delay.length-1); + } else { + console.log('Error with argument: ' + delay + ': Incorrect delay format. Format is an integer followed by "s" for seconds, "m" for milli, "u" for micro, and "n" for nanoseconds. Ex. 2u'); + process.exit(1); + } + + + //Set marker + if(this.timeOutT1 == null){ + this.timeOutT1 = process.hrtime(); + } + + var difArray = process.hrtime(this.timeOutT1); + var difTime = (difArray[0] * 1000000000) + difArray[1]; + + + if(difTime < delayTime){ + //Can potentially defer to less accurate setTimeout if delayTime > 25ms + if(delayTime > 25000000){ + if(this.deferredTimeout == false){ + this.deferredTimeout = true; + msDelay = (delayTime - 25000000) / 1000000.0; + setTimeout(function(){thisTimer.setTimeout(task, args, delay, callback);}, msDelay); + } else { + setImmediate(function(){thisTimer.setTimeout(task, args, delay, callback);}); + } + } else { + setImmediate(function(){thisTimer.setTimeout(task, args, delay, callback);}); + } + } + else{ //time to run + if(this.logging == true){ + console.log('nanotimer log: ' + 'actual wait - ' + difTime); + } + + if(args){ + task.apply(null, args); + } else{ + task(); + } + + this.timeOutT1 = null; + this.deferredTimeout = false; + + if(callback){ + var data = {'waitTime':difTime}; + callback(data); + } + + } + +}; + +NanoTimer.prototype.clearInterval = function(){ + this.intervalContinue = false; +}; + +module.exports = NanoTimer; \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/package.json new file mode 100644 index 00000000..f6948333 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/package.json @@ -0,0 +1,51 @@ +{ + "_from": "nanotimer@0.3.10", + "_id": "nanotimer@0.3.10", + "_inBundle": false, + "_integrity": "sha1-6C7g0AWCsj5wa9wA/znIfaqt24M=", + "_location": "/node-red-contrib-johnny-five/nanotimer", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "nanotimer@0.3.10", + "name": "nanotimer", + "escapedName": "nanotimer", + "rawSpec": "0.3.10", + "saveSpec": null, + "fetchSpec": "0.3.10" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/johnny-five" + ], + "_resolved": "https://registry.npmjs.org/nanotimer/-/nanotimer-0.3.10.tgz", + "_shasum": "e82ee0d00582b23e706bdc00ff39c87daaaddb83", + "_spec": "nanotimer@0.3.10", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/johnny-five", + "authors": [ + "Kevin Briggs (https://github.com/Krb686)" + ], + "bugs": { + "url": "https://github.com/Krb686/nanotimer/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A much higher accuracy timer object that makes use of the node.js hrtime function call.", + "homepage": "https://github.com/Krb686/nanotimer#readme", + "keywords": [ + "timer", + "nanotimer", + "nano", + "nanoseconds", + "micro", + "microseconds", + "stopwatch" + ], + "main": "./lib/nanoTimer.js", + "name": "nanotimer", + "repository": { + "type": "git", + "url": "git+https://github.com/Krb686/nanotimer.git" + }, + "version": "0.3.10" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test-1.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test-1.js new file mode 100644 index 00000000..9dcd101f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test-1.js @@ -0,0 +1,10 @@ +var NanoTimer = require('nanotimer'); + +var timer = new NanoTimer(); + +var simpleFunction = function(){ + console.log("hey\n"); +}; + +timer.setTimeout(simpleFunction, [], '2s'); +timer.clearTimeout(); \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test-kanecko.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test-kanecko.js new file mode 100644 index 00000000..284d6739 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test-kanecko.js @@ -0,0 +1,32 @@ +var NanoTimer = require('nanotimer'); + +var timer = new NanoTimer(); + +//var timer = createTimer(); + + +timer.setTimeout( + myFun.bind(this, 0), + [], + '2s' +); + +function myFun (id) { + var timer = getTimer(); + var duration = 2; + + console.log(timer); + timer.clearTimeout(); + console.log(timer); + timer.setTimeout( + myFun.bind(this, id), + [], + duration + "s" + ); + console.log(timer); + console.log("\n"); +} + +function getTimer(){ + return timer; +} \ No newline at end of file diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_0_2_6_test_partial.png b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_0_2_6_test_partial.png new file mode 100644 index 00000000..7755c7db Binary files /dev/null and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_0_2_6_test_partial.png differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_deferred.png b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_deferred.png new file mode 100644 index 00000000..7929c8a3 Binary files /dev/null and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_deferred.png differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_non_deferred.png b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_non_deferred.png new file mode 100644 index 00000000..af923e9b Binary files /dev/null and b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/nanotimer_non_deferred.png differ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/test-nanoTimer.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/test-nanoTimer.js new file mode 100644 index 00000000..cadf47f5 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/nanotimer/test/test-nanoTimer.js @@ -0,0 +1,290 @@ +var NanoTimer = require('../lib/nanoTimer.js'); +var should = require('should'); + +var timerA = new NanoTimer('log'); + + +describe('nanoTimer', function(){ + //######## time function ######### + describe('.time', function(){ + + //Test 1 - Synchronous Task Timing + it('#1: synchronous, count to 1 million, 1000 samples', function(){ + + var times = []; + var i = 0; + var numSamples = 1000; + + //Simple count to 1 million task + var syncTask = function(){ + var count = 0; + var i = 0; + for(i=0;i<1000000;i++){ + count++; + }; + }; + + //Test numSamples # of times + for(i=0;i max){ + max = times[i]; + } + + if(times[i] < min){ + min = times[i]; + } + } + + avg = avg/numSamples; + console.log('\n\t\t - Average time: ' + avg + ' milliseconds'); + console.log('\t\t - Max time: ' + max + ' milliseconds'); + console.log('\t\t - Min time: ' + min + ' milliseconds'); + + }); + + //Test 2 - Asynchronous Task Timing + it('#2: asynchronous, count to 1 million, 1000 samples', function(done){ + + var i = 0; + var j = 0; + var numSamples = 1000; + var doneCount = 0; + var times = []; + + //Count to 1000 asynchronously + var asyncTask = function(callback){ + + if(i < 1000000){ + setImmediate(function(){asyncTask(callback);}); + } else { + callback(); + } + + i++; + }; + + //Run 10 instances of async task. + for(j=0;j max){ + max = times[i]; + } + + if(times[i] < min){ + min = times[i]; + } + } + + avg = avg/numSamples; + console.log('\n\t\t - Average time: ' + avg + ' seconds'); + console.log('\t\t - Max time: ' + max + ' seconds'); + console.log('\t\t - Min time: ' + min + ' seconds'); + done(); + } + }); + } + }); + }); + + + //######## timeout function ######## + describe('.setTimeout && clearTimeout', function(){ + //Test 3 - sync task + it('#3: sync, wait 0.1 seconds, 20 samples\n\n', function(done){ + var i = 0; + var j = 0; + var numSamples = 20; + var doneCount = 0; + var errors = []; + var minError = 1000000000; + var maxError = 0; + var avgError = 0; + + + var task = function(){ + var count = 0; + for(i=0;i<1000000;i++){ + count++; + }; + }; + + for(j=0;j= 100000000); + waitedLongEnough.should.be.true; + + doneCount++; + + if(doneCount == numSamples){ + for(i=0;i maxError){ + maxError = errors[i]; + } + + avgError += errors[i]; + } + avgError = avgError / numSamples; + console.log('\t\t - Min. Error: ' + minError + '%'); + console.log('\t\t - Max. Error: ' + maxError + '%'); + console.log('\t\t - Avg. Error: ' + avgError + '%'); + done(); + } + }); + } + + + + }); + + //Test 4 - async task + it('#4: setTimeout on async function with callback\n\n', function(done){ + var asyncTask = function(callback, i){ + if(!i){ + var i = 0; + } + + if(i < 1000){ + setImmediate(function(){ + i++; + asyncTask(callback, i); + }); + } else { + callback('got data'); + } + }; + + var runAsync = function(){ + var msg = ''; + asyncTask(function(data){ + msg = data; + msg.should.eql('got data'); + }); + }; + + timerA.setTimeout(runAsync, [], '1s', function(data) { + var waitTime = data.waitTime; + console.log('\t\t - Expected wait: 1 seconds'); + console.log('\t\t - Actual wait: ' + waitTime/1000000000 + ' seconds'); + console.log('\t\t - Error: ' + (((waitTime - 1000000000) / (1000000000)) * 100) + '%'); + var waitedLongEnough = (waitTime >= 1000000000); + waitedLongEnough.should.be.true; + done(); + }); + + }); + + //Test #5 - timeout with args passed + it('#5 works with functions with args passed in\n\n', function(done){ + var someObject = {}; + someObject.number = 10; + + + var taskWithArgs = function(object){ + object.number = 5; + }; + + timerA.setTimeout(taskWithArgs, [someObject], '1s', function(data){ + var waitTime = data.waitTime; + console.log('\t\t - Expected wait: 1 seconds'); + console.log('\t\t - Actual wait: ' + waitTime/1000000000 + ' seconds'); + console.log('\t\t - Error: ' + (((waitTime - 1000000000) / (1000000000)) * 100) + '%'); + var waitedLongEnough = (waitTime >= 1000000000); + waitedLongEnough.should.be.true; + someObject.number.should.eql(5); + done(); + + }); + + + }); + + //Test #6 - clearTimeout works + it('#6 clearTimeout before task is run - works\n\n', function(done){ + + + var value = 0; + + var task = function(){ + console.log('\t\t #6 task was run!'); + value++; + }; + + timerA.setTimeout(task, [], '1s', function(data){ + var waitTime = data.waitTime; + console.log('\t\t - Expected wait: 1 second'); + console.log('\t\t - Actual wait: ' + waitTime/1000000000 + ' seconds'); + var waitedShortEnough = (waitTime < 1000000000); + waitedShortEnough.should.be.true; + value.should.eql(0); + done(); + }); + + timerA.clearTimeout(); + + }); + + + + }); + + //######## setInterval function ######## + describe('setInterval && clearInterval', function(){ + + //Test #7 - setInterval works + it('#7 successfully works\n\n', function(done){ + + var task = function(){ + console.log('\t\t - task was run!'); + }; + + + timerA.setInterval(task, [], '0.1s', function(){ + done(); + }); + + timerA.setTimeout(function(){ + console.log('\t\t - clearing interval'); + timerA.clearInterval(); + }, [], '5s'); + + }); + + }); + +}); + + + + diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/LICENSE similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/LICENSE rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/LICENSE diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/README.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/README.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/README.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/index.js similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/index.js rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/index.js diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/index.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/index.md similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/index.md rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/index.md diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/napi-build-utils-1.0.0.tgz b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/napi-build-utils-1.0.0.tgz similarity index 100% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/napi-build-utils-1.0.0.tgz rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/napi-build-utils-1.0.0.tgz diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/package.json similarity index 91% rename from prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/package.json rename to prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/package.json index 35472226..abbeb307 100644 --- a/prebuilt/armv6l/lib/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/napi-build-utils/package.json +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/napi-build-utils/package.json @@ -3,7 +3,7 @@ "_id": "napi-build-utils@1.0.1", "_inBundle": false, "_integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==", - "_location": "/raspi-io/napi-build-utils", + "_location": "/node-red-contrib-johnny-five/napi-build-utils", "_phantomChildren": {}, "_requested": { "type": "range", @@ -16,12 +16,12 @@ "fetchSpec": "^1.0.1" }, "_requiredBy": [ - "/raspi-io/prebuild-install" + "/node-red-contrib-johnny-five/prebuild-install" ], "_resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", "_shasum": "1381a0f92c39d66bf19852e7873432fc2123e508", "_spec": "napi-build-utils@^1.0.1", - "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-gpio/node_modules/raspi-io/node_modules/prebuild-install", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/prebuild-install", "author": { "name": "Jim Schlight" }, diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.lint b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.lint new file mode 100644 index 00000000..7f0f7f0c --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.lint @@ -0,0 +1,14 @@ +@root + +module +es5 + +indent 2 +maxlen 100 +tabs + +ass +bitwise +nomen +plusplus +predef+ process, setImmediate, setTimeout, clearTimeout, document, MutationObserver, WebKitMutationObserver diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.npmignore b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.npmignore new file mode 100644 index 00000000..155e41f6 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.travis.yml new file mode 100644 index 00000000..d867be5f --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/.travis.yml @@ -0,0 +1,16 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + - 5 + - 6 + +before_install: + - mkdir node_modules; ln -s ../ node_modules/next-tick + +notifications: + email: + - medikoo+next-tick@medikoo.com + +script: "npm test && npm run lint" diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/CHANGES b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/CHANGES new file mode 100644 index 00000000..6f59c887 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/CHANGES @@ -0,0 +1,24 @@ +v1.0.0 -- 2016.06.09 +* In case MutationObserver based solution ensure all callbacks are propagated + even if any on the way crashes (fixes #3) +* Support older engines (as IE8) which see typeof setTimeout as 'object' +* Fix spelling of LICENSE +* Configure lint scripts + +v0.2.2 -- 2014.04.18 +- Do not rely on es5-ext's valid-callable. Replace it with simple internal function +- In MutationObserver fallback rely on text node instead of attribute and assure + mutation event is invoked by real change of data + +v0.2.1 -- 2014.02.24 +- Fix case in import path + +v0.2.0 -- 2014.02.24 +- Assure microtask resultion if MutationObserver is available (thanks @Raynos) #1 +- Unify validation of callback. TypeError is throw for any non callable input +- Move main module from `lib` to root directory +- Improve documentation +- Remove Makefile (it's environment agnostic pacakge) + +v0.1.0 -- 2012.08.29 +Initial diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/LICENSE b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/LICENSE new file mode 100644 index 00000000..fa5fffdd --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (C) 2012-2016 Mariusz Nowak + +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/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/README.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/README.md new file mode 100644 index 00000000..5e73a8b7 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/README.md @@ -0,0 +1,24 @@ +# next-tick +## Environment agnostic nextTick polyfill + +To be used in environment agnostic modules that need nextTick functionality. + +- When run in Node.js `process.nextTick` is used +- In modern browsers microtask resolution is guaranteed by `MutationObserver` +- In other engines `setImmediate` or `setTimeout(fn, 0)` is used as fallback. +- If none of the above is supported module resolves to `null` + +## Installation +### NPM + +In your project path: + + $ npm install next-tick + +#### Browser + +You can easily bundle `next-tick` for browser with any CJS bundler, e.g. [modules-webmake](https://github.com/medikoo/modules-webmake) + +## Tests [![Build Status](https://api.travis-ci.org/medikoo/next-tick.png?branch=master)](https://travis-ci.org/medikoo/next-tick) + + $ npm test diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/index.js new file mode 100644 index 00000000..ec2138ed --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/index.js @@ -0,0 +1,71 @@ +'use strict'; + +var callable, byObserver; + +callable = function (fn) { + if (typeof fn !== 'function') throw new TypeError(fn + " is not a function"); + return fn; +}; + +byObserver = function (Observer) { + var node = document.createTextNode(''), queue, currentQueue, i = 0; + new Observer(function () { + var callback; + if (!queue) { + if (!currentQueue) return; + queue = currentQueue; + } else if (currentQueue) { + queue = currentQueue.concat(queue); + } + currentQueue = queue; + queue = null; + if (typeof currentQueue === 'function') { + callback = currentQueue; + currentQueue = null; + callback(); + return; + } + node.data = (i = ++i % 2); // Invoke other batch, to handle leftover callbacks in case of crash + while (currentQueue) { + callback = currentQueue.shift(); + if (!currentQueue.length) currentQueue = null; + callback(); + } + }).observe(node, { characterData: true }); + return function (fn) { + callable(fn); + if (queue) { + if (typeof queue === 'function') queue = [queue, fn]; + else queue.push(fn); + return; + } + queue = fn; + node.data = (i = ++i % 2); + }; +}; + +module.exports = (function () { + // Node.js + if ((typeof process === 'object') && process && (typeof process.nextTick === 'function')) { + return process.nextTick; + } + + // MutationObserver + if ((typeof document === 'object') && document) { + if (typeof MutationObserver === 'function') return byObserver(MutationObserver); + if (typeof WebKitMutationObserver === 'function') return byObserver(WebKitMutationObserver); + } + + // W3C Draft + // http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html + if (typeof setImmediate === 'function') { + return function (cb) { setImmediate(callable(cb)); }; + } + + // Wide available standard + if ((typeof setTimeout === 'function') || (typeof setTimeout === 'object')) { + return function (cb) { setTimeout(callable(cb), 0); }; + } + + return null; +}()); diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/package.json b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/package.json new file mode 100644 index 00000000..65ce2266 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/package.json @@ -0,0 +1,60 @@ +{ + "_from": "next-tick@^1.0.0", + "_id": "next-tick@1.0.0", + "_inBundle": false, + "_integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "_location": "/node-red-contrib-johnny-five/next-tick", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "next-tick@^1.0.0", + "name": "next-tick", + "escapedName": "next-tick", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/node-red-contrib-johnny-five/es5-ext" + ], + "_resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "_shasum": "ca86d1fe8828169b0120208e3dc8424b9db8342c", + "_spec": "next-tick@^1.0.0", + "_where": "/root/redmatic-prebuild/node_modules/node-red-contrib-johnny-five/node_modules/es5-ext", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/next-tick/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Environment agnostic nextTick polyfill", + "devDependencies": { + "tad": "^0.2.4", + "xlint": "^0.2.2", + "xlint-jslint-medikoo": "^0.1.4" + }, + "homepage": "https://github.com/medikoo/next-tick#readme", + "keywords": [ + "nexttick", + "setImmediate", + "setTimeout", + "async" + ], + "license": "MIT", + "name": "next-tick", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/next-tick.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node node_modules/tad/bin/tad" + }, + "version": "1.0.0" +} diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/test/index.js b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/test/index.js new file mode 100644 index 00000000..6b22cf48 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/next-tick/test/index.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = function (t, a, d) { + var invoked; + + a(t(function () { + a(arguments.length, 0, "Arguments"); + invoked = true; + }), undefined, "Return"); + a(invoked, undefined, "Is not run immediately"); + setTimeout(function () { + a(invoked, true, "Run in next tick"); + invoked = []; + t(function () { invoked.push(0); }); + t(function () { invoked.push(1); }); + t(function () { invoked.push(2); }); + setTimeout(function () { + a.deep(invoked, [0, 1, 2], "Serial"); + d(); + }, 10); + }, 10); +}; diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/.travis.yml b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/.travis.yml new file mode 100644 index 00000000..6f637f77 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/.travis.yml @@ -0,0 +1,19 @@ +language: node_js +cache: + directories: + - ~/.npm +notifications: + email: false +node_js: + - '10' + - '9' + - '8' + - '6' + - '4' + - '0.12' + - '0.10' +after_success: + - npm run travis-deploy-once "npm run semantic-release" +branches: + except: + - /^v\d+\.\d+\.\d+$/ diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/CODE_OF_CONDUCT.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..a28ec15d --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/CODE_OF_CONDUCT.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at lukas.geiger94@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/ + +[homepage]: https://www.contributor-covenant.org diff --git a/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/CONTRIBUTING.md b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/CONTRIBUTING.md new file mode 100644 index 00000000..3a83ae98 --- /dev/null +++ b/prebuilt/armv6l/lib/node_modules/node-red-contrib-johnny-five/node_modules/node-abi/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing to `node-abi` + +:+1::tada: First off, thanks for taking the time to contribute to `node-abi`! :tada::+1: + +## Commit Message Guidelines + +This module uses [`semantic-release`](https://github.com/semantic-release/semantic-release) to automatically release new versions via Travis. +Therefor we have very precise rules over how our git commit messages can be formatted. + +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type**, a **scope** and a **subject** ([full explanation](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md)): + +``` +(): + + + +