chore(dependencies): upgrade Standard from v11 to v12 which introduces a style change

pull/139/head
Romain 6 years ago
parent 2427ace270
commit 9425604dd7

@ -6,7 +6,7 @@ const pkg = require(path.join(__dirname, '..', 'package.json'))
const TRACKING_CODE = 'UA-110087713-3'
class Analytics {
constructor ({enabled}) {
constructor ({ enabled }) {
this.enabled = enabled
this.insight = new Insight({ trackingCode: TRACKING_CODE, pkg })
this.insight.optOut = !enabled

@ -57,7 +57,7 @@ function overrideDebugFormat () {
*/
function configureDefaultMode (outputFolder) {
const logfile = path.join(outputFolder, 'thumbsup.log')
const stream = fs.createWriteStream(logfile, {flags: 'a'})
const stream = fs.createWriteStream(logfile, { flags: 'a' })
overrideDebugFormat()
debug.enable('thumbsup:error,thumbsup:warn')
debug.useColors = () => false

380
package-lock.json generated

@ -78,21 +78,10 @@
"dev": true
},
"acorn-jsx": {
"version": "3.0.1",
"resolved": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz",
"integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
"dev": true,
"requires": {
"acorn": "3.3.0"
},
"dependencies": {
"acorn": {
"version": "3.3.0",
"resolved": "http://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
"integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=",
"dev": true
}
}
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz",
"integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==",
"dev": true
},
"ajv": {
"version": "5.5.2",
@ -106,9 +95,9 @@
}
},
"ajv-keywords": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
"integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz",
"integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=",
"dev": true
},
"amdefine": {
@ -299,7 +288,7 @@
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
@ -312,7 +301,7 @@
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
@ -547,7 +536,7 @@
},
"callsites": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
"resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
"integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=",
"dev": true
},
@ -876,7 +865,7 @@
},
"debug-log": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz",
"resolved": "http://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz",
"integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=",
"dev": true
},
@ -973,19 +962,11 @@
"uniq": "1.0.1"
},
"dependencies": {
"glob": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
"ignore": {
"version": "3.3.10",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz",
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
"dev": true
}
}
},
@ -1139,30 +1120,30 @@
}
},
"eslint": {
"version": "4.18.2",
"resolved": "http://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz",
"integrity": "sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==",
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz",
"integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==",
"dev": true,
"requires": {
"ajv": "5.5.2",
"ajv": "6.6.1",
"babel-code-frame": "6.26.0",
"chalk": "2.4.1",
"concat-stream": "1.6.2",
"cross-spawn": "5.1.0",
"cross-spawn": "6.0.5",
"debug": "3.2.6",
"doctrine": "2.1.0",
"eslint-scope": "3.7.3",
"eslint-scope": "4.0.0",
"eslint-utils": "1.3.1",
"eslint-visitor-keys": "1.0.0",
"espree": "3.5.4",
"espree": "4.1.0",
"esquery": "1.0.1",
"esutils": "2.0.2",
"file-entry-cache": "2.0.0",
"functional-red-black-tree": "1.0.1",
"glob": "7.1.3",
"globals": "11.9.0",
"ignore": "3.3.10",
"ignore": "4.0.6",
"imurmurhash": "0.1.4",
"inquirer": "3.3.0",
"inquirer": "5.2.0",
"is-resolvable": "1.1.0",
"js-yaml": "3.12.0",
"json-stable-stringify-without-jsonify": "1.0.1",
@ -1175,59 +1156,61 @@
"path-is-inside": "1.0.2",
"pluralize": "7.0.0",
"progress": "2.0.3",
"regexpp": "2.0.1",
"require-uncached": "1.0.3",
"semver": "5.5.0",
"strip-ansi": "4.0.0",
"strip-json-comments": "2.0.1",
"table": "4.0.2",
"table": "4.0.3",
"text-table": "0.2.0"
},
"dependencies": {
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"ajv": {
"version": "6.6.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.1.tgz",
"integrity": "sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww==",
"dev": true,
"requires": {
"ms": "2.1.1"
"fast-deep-equal": "2.0.1",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.4.1",
"uri-js": "4.2.2"
}
},
"glob": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
"nice-try": "1.0.5",
"path-key": "2.0.1",
"semver": "5.5.0",
"shebang-command": "1.2.0",
"which": "1.3.1"
}
},
"inquirer": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
"integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"dev": true,
"requires": {
"ansi-escapes": "3.1.0",
"chalk": "2.4.1",
"cli-cursor": "2.1.0",
"cli-width": "2.2.0",
"external-editor": "2.2.0",
"figures": "2.0.0",
"lodash": "4.17.11",
"mute-stream": "0.0.7",
"run-async": "2.3.0",
"rx-lite": "4.0.8",
"rx-lite-aggregates": "4.0.8",
"string-width": "2.1.1",
"strip-ansi": "4.0.0",
"through": "2.3.8"
"ms": "2.1.1"
}
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
@ -1237,15 +1220,15 @@
}
},
"eslint-config-standard": {
"version": "11.0.0",
"resolved": "http://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz",
"integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==",
"version": "12.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz",
"integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==",
"dev": true
},
"eslint-config-standard-jsx": {
"version": "5.0.0",
"resolved": "http://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-5.0.0.tgz",
"integrity": "sha512-rLToPAEqLMPBfWnYTu6xRhm2OWziS2n40QFqJ8jAM8NSVzeVKTa3nclhsU4DpPJQRY60F34Oo1wi/71PN/eITg==",
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz",
"integrity": "sha512-D+YWAoXw+2GIdbMBRAzWwr1ZtvnSf4n4yL0gKGg7ShUOGXkSOLerI17K4F6LdQMJPNMoWYqepzQD/fKY+tXNSg==",
"dev": true
},
"eslint-import-resolver-node": {
@ -1299,13 +1282,22 @@
}
}
},
"eslint-plugin-es": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz",
"integrity": "sha512-XfFmgFdIUDgvaRAlaXUkxrRg5JSADoRC8IkKLc/cISeR3yHVMefFHQZpcyXXEUUPHfy5DwviBcrfqlyqEwlQVw==",
"dev": true,
"requires": {
"eslint-utils": "1.3.1",
"regexpp": "2.0.1"
}
},
"eslint-plugin-import": {
"version": "2.9.0",
"resolved": "http://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz",
"integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=",
"version": "2.14.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz",
"integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==",
"dev": true,
"requires": {
"builtin-modules": "1.1.1",
"contains-path": "0.1.0",
"debug": "2.6.9",
"doctrine": "1.5.0",
@ -1314,7 +1306,8 @@
"has": "1.0.3",
"lodash": "4.17.11",
"minimatch": "3.0.4",
"read-pkg-up": "2.0.0"
"read-pkg-up": "2.0.0",
"resolve": "1.8.1"
},
"dependencies": {
"debug": {
@ -1328,23 +1321,34 @@
},
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"resolved": "http://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "2.0.2",
"isarray": "1.0.0"
}
},
"resolve": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
"integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
"dev": true,
"requires": {
"path-parse": "1.0.6"
}
}
}
},
"eslint-plugin-node": {
"version": "6.0.1",
"resolved": "http://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz",
"integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==",
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz",
"integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==",
"dev": true,
"requires": {
"ignore": "3.3.10",
"eslint-plugin-es": "1.4.0",
"eslint-utils": "1.3.1",
"ignore": "4.0.6",
"minimatch": "3.0.4",
"resolve": "1.8.1",
"semver": "5.5.0"
@ -1362,17 +1366,18 @@
}
},
"eslint-plugin-promise": {
"version": "3.7.0",
"resolved": "http://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz",
"integrity": "sha512-2WO+ZFh7vxUKRfR0cOIMrWgYKdR6S1AlOezw6pC52B6oYpd5WFghN+QHxvrRdZMtbo8h3dfUZ2o1rWb0UPbKtg==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz",
"integrity": "sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==",
"dev": true
},
"eslint-plugin-react": {
"version": "7.7.0",
"resolved": "http://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz",
"integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==",
"version": "7.11.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz",
"integrity": "sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw==",
"dev": true,
"requires": {
"array-includes": "3.0.3",
"doctrine": "2.1.0",
"has": "1.0.3",
"jsx-ast-utils": "2.0.1",
@ -1380,15 +1385,15 @@
}
},
"eslint-plugin-standard": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz",
"integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz",
"integrity": "sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA==",
"dev": true
},
"eslint-scope": {
"version": "3.7.3",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
"integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
"integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==",
"dev": true,
"requires": {
"esrecurse": "4.2.1",
@ -1403,6 +1408,12 @@
}
}
},
"eslint-utils": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz",
"integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==",
"dev": true
},
"eslint-visitor-keys": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
@ -1410,13 +1421,22 @@
"dev": true
},
"espree": {
"version": "3.5.4",
"resolved": "http://registry.npmjs.org/espree/-/espree-3.5.4.tgz",
"integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz",
"integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==",
"dev": true,
"requires": {
"acorn": "5.6.2",
"acorn-jsx": "3.0.1"
"acorn": "6.0.4",
"acorn-jsx": "5.0.1",
"eslint-visitor-keys": "1.0.0"
},
"dependencies": {
"acorn": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz",
"integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==",
"dev": true
}
}
},
"esprima": {
@ -2075,9 +2095,9 @@
}
},
"ignore": {
"version": "3.3.10",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz",
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
"integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
"dev": true
},
"image-size": {
@ -2208,7 +2228,7 @@
},
"is-builtin-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"dev": true,
"requires": {
@ -2716,7 +2736,7 @@
},
"load-json-file": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
"resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
"integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
"dev": true,
"requires": {
@ -2728,7 +2748,7 @@
"dependencies": {
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
}
@ -3472,7 +3492,7 @@
"dependencies": {
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
}
@ -3781,6 +3801,12 @@
"safe-regex": "1.1.0"
}
},
"regexpp": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
"integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
"dev": true
},
"remarkable": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/remarkable/-/remarkable-1.7.1.tgz",
@ -3897,7 +3923,7 @@
},
"require-uncached": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
"resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
"integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
"dev": true,
"requires": {
@ -3958,22 +3984,6 @@
"dev": true,
"requires": {
"glob": "7.1.3"
},
"dependencies": {
"glob": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
}
}
},
"run-async": {
@ -3990,21 +4000,6 @@
"integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==",
"dev": true
},
"rx-lite": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
"integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
"dev": true
},
"rx-lite-aggregates": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
"integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
"dev": true,
"requires": {
"rx-lite": "4.0.8"
}
},
"rxjs": {
"version": "5.5.11",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz",
@ -4393,26 +4388,26 @@
}
},
"standard": {
"version": "11.0.1",
"resolved": "http://registry.npmjs.org/standard/-/standard-11.0.1.tgz",
"integrity": "sha512-nu0jAcHiSc8H+gJCXeiziMVZNDYi8MuqrYJKxTgjP4xKXZMKm311boqQIzDrYI/ktosltxt2CbDjYQs9ANC8IA==",
"version": "12.0.1",
"resolved": "https://registry.npmjs.org/standard/-/standard-12.0.1.tgz",
"integrity": "sha512-UqdHjh87OG2gUrNCSM4QRLF5n9h3TFPwrCNyVlkqu31Hej0L/rc8hzKqVvkb2W3x0WMq7PzZdkLfEcBhVOR6lg==",
"dev": true,
"requires": {
"eslint": "4.18.2",
"eslint-config-standard": "11.0.0",
"eslint-config-standard-jsx": "5.0.0",
"eslint-plugin-import": "2.9.0",
"eslint-plugin-node": "6.0.1",
"eslint-plugin-promise": "3.7.0",
"eslint-plugin-react": "7.7.0",
"eslint-plugin-standard": "3.0.1",
"standard-engine": "8.0.1"
"eslint": "5.4.0",
"eslint-config-standard": "12.0.0",
"eslint-config-standard-jsx": "6.0.2",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-node": "7.0.1",
"eslint-plugin-promise": "4.0.1",
"eslint-plugin-react": "7.11.1",
"eslint-plugin-standard": "4.0.0",
"standard-engine": "9.0.0"
}
},
"standard-engine": {
"version": "8.0.1",
"resolved": "http://registry.npmjs.org/standard-engine/-/standard-engine-8.0.1.tgz",
"integrity": "sha512-LA531C3+nljom/XRvdW/hGPXwmilRkaRkENhO3FAGF1Vtq/WtCXzgmnc5S6vUHHsgv534MRy02C1ikMwZXC+tw==",
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-9.0.0.tgz",
"integrity": "sha512-ZfNfCWZ2Xq67VNvKMPiVMKHnMdvxYzvZkf1AH8/cw2NLDBm5LRsxMqvEJpsjLI/dUosZ3Z1d6JlHDp5rAvvk2w==",
"dev": true,
"requires": {
"deglob": "2.1.1",
@ -4423,7 +4418,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
@ -4528,19 +4523,43 @@
"integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ="
},
"table": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
"integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
"version": "4.0.3",
"resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz",
"integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==",
"dev": true,
"requires": {
"ajv": "5.5.2",
"ajv-keywords": "2.1.1",
"ajv": "6.6.1",
"ajv-keywords": "3.2.0",
"chalk": "2.4.1",
"lodash": "4.17.11",
"slice-ansi": "1.0.0",
"string-width": "2.1.1"
},
"dependencies": {
"ajv": {
"version": "6.6.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.1.tgz",
"integrity": "sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww==",
"dev": true,
"requires": {
"fast-deep-equal": "2.0.1",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.4.1",
"uri-js": "4.2.2"
}
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"slice-ansi": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz",
@ -4813,6 +4832,23 @@
}
}
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"dev": true,
"requires": {
"punycode": "2.1.1"
},
"dependencies": {
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
}
}
},
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",

@ -74,7 +74,7 @@
"require-lint": "^1.3.0",
"should": "^13.2.3",
"sinon": "^7.2.0",
"standard": "^11.0.1",
"standard": "^12.0.1",
"stream-mock": "^1.2.0",
"tmp": "0.0.33"
},

@ -13,7 +13,7 @@ const MEDIA_GLOB = '**/*.{' + PHOTO_EXT.join(',') + ',' + VIDEO_EXT.join(',') +
exports.find = function (rootFolder, callback) {
const entries = {}
const stream = readdir.readdirStreamStat(rootFolder, {
filter: entry => micromatch.match(entry.path, MEDIA_GLOB, {nocase: true}).length !== 0,
filter: entry => micromatch.match(entry.path, MEDIA_GLOB, { nocase: true }).length !== 0,
deep: stats => canTraverse(stats.path),
basePath: '',
sep: '/'

@ -49,7 +49,7 @@ class Index {
}
// emit the final count
const result = countStatement.get()
emitter.emit('done', {count: result.count})
emitter.emit('done', { count: result.count })
}
// find all files on disk
@ -85,7 +85,7 @@ class Index {
const timestamp = moment(entry.File.FileModifyDate, EXIF_DATE_FORMAT).valueOf()
insertStatement.run(entry.SourceFile, timestamp, JSON.stringify(entry))
++processed
emitter.emit('progress', {path: entry.SourceFile, processed: processed, total: toProcess.length})
emitter.emit('progress', { path: entry.SourceFile, processed: processed, total: toProcess.length })
}).on('end', finished)
})

@ -44,7 +44,7 @@ function createAlbumHierarchy (allGroupNames, segment) {
// then create album if it doesn't exist
// and attach it to its parent
var lastSegment = path.basename(segment)
allGroupNames[segment] = new Album({title: lastSegment})
allGroupNames[segment] = new Album({ title: lastSegment })
allGroupNames[parent].albums.push(allGroupNames[segment])
}
}

@ -80,8 +80,8 @@ Album.prototype.calculateStats = function () {
var nestedFromDates = _.map(this.albums, 'stats.fromDate')
var nestedToDates = _.map(this.albums, 'stats.toDate')
// current level
var currentPhotos = _.filter(this.files, {type: 'image'}).length
var currentVideos = _.filter(this.files, {type: 'video'}).length
var currentPhotos = _.filter(this.files, { type: 'image' }).length
var currentVideos = _.filter(this.files, { type: 'video' }).length
var currentFromDate = _.map(this.files, 'meta.date')
var currentToDate = _.map(this.files, 'meta.date')
// aggregate all stats

@ -46,7 +46,7 @@ exports.create = function (files, opts, problems) {
action: (done) => {
fs.mkdirsSync(path.dirname(dest))
debug(`${f.output[out].rel} from ${src} to ${dest}`)
return action({src: src, dest: dest}, err => {
return action({ src: src, dest: dest }, err => {
if (err) {
error(`Error processing ${f.path} -> ${f.output[out].path}\n${err}`)
problems.addFile(f.path)

@ -10,7 +10,7 @@ module.exports = function (n, block) {
const data = require('handlebars').createFrame({})
for (var i = 0; i < n; ++i) {
data.index = i
accum += block.fn(this, {data: data})
accum += block.fn(this, { data: data })
}
return accum
}

@ -62,7 +62,7 @@ class Theme {
render (album, data, next) {
const fullPath = path.join(this.dest, album.path)
debug(`Theme rendering ${album.path}`)
const contents = this.template(Object.assign({album: album}, data))
const contents = this.template(Object.assign({ album: album }, data))
fs.mkdirpSync(path.dirname(fullPath))
fs.writeFile(fullPath, contents, next)
}

@ -59,7 +59,7 @@ function createRenderingTasks (theme, album, gallery, breadcrumbs) {
}
function localThemePath (themeName) {
const local = resolvePkg(`@thumbsup/theme-${themeName}`, {cwd: __dirname})
const local = resolvePkg(`@thumbsup/theme-${themeName}`, { cwd: __dirname })
if (!local) {
throw new Error(`Could not find a built-in theme called ${themeName}`)
}

@ -63,7 +63,7 @@ function mockExifStream (root, filenames) {
const input = filenames.map(name => {
return { SourceFile: `${root}/${name}`, Directory: root }
})
return new streamMock.ReadableMock(input, {objectMode: true})
return new streamMock.ReadableMock(input, { objectMode: true })
}
function reduceStream (stream, done) {

@ -30,7 +30,7 @@ describe('Index', function () {
emitter.on('done', result => {
// check stats
should(result.count).eql(2)
should(stats).eql({unchanged: 0, added: 2, modified: 0, deleted: 0, total: 2})
should(stats).eql({ unchanged: 0, added: 2, modified: 0, deleted: 0, total: 2 })
// check all files were indexed
const paths = emitted.map(e => e.path).sort()
should(paths).eql([
@ -58,7 +58,7 @@ describe('Index', function () {
emitter.on('done', result => {
// check stats
should(result.count).eql(2)
should(stats).eql({unchanged: 2, added: 0, modified: 0, deleted: 0, total: 2})
should(stats).eql({ unchanged: 2, added: 0, modified: 0, deleted: 0, total: 2 })
// all files are emitted, but they were not processed again
should(emitted).eql(2)
should(processed).eql(0)
@ -79,7 +79,7 @@ describe('Index', function () {
emitter.on('done', result => {
// check stats
should(result.count).eql(1)
should(stats).eql({unchanged: 1, added: 0, modified: 0, deleted: 1, total: 1})
should(stats).eql({ unchanged: 1, added: 0, modified: 0, deleted: 1, total: 1 })
// the remaining file was emitted
should(emitted).eql(1)
should(processed).eql(0)

@ -57,7 +57,7 @@ exports.fromDisk = function (filename) {
}
exports.createTempStructure = function (files) {
const tmpdir = tmp.dirSync({unsafeCleanup: true}).name
const tmpdir = tmp.dirSync({ unsafeCleanup: true }).name
_.each(files, (content, filepath) => {
fs.ensureFileSync(`${tmpdir}/${filepath}`)
fs.writeFileSync(`${tmpdir}/${filepath}`, content)

@ -25,7 +25,7 @@ describe('hierarchy', function () {
it('can configure the homepage path', function () {
const mapper = mockMapper(file => ['all'])
const home = hierarchy.createAlbums([], mapper, {index: 'default.html'})
const home = hierarchy.createAlbums([], mapper, { index: 'default.html' })
should(home.path).eql('default.html')
should(home.url).eql('default.html')
})
@ -36,8 +36,8 @@ describe('hierarchy', function () {
emptyMappers.forEach(value => {
it(`adds any photos mapped to <${value}> to the root gallery`, function () {
const files = [
fixtures.photo({path: 'IMG_000001.jpg'}),
fixtures.photo({path: 'IMG_000002.jpg'})
fixtures.photo({ path: 'IMG_000001.jpg' }),
fixtures.photo({ path: 'IMG_000002.jpg' })
]
const mapper = mockMapper(file => [value])
const home = hierarchy.createAlbums(files, mapper)
@ -52,8 +52,8 @@ describe('hierarchy', function () {
describe('nested albums', function () {
it('can group media into a single folder', function () {
const files = [
fixtures.photo({path: 'IMG_000001.jpg'}),
fixtures.photo({path: 'IMG_000002.jpg'})
fixtures.photo({ path: 'IMG_000001.jpg' }),
fixtures.photo({ path: 'IMG_000002.jpg' })
]
const mapper = mockMapper(file => ['all'])
const home = hierarchy.createAlbums(files, mapper)
@ -64,8 +64,8 @@ describe('hierarchy', function () {
it('can group media into several folders', function () {
const files = [
fixtures.photo({path: 'one/IMG_000001.jpg'}),
fixtures.photo({path: 'two/IMG_000002.jpg'})
fixtures.photo({ path: 'one/IMG_000001.jpg' }),
fixtures.photo({ path: 'two/IMG_000002.jpg' })
]
const mapper = mockMapper(file => [path.dirname(file.path)])
const home = hierarchy.createAlbums(files, mapper)
@ -78,8 +78,8 @@ describe('hierarchy', function () {
it('can group media into one nested folder', function () {
const files = [
fixtures.photo({path: 'IMG_000001.jpg'}),
fixtures.photo({path: 'IMG_000002.jpg'})
fixtures.photo({ path: 'IMG_000001.jpg' }),
fixtures.photo({ path: 'IMG_000002.jpg' })
]
const mapper = mockMapper(file => ['one/two'])
const home = hierarchy.createAlbums(files, mapper)
@ -92,8 +92,8 @@ describe('hierarchy', function () {
it('can group media at different levels', function () {
const files = [
fixtures.photo({path: 'one/IMG_000001.jpg'}),
fixtures.photo({path: 'one/two/IMG_000002.jpg'})
fixtures.photo({ path: 'one/IMG_000001.jpg' }),
fixtures.photo({ path: 'one/two/IMG_000002.jpg' })
]
const mapper = mockMapper(file => [path.dirname(file.path)])
const home = hierarchy.createAlbums(files, mapper)

@ -27,9 +27,9 @@ describe('Album', function () {
it('calculates from/to dates', function () {
const a = new Album({
files: [
fixtures.photo({date: '2016-09-14'}),
fixtures.photo({date: '2016-09-02'}),
fixtures.photo({date: '2016-10-21'})
fixtures.photo({ date: '2016-09-14' }),
fixtures.photo({ date: '2016-09-02' }),
fixtures.photo({ date: '2016-10-21' })
]
})
a.finalize()
@ -75,12 +75,12 @@ describe('Album', function () {
it('calculates from/to dates across all albums', function () {
const a = new Album({
files: [fixtures.photo({date: '2016-09-14'})],
files: [fixtures.photo({ date: '2016-09-14' })],
albums: [
new Album({
files: [fixtures.photo({date: '2016-09-02'})],
files: [fixtures.photo({ date: '2016-09-02' })],
albums: [new Album({
files: [fixtures.photo({date: '2016-10-21'})]
files: [fixtures.photo({ date: '2016-10-21' })]
})]
})
]

@ -12,7 +12,7 @@ describe('Album', function () {
})
it('can pass a full hash of options', function () {
const a = new Album({id: 12, title: 'Holidays'})
const a = new Album({ id: 12, title: 'Holidays' })
should(a.id).eql(12)
should(a.title).eql('Holidays')
})
@ -33,13 +33,13 @@ describe('Album', function () {
new Album({
title: '2010',
albums: [
new Album({title: 'October'})
new Album({ title: 'October' })
]
}),
new Album({
title: '2011',
albums: [
new Album({title: 'October'})
new Album({ title: 'October' })
]
})
]
@ -55,9 +55,9 @@ describe('Album', function () {
it('calculates the output file path', function () {
const root = new Album({
title: 'home',
albums: [new Album({title: '2010'})]
albums: [new Album({ title: '2010' })]
})
root.finalize({index: 'index.html'})
root.finalize({ index: 'index.html' })
should(root.path).eql('index.html')
should(root.albums[0].path).eql('2010.html')
})
@ -65,9 +65,9 @@ describe('Album', function () {
it('calculates the URL for the browser', function () {
const root = new Album({
title: 'home',
albums: [new Album({title: '2010'})]
albums: [new Album({ title: '2010' })]
})
root.finalize({index: 'index.html'})
root.finalize({ index: 'index.html' })
should(root.url).eql('index.html')
should(root.albums[0].url).eql('2010.html')
})
@ -75,9 +75,9 @@ describe('Album', function () {
it('calculates the output path with a target folder (slashes match the OS)', function () {
const root = new Album({
title: 'home',
albums: [new Album({title: '2010'})]
albums: [new Album({ title: '2010' })]
})
root.finalize({index: 'index.html', albumsOutputFolder: 'albums'})
root.finalize({ index: 'index.html', albumsOutputFolder: 'albums' })
should(root.path).eql('index.html')
should(root.albums[0].path).eql(path.join('albums', '2010.html'))
})
@ -85,9 +85,9 @@ describe('Album', function () {
it('calculates the URL with a target folder (always forward slashes)', function () {
const root = new Album({
title: 'home',
albums: [new Album({title: '2010'})]
albums: [new Album({ title: '2010' })]
})
root.finalize({index: 'index.html', albumsOutputFolder: 'albums'})
root.finalize({ index: 'index.html', albumsOutputFolder: 'albums' })
should(root.path).eql('index.html')
should(root.albums[0].path).eql('albums/2010.html')
})
@ -95,19 +95,19 @@ describe('Album', function () {
describe('previews', function () {
it('picks the first 10 files as previews', function () {
const a = new Album({files: [
const a = new Album({ files: [
fixtures.photo(), fixtures.photo(), fixtures.photo(), fixtures.photo(),
fixtures.photo(), fixtures.photo(), fixtures.photo(), fixtures.photo(),
fixtures.photo(), fixtures.photo(), fixtures.photo(), fixtures.photo()
]})
] })
a.finalize()
should(a.previews).have.length(10)
})
it('adds <missing> thumbnails to fill', function () {
const a = new Album({files: [
const a = new Album({ files: [
fixtures.photo(), fixtures.photo()
]})
] })
a.finalize()
should(a.previews[2].urls.thumbnail).eql('public/missing.png')
should(a.previews[9].urls.thumbnail).eql('public/missing.png')
@ -140,8 +140,8 @@ describe('Album', function () {
const a = new Album('A')
const b = new Album('B')
const c = new Album('C')
const root = new Album({albums: [c, a, b]})
root.finalize({sortAlbumsBy: 'title'})
const root = new Album({ albums: [c, a, b] })
root.finalize({ sortAlbumsBy: 'title' })
should(root.albums).eql([a, b, c])
})
@ -149,8 +149,8 @@ describe('Album', function () {
const startJan = albumWithFileDates(['2010-01-01', '2010-05-01'])
const startFeb = albumWithFileDates(['2010-02-01', '2010-04-01'])
const startMar = albumWithFileDates(['2010-03-01', '2010-03-01'])
const root = new Album({albums: [startFeb, startMar, startJan]})
root.finalize({sortAlbumsBy: 'start-date'})
const root = new Album({ albums: [startFeb, startMar, startJan] })
root.finalize({ sortAlbumsBy: 'start-date' })
should(root.albums).eql([startJan, startFeb, startMar])
})
@ -158,32 +158,32 @@ describe('Album', function () {
const endMay = albumWithFileDates(['2010-01-01', '2010-05-01'])
const endApr = albumWithFileDates(['2010-02-01', '2010-04-01'])
const endMar = albumWithFileDates(['2010-03-01', '2010-03-01'])
const root = new Album({albums: [endMay, endMar, endApr]})
root.finalize({sortAlbumsBy: 'end-date'})
const root = new Album({ albums: [endMay, endMar, endApr] })
root.finalize({ sortAlbumsBy: 'end-date' })
should(root.albums).eql([endMar, endApr, endMay])
})
it('can sort media by filename', function () {
const a = fixtures.photo({path: 'a'})
const b = fixtures.photo({path: 'b'})
const c = fixtures.photo({path: 'c'})
const album = new Album({files: [c, a, b]})
album.finalize({sortMediaBy: 'filename'})
const a = fixtures.photo({ path: 'a' })
const b = fixtures.photo({ path: 'b' })
const c = fixtures.photo({ path: 'c' })
const album = new Album({ files: [c, a, b] })
album.finalize({ sortMediaBy: 'filename' })
should(album.files).eql([a, b, c])
})
it('can sort media by reverse filename', function () {
const a = fixtures.photo({path: 'a'})
const b = fixtures.photo({path: 'b'})
const c = fixtures.photo({path: 'c'})
const album = new Album({files: [c, a, b]})
album.finalize({sortMediaBy: 'filename', sortMediaDirection: 'desc'})
const a = fixtures.photo({ path: 'a' })
const b = fixtures.photo({ path: 'b' })
const c = fixtures.photo({ path: 'c' })
const album = new Album({ files: [c, a, b] })
album.finalize({ sortMediaBy: 'filename', sortMediaDirection: 'desc' })
should(album.files).eql([c, b, a])
})
it('can sort media by date', function () {
const album = albumWithFileDates(['2010-10-15', '2010-01-01', '2010-03-24'])
album.finalize({sortMediaBy: 'date'})
album.finalize({ sortMediaBy: 'date' })
const datesInAlbum = album.files.map(f => {
return moment(f.meta.date).format('YYYY-MM-DD')
})
@ -191,13 +191,13 @@ describe('Album', function () {
})
it('sorts nested albums too', function () {
const nested = new Album({title: 'nested',
const nested = new Album({ title: 'nested',
files: [
fixtures.photo({path: 'b'}),
fixtures.photo({path: 'a'})
]})
const root = new Album({title: 'home', albums: [nested]})
root.finalize({sortMediaBy: 'filename'})
fixtures.photo({ path: 'b' }),
fixtures.photo({ path: 'a' })
] })
const root = new Album({ title: 'home', albums: [nested] })
root.finalize({ sortMediaBy: 'filename' })
should(nested.files[0].path).eql('a')
should(nested.files[1].path).eql('b')
})
@ -233,13 +233,13 @@ describe('Album', function () {
})
it('passes finalising options to all nested albums (e.g. sorting)', function () {
const nested = new Album({title: 'nested',
const nested = new Album({ title: 'nested',
files: [
fixtures.photo({path: 'b'}),
fixtures.photo({path: 'a'})
]})
const root = new Album({title: 'home', albums: [nested]})
root.finalize({sortMediaBy: 'filename'})
fixtures.photo({ path: 'b' }),
fixtures.photo({ path: 'a' })
] })
const root = new Album({ title: 'home', albums: [nested] })
root.finalize({ sortMediaBy: 'filename' })
should(nested.files[0].path).eql('a')
should(nested.files[1].path).eql('b')
})
@ -248,7 +248,7 @@ describe('Album', function () {
function albumWithFileDates (dates) {
const files = dates.map(function (d) {
return fixtures.photo({date: d})
return fixtures.photo({ date: d })
})
return new Album({files: files})
return new Album({ files: files })
}

@ -46,9 +46,9 @@ describe('File', function () {
})
it('has a boolean flag for videos to simplify templates', function () {
const photo = new File(dbFile({File: {MIMEType: 'image/jpeg'}}))
const photo = new File(dbFile({ File: { MIMEType: 'image/jpeg' } }))
should(photo.isVideo).eql(false)
const video = new File(dbFile({File: {MIMEType: 'video/quicktime'}}))
const video = new File(dbFile({ File: { MIMEType: 'video/quicktime' } }))
should(video.isVideo).eql(true)
})
})

@ -116,7 +116,7 @@ describe('Metadata', function () {
it('can tell if a file is an animated gif', function () {
const exiftool = fixtures.exiftool()
exiftool.File.MIMEType = 'image/gif'
exiftool.GIF = {FrameCount: 10}
exiftool.GIF = { FrameCount: 10 }
const meta = new Metadata(exiftool)
should(meta.video).eql(false)
should(meta.animated).eql(true)
@ -175,7 +175,7 @@ describe('Metadata', function () {
it('can read a single Picasa keywords', function () {
const exiftool = fixtures.exiftool()
const picasa = {keywords: 'beach'}
const picasa = { keywords: 'beach' }
const meta = new Metadata(exiftool, picasa)
should(meta.keywords).eql(['beach'])
})
@ -183,7 +183,7 @@ describe('Metadata', function () {
it('can read multiple Picasa keywords', function () {
// because it's a simple INI file, multiple keywords are comma-separated
const exiftool = fixtures.exiftool()
const picasa = {keywords: 'beach,sunset'}
const picasa = { keywords: 'beach,sunset' }
const meta = new Metadata(exiftool, picasa)
should(meta.keywords).eql(['beach', 'sunset'])
})
@ -213,7 +213,7 @@ describe('Metadata', function () {
it('understands the Picasa <star> feature', function () {
const exiftool = fixtures.exiftool()
const picasa = {star: 'yes'}
const picasa = { star: 'yes' }
const meta = new Metadata(exiftool, picasa)
should(meta.favourite).eql(true)
})

@ -62,7 +62,7 @@ describe('actions', () => {
})
it('photo:thumbnail = creates a square thumbnail', testEnd => {
const map = actions.createMap({thumbSize: 200})
const map = actions.createMap({ thumbSize: 200 })
const action = map['photo:thumbnail']
action(ANY_TASK, err => {
should(err).eql(null)
@ -75,7 +75,7 @@ describe('actions', () => {
})
it('photo:large = creates a large image', testEnd => {
const map = actions.createMap({largeSize: 1000})
const map = actions.createMap({ largeSize: 1000 })
const action = map['photo:large']
action(ANY_TASK, err => {
should(err).eql(null)
@ -87,7 +87,7 @@ describe('actions', () => {
})
it('video:thumbnail = creates a square video still', testEnd => {
const map = actions.createMap({thumbSize: 200})
const map = actions.createMap({ thumbSize: 200 })
const action = map['video:thumbnail']
action(ANY_TASK, err => {
should(err).eql(null)
@ -99,7 +99,7 @@ describe('actions', () => {
})
it('video:poster = creates a large video still', testEnd => {
const map = actions.createMap({largeSize: 1000})
const map = actions.createMap({ largeSize: 1000 })
const action = map['video:poster']
action(ANY_TASK, err => {
should(err).eql(null)
@ -123,7 +123,7 @@ describe('actions', () => {
describe('watermark', () => {
it('can add a watermark to large images', testEnd => {
const map = actions.createMap({watermark: 'copyright.jpg'})
const map = actions.createMap({ watermark: 'copyright.jpg' })
const action = map['photo:large']
action(ANY_TASK, err => {
should(err).eql(null)
@ -135,7 +135,7 @@ describe('actions', () => {
it('ignores the watermark for thumbnails', testEnd => {
// it's not supported by <downsize> anyway
const map = actions.createMap({watermark: 'copyright.jpg'})
const map = actions.createMap({ watermark: 'copyright.jpg' })
const action = map['photo:thumbnail']
action(ANY_TASK, err => {
should(err).eql(null)

@ -20,8 +20,8 @@ describe('Steps: cleanup', () => {
it('does nothing if there are no extra files', testEnd => {
const input = [
fixtures.file({path: 'paris/IMG_0001.jpg'}),
fixtures.file({path: 'london/IMG_0002.jpg'})
fixtures.file({ path: 'paris/IMG_0001.jpg' }),
fixtures.file({ path: 'london/IMG_0002.jpg' })
]
mock({
'output/media/thumbs/paris/IMG_0001.jpg': '',
@ -39,8 +39,8 @@ describe('Steps: cleanup', () => {
it('deletes output files that are not linked to the input', testEnd => {
const input = [
fixtures.file({path: 'paris/IMG_0001.jpg'}),
fixtures.file({path: 'london/IMG_0002.jpg'})
fixtures.file({ path: 'paris/IMG_0001.jpg' }),
fixtures.file({ path: 'london/IMG_0002.jpg' })
]
mock({
'output/media/large/paris/IMG_0001.jpg': '',

@ -7,103 +7,103 @@ describe('Handlebars helpers: compare', () => {
it('executes the block if the condition is true', () => {
const template = handlebars.compile(`{{#compare value '==' 3}}TRUE{{/compare}}`)
const res = template({value: 3})
const res = template({ value: 3 })
should(res).eql('TRUE')
})
it('does not execute the block if the condition is false', () => {
const template = handlebars.compile(`{{#compare value '==' 3}}{{/compare}}`)
const res = template({value: 4})
const res = template({ value: 4 })
should(res).eql('')
})
it('executes the {{else}} block if the condition is false', () => {
const template = handlebars.compile(`{{#compare value '==' 3}}TRUE{{else}}FALSE{{/compare}}`)
const res = template({value: 4})
const res = template({ value: 4 })
should(res).eql('FALSE')
})
it('defaults to a strict equality', () => {
const template = handlebars.compile(`{{#compare value 3}}TRUE{{/compare}}`)
const res = template({value: 3})
const res = template({ value: 3 })
should(res).eql('TRUE')
})
it('throws an error if the operator is not known', () => {
const template = handlebars.compile(`{{#compare value '~~' 3}}TRUE{{/compare}}`)
should(() => {
template({value: 3})
template({ value: 3 })
}).throw(/operator/)
})
it('throws an error if there arent enough parameters', () => {
should(() => {
const template = handlebars.compile(`{{#compare value}}TRUE{{/compare}}`)
template({value: 3})
template({ value: 3 })
}).throw(/needs 2 parameters/)
})
it('keeps the context when executing the block', () => {
const template = handlebars.compile(`{{#compare value '==' 3}}{{hello}}{{/compare}}`)
const res = template({value: 3, hello: 'world'})
const res = template({ value: 3, hello: 'world' })
should(res).eql('world')
})
describe('operators', () => {
it('equal', () => {
const template = handlebars.compile(`{{#compare value '==' 3}}TRUE{{/compare}}`)
should(template({value: 3})).eql('TRUE')
should(template({value: '3'})).eql('TRUE')
should(template({value: 4})).eql('')
should(template({ value: 3 })).eql('TRUE')
should(template({ value: '3' })).eql('TRUE')
should(template({ value: 4 })).eql('')
})
it('strict equal', () => {
const template = handlebars.compile(`{{#compare value '===' 3}}TRUE{{/compare}}`)
should(template({value: 3})).eql('TRUE')
should(template({value: '3'})).eql('')
should(template({value: 4})).eql('')
should(template({ value: 3 })).eql('TRUE')
should(template({ value: '3' })).eql('')
should(template({ value: 4 })).eql('')
})
it('different', () => {
const template = handlebars.compile(`{{#compare value '!=' 3}}TRUE{{/compare}}`)
should(template({value: 3})).eql('')
should(template({value: '3'})).eql('')
should(template({value: 4})).eql('TRUE')
should(template({ value: 3 })).eql('')
should(template({ value: '3' })).eql('')
should(template({ value: 4 })).eql('TRUE')
})
it('strict different', () => {
const template = handlebars.compile(`{{#compare value '!==' 3}}TRUE{{/compare}}`)
should(template({value: 3})).eql('')
should(template({value: '3'})).eql('TRUE')
should(template({value: 4})).eql('TRUE')
should(template({ value: 3 })).eql('')
should(template({ value: '3' })).eql('TRUE')
should(template({ value: 4 })).eql('TRUE')
})
it('less than', () => {
const template = handlebars.compile(`{{#compare value '<' 3}}TRUE{{/compare}}`)
should(template({value: 2})).eql('TRUE')
should(template({value: 3})).eql('')
should(template({value: 4})).eql('')
should(template({ value: 2 })).eql('TRUE')
should(template({ value: 3 })).eql('')
should(template({ value: 4 })).eql('')
})
it('greater than', () => {
const template = handlebars.compile(`{{#compare value '>' 3}}TRUE{{/compare}}`)
should(template({value: 2})).eql('')
should(template({value: 3})).eql('')
should(template({value: 4})).eql('TRUE')
should(template({ value: 2 })).eql('')
should(template({ value: 3 })).eql('')
should(template({ value: 4 })).eql('TRUE')
})
it('less or equal', () => {
const template = handlebars.compile(`{{#compare value '<=' 3}}TRUE{{/compare}}`)
should(template({value: 2})).eql('TRUE')
should(template({value: 3})).eql('TRUE')
should(template({value: 4})).eql('')
should(template({ value: 2 })).eql('TRUE')
should(template({ value: 3 })).eql('TRUE')
should(template({ value: 4 })).eql('')
})
it('greater or equal', () => {
const template = handlebars.compile(`{{#compare value '>=' 3}}TRUE{{/compare}}`)
should(template({value: 2})).eql('')
should(template({value: 3})).eql('TRUE')
should(template({value: 4})).eql('TRUE')
should(template({ value: 2 })).eql('')
should(template({ value: 3 })).eql('TRUE')
should(template({ value: 4 })).eql('TRUE')
})
})
})

@ -8,19 +8,19 @@ describe('Handlebars helpers: date', () => {
it('renders a date as DD MMM YYYY by default', () => {
const template = handlebars.compile(`<p>{{date taken}}</p>`)
const res = template({taken: new Date(2017, 10, 27)}) // month is 0-based
const res = template({ taken: new Date(2017, 10, 27) }) // month is 0-based
should(res).eql('<p>27 Nov 2017</p>')
})
it('renders a date with a custom format', () => {
const template = handlebars.compile(`<p>{{date taken "MMMM YYYY"}}</p>`)
const res = template({taken: new Date(2017, 10, 27)}) // month is 0-based
const res = template({ taken: new Date(2017, 10, 27) }) // month is 0-based
should(res).eql('<p>November 2017</p>')
})
it('renders a date as <time ago>', () => {
const template = handlebars.compile(`<p>{{date taken "ago"}}</p>`)
const data = {taken: new Date(2017, 10, 27)} // month is 0-based
const data = { taken: new Date(2017, 10, 27) } // month is 0-based
const res = template(data)
const expected = moment(data.taken).fromNow()
should(res).match(/<p>(.*) ago<\/p>/)

@ -8,25 +8,25 @@ describe('Handlebars helpers: slice', () => {
it('renders the first N items of an array', () => {
const template = handlebars.compile(`{{#slice list count=3}}{{.}}{{/slice}}`)
const res = template({list: list})
const res = template({ list: list })
should(res).eql('123')
})
it('renders nothing if count=0', () => {
const template = handlebars.compile(`{{#slice list count=0}}{{.}}{{/slice}}`)
const res = template({list: list})
const res = template({ list: list })
should(res).eql('')
})
it('renders the whole array if count > length', () => {
const template = handlebars.compile(`{{#slice list count=20}}{{.}}{{/slice}}`)
const res = template({list: list})
const res = template({ list: list })
should(res).eql('123456789')
})
it('renders 1 item if count is not specified', () => {
const template = handlebars.compile(`{{#slice list}}{{.}}{{/slice}}`)
const res = template({list: list})
const res = template({ list: list })
should(res).eql('1')
})
})

@ -19,7 +19,7 @@ describe('Handlebars helpers: times', () => {
it('passes the context to the block', () => {
const template = handlebars.compile(`{{#times 3}}{{hello}}{{/times}}`)
const res = template({hello: 'world'})
const res = template({ hello: 'world' })
should(res).eql('worldworldworld')
})

Loading…
Cancel
Save