From 838bd73458f3966e2d7a57b62d8b9a170f33aed4 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Fri, 12 May 2023 14:04:59 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Install=20and=20apply=20Lebab=20for=20JS=20?= =?UTF-8?q?arrows=E2=80=99=20conversions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 + package-lock.json | 976 ++++++++++++++++++++++- package.json | 1 + umap/static/umap/js/umap.autocomplete.js | 8 +- umap/static/umap/js/umap.controls.js | 48 +- umap/static/umap/js/umap.core.js | 71 +- umap/static/umap/js/umap.features.js | 2 +- umap/static/umap/js/umap.forms.js | 8 +- umap/static/umap/js/umap.js | 58 +- umap/static/umap/js/umap.layer.js | 16 +- umap/static/umap/js/umap.permissions.js | 4 +- umap/static/umap/js/umap.popup.js | 4 +- umap/static/umap/js/umap.slideshow.js | 4 +- umap/static/umap/js/umap.tableeditor.js | 4 +- umap/static/umap/js/umap.xhr.js | 20 +- 15 files changed, 1073 insertions(+), 157 deletions(-) diff --git a/Makefile b/Makefile index 13907259..277cc9c8 100644 --- a/Makefile +++ b/Makefile @@ -58,3 +58,9 @@ filepath = "${jsdir}*.js" pretty: ## Apply PrettierJS to all JS files (or specified `filepath`) ./node_modules/prettier/bin-prettier.js --write ${filepath} +lebab: ## Convert JS `filepath` to modern syntax with Lebab, then prettify + ./node_modules/lebab/bin/index.js --replace ${filepath} --transform arrow,arrow-return + $(MAKE) pretty filepath=${filepath} + +lebab-all: $(jsdir)* ## Convert all JS files to modern syntax with Lebab + prettify + for file in $^ ; do $(MAKE) lebab filepath=$${file}; done diff --git a/package-lock.json b/package-lock.json index 12bf20b4..f61fa97e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "devDependencies": { "chai": "^3.3.0", "happen": "~0.1.3", + "lebab": "^3.2.1", "mocha": "^2.3.3", "mocha-phantomjs": "^4.0.1", "optimist": "~0.4.0", @@ -67,6 +68,27 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/adm-zip": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.2.1.tgz", @@ -103,6 +125,18 @@ "safer-buffer": "~2.1.0" } }, + "node_modules/assert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", + "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", + "dev": true, + "dependencies": { + "es6-object-assign": "^1.1.0", + "is-nan": "^1.2.1", + "object-is": "^1.0.1", + "util": "^0.12.0" + } + }, "node_modules/assert-plus": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", @@ -121,6 +155,18 @@ "node": "*" } }, + "node_modules/ast-types": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.15.2.tgz", + "integrity": "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==", + "dev": true, + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -130,6 +176,18 @@ "lodash": "^4.17.14" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/aws-sign2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", @@ -253,6 +311,19 @@ "node": "*" } }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/caseless": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", @@ -482,6 +553,22 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "node_modules/define-properties": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dev": true, + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -545,6 +632,12 @@ "safer-buffer": "^2.1.0" } }, + "node_modules/es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==", + "dev": true + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -554,6 +647,91 @@ "node": ">=0.8.0" } }, + "node_modules/escope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-4.0.0.tgz", + "integrity": "sha512-E36qlD/r6RJHVpPKArgMoMlNJzoRJFH8z/cAZlI9lbc45zB3+S7i9k6e/MNb+7bZQzNEa6r8WKN3BovpeIBwgA==", + "dev": true, + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/escope/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", + "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -626,6 +804,18 @@ "node >=0.6.0" ] }, + "node_modules/f-matches": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/f-matches/-/f-matches-1.1.0.tgz", + "integrity": "sha512-8NALQS5oB1+9hkEwiRjsRroTAQ7zKmXjxe0ZcMHDRrFIR54PhSJp7Rm+Q5+tgJ7eO5ejCgbUPNXeiflX18Rt0Q==", + "dev": true, + "dependencies": { + "lodash": "^4.17.5" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/fd-slicer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", @@ -635,6 +825,15 @@ "pend": "~1.2.0" } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -687,6 +886,12 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "node_modules/generate-function": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", @@ -785,6 +990,20 @@ "georsstogeojson": "georsstogeojson" } }, + "node_modules/get-intrinsic": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -815,6 +1034,18 @@ "node": "*" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", @@ -858,6 +1089,18 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -870,6 +1113,45 @@ "node": ">=0.10.0" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasha": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", @@ -990,6 +1272,49 @@ "node": "*" } }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-my-ip-valid": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz", @@ -1009,6 +1334,22 @@ "xtend": "^4.0.0" } }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -1024,6 +1365,25 @@ "node": ">=0.10.0" } }, + "node_modules/is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -1275,6 +1635,79 @@ "resolved": "https://registry.npmjs.org/leaflet.photon/-/leaflet.photon-0.8.0.tgz", "integrity": "sha512-uvCPocNvRJaArW8yPm6K4bkgvoMCbCOA9tgFlQfOVw+mRmN4jbkuEFoSP0nJhj8UKIOWsRtGfOjxtzaJyZuciw==" }, + "node_modules/lebab": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/lebab/-/lebab-3.2.1.tgz", + "integrity": "sha512-DO7Z3pmWAT1OyY49X+I5Nhku40VL5rBMhldbRlWBrqHOruWb6siahltwzLjVn4kstfP06qLTxoy+byf9uaHrEA==", + "dev": true, + "dependencies": { + "commander": "^10.0.0", + "escope": "^4.0.0", + "espree": "^9.5.0", + "estraverse": "^5.3.0", + "f-matches": "^1.1.0", + "glob": "^9.2.1", + "lodash": "^4.17.11", + "recast": "^0.22.0" + }, + "bin": { + "lebab": "bin/index.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lebab/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/lebab/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/lebab/node_modules/glob": { + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/lebab/node_modules/minimatch": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", + "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -1337,6 +1770,15 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" }, + "node_modules/minipass": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", + "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -1783,6 +2225,31 @@ "node": "*" } }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/once": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz", @@ -1862,6 +2329,40 @@ "node": ">=0.10.0" } }, + "node_modules/path-scurry": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.8.0.tgz", + "integrity": "sha512-IjTrKseM404/UAWA8bBbL3Qp6O2wXkanuIE3seCxBH7ctRuvH1QRawy1N3nVDHGkdeZsjOsSe/8AQBL/VQCy2g==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1", + "minipass": "^5.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz", + "integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/path-scurry/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pbf": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.1.0.tgz", @@ -1981,6 +2482,22 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/recast": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.22.0.tgz", + "integrity": "sha512-5AAx+mujtXijsEavc5lWXBPQqrM4+Dl5qNH96N2aNeuJFUzpiiToKPsxQD/zAIJHspz7zz0maX0PCtCTFVlixQ==", + "dev": true, + "dependencies": { + "assert": "^2.0.0", + "ast-types": "0.15.2", + "esprima": "~4.0.0", + "source-map": "~0.6.1", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">= 4" + } + }, "node_modules/request": { "version": "2.67.0", "resolved": "https://registry.npmjs.org/request/-/request-2.67.0.tgz", @@ -2162,6 +2679,15 @@ "node": ">=0.8.0" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/sshpk": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", @@ -2386,6 +2912,12 @@ "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" }, + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, "node_modules/tunnel-agent": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", @@ -2428,12 +2960,16 @@ } }, "node_modules/util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", "dev": true, "dependencies": { - "inherits": "2.0.1" + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" } }, "node_modules/util-deprecate": { @@ -2441,12 +2977,6 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, - "node_modules/util/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -2487,6 +3017,26 @@ "which": "bin/which" } }, + "node_modules/which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -2551,6 +3101,19 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, + "acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, "adm-zip": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.2.1.tgz", @@ -2578,6 +3141,18 @@ "safer-buffer": "~2.1.0" } }, + "assert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", + "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", + "dev": true, + "requires": { + "es6-object-assign": "^1.1.0", + "is-nan": "^1.2.1", + "object-is": "^1.0.1", + "util": "^0.12.0" + } + }, "assert-plus": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", @@ -2590,6 +3165,15 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "ast-types": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.15.2.tgz", + "integrity": "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==", + "dev": true, + "requires": { + "tslib": "^2.0.1" + } + }, "async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -2599,6 +3183,12 @@ "lodash": "^4.17.14" } }, + "available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true + }, "aws-sign2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", @@ -2696,6 +3286,16 @@ } } }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, "caseless": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", @@ -2884,6 +3484,16 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "define-properties": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dev": true, + "requires": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2937,12 +3547,74 @@ "safer-buffer": "^2.1.0" } }, + "es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true }, + "escope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-4.0.0.tgz", + "integrity": "sha512-E36qlD/r6RJHVpPKArgMoMlNJzoRJFH8z/cAZlI9lbc45zB3+S7i9k6e/MNb+7bZQzNEa6r8WKN3BovpeIBwgA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "dev": true + }, + "espree": { + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", + "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "dev": true, + "requires": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -3001,6 +3673,15 @@ "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true }, + "f-matches": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/f-matches/-/f-matches-1.1.0.tgz", + "integrity": "sha512-8NALQS5oB1+9hkEwiRjsRroTAQ7zKmXjxe0ZcMHDRrFIR54PhSJp7Rm+Q5+tgJ7eO5ejCgbUPNXeiflX18Rt0Q==", + "dev": true, + "requires": { + "lodash": "^4.17.5" + } + }, "fd-slicer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", @@ -3010,6 +3691,15 @@ "pend": "~1.2.0" } }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -3055,6 +3745,12 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "generate-function": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", @@ -3141,6 +3837,17 @@ "xmldom": "~0.1.19" } }, + "get-intrinsic": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -3167,6 +3874,15 @@ "minimatch": "0.3" } }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", @@ -3205,6 +3921,15 @@ } } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -3214,6 +3939,30 @@ "ansi-regex": "^2.0.0" } }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, "hasha": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", @@ -3319,6 +4068,31 @@ "integrity": "sha512-B6L/jfyFRcG2dqKiHggWnfby52Iy07iabE4F6srQAr/OmVKBRE5uU+B5MQ+nQ7NiYnjz93gENh1GhqHzpDgHgA==", "dev": true }, + "is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, "is-my-ip-valid": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz", @@ -3338,6 +4112,16 @@ "xtend": "^4.0.0" } }, + "is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -3350,6 +4134,19 @@ "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", "dev": true }, + "is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -3573,6 +4370,60 @@ "resolved": "https://registry.npmjs.org/leaflet.photon/-/leaflet.photon-0.8.0.tgz", "integrity": "sha512-uvCPocNvRJaArW8yPm6K4bkgvoMCbCOA9tgFlQfOVw+mRmN4jbkuEFoSP0nJhj8UKIOWsRtGfOjxtzaJyZuciw==" }, + "lebab": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/lebab/-/lebab-3.2.1.tgz", + "integrity": "sha512-DO7Z3pmWAT1OyY49X+I5Nhku40VL5rBMhldbRlWBrqHOruWb6siahltwzLjVn4kstfP06qLTxoy+byf9uaHrEA==", + "dev": true, + "requires": { + "commander": "^10.0.0", + "escope": "^4.0.0", + "espree": "^9.5.0", + "estraverse": "^5.3.0", + "f-matches": "^1.1.0", + "glob": "^9.2.1", + "lodash": "^4.17.11", + "recast": "^0.22.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true + }, + "glob": { + "version": "9.3.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", + "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "minimatch": "^8.0.2", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + } + }, + "minimatch": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", + "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -3625,6 +4476,12 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" }, + "minipass": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", + "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", + "dev": true + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -3974,6 +4831,22 @@ "integrity": "sha512-VlF07iu3VV3+BTXj43Nmp6Irt/G7j/NgEctUS6IweH1RGhURjjCc2NWtzXFPXXWWfc7hgbXQdtiQu2LGp6MxUg==", "dev": true }, + "object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "once": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz", @@ -4041,6 +4914,30 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, + "path-scurry": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.8.0.tgz", + "integrity": "sha512-IjTrKseM404/UAWA8bBbL3Qp6O2wXkanuIE3seCxBH7ctRuvH1QRawy1N3nVDHGkdeZsjOsSe/8AQBL/VQCy2g==", + "dev": true, + "requires": { + "lru-cache": "^9.1.1", + "minipass": "^5.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz", + "integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==", + "dev": true + }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true + } + } + }, "pbf": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.1.0.tgz", @@ -4134,6 +5031,19 @@ "util-deprecate": "~1.0.1" } }, + "recast": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.22.0.tgz", + "integrity": "sha512-5AAx+mujtXijsEavc5lWXBPQqrM4+Dl5qNH96N2aNeuJFUzpiiToKPsxQD/zAIJHspz7zz0maX0PCtCTFVlixQ==", + "dev": true, + "requires": { + "assert": "^2.0.0", + "ast-types": "0.15.2", + "esprima": "~4.0.0", + "source-map": "~0.6.1", + "tslib": "^2.0.1" + } + }, "request": { "version": "2.67.0", "resolved": "https://registry.npmjs.org/request/-/request-2.67.0.tgz", @@ -4284,6 +5194,12 @@ "hoek": "2.x.x" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "sshpk": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", @@ -4475,6 +5391,12 @@ "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" }, + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, "tunnel-agent": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", @@ -4505,20 +5427,16 @@ "dev": true }, "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", "dev": true, "requires": { - "inherits": "2.0.1" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - } + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" } }, "util-deprecate": { @@ -4559,6 +5477,20 @@ "isexe": "^2.0.0" } }, + "which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + } + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", diff --git a/package.json b/package.json index 8302ef3a..601d6ca7 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "devDependencies": { "chai": "^3.3.0", "happen": "~0.1.3", + "lebab": "^3.2.1", "mocha": "^2.3.3", "mocha-phantomjs": "^4.0.1", "optimist": "~0.4.0", diff --git a/umap/static/umap/js/umap.autocomplete.js b/umap/static/umap/js/umap.autocomplete.js index df7966ab..c1f98bd0 100644 --- a/umap/static/umap/js/umap.autocomplete.js +++ b/umap/static/umap/js/umap.autocomplete.js @@ -130,7 +130,7 @@ L.U.AutoComplete = L.Class.extend({ onBlur: function () { var self = this - setTimeout(function () { + setTimeout(() => { self.hide() }, 100) }, @@ -207,7 +207,7 @@ L.U.AutoComplete = L.Class.extend({ resultToIndex: function (result) { var out = null - this.forEach(this.RESULTS, function (item, index) { + this.forEach(this.RESULTS, (item, index) => { if (item.item.value == result.item.value) { out = index return @@ -221,7 +221,7 @@ L.U.AutoComplete = L.Class.extend({ this.clear() this.container.style.display = 'block' this.resizeContainer() - this.forEach(data, function (item) { + this.forEach(data, (item) => { self.RESULTS.push(self.createResult(item)) }) this.CURRENT = 0 @@ -231,7 +231,7 @@ L.U.AutoComplete = L.Class.extend({ highlight: function () { var self = this - this.forEach(this.RESULTS, function (result, index) { + this.forEach(this.RESULTS, (result, index) => { if (index === self.CURRENT) L.DomUtil.addClass(result.el, 'on') else L.DomUtil.removeClass(result.el, 'on') }) diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 17e431dc..c2e7c78f 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -566,7 +566,7 @@ L.U.DataLayersControl = L.Control.extend({ if (e.finalIndex === 0) layer.bringToTop() else if (e.finalIndex > e.initialIndex) layer.insertBefore(other) else layer.insertAfter(other) - this.map.eachDataLayerReverse(function (datalayer) { + this.map.eachDataLayerReverse((datalayer) => { if (datalayer.getRank() >= minIndex) datalayer.isDirty = true }) this.map.indexDatalayers() @@ -681,7 +681,7 @@ L.U.Map.include({ filter.placeholder = L._('Filter…') filter.value = this.options.filter || '' - var addFeature = function (feature) { + var addFeature = (feature) => { var feature_li = L.DomUtil.create('li', feature.getClassName() + ' feature'), zoom_to = L.DomUtil.create('i', 'feature-zoom_to', feature_li), edit = L.DomUtil.create('i', 'show-on-edit feature-edit', feature_li), @@ -726,7 +726,7 @@ L.U.Map.include({ return feature_li } - var append = function (datalayer) { + var append = (datalayer) => { var container = L.DomUtil.create( 'div', datalayer.getHidableClass(), @@ -739,9 +739,9 @@ L.U.Map.include({ var ul = L.DomUtil.create('ul', '', container) L.DomUtil.classIf(container, 'off', !datalayer.isVisible()) - var build = function () { + var build = () => { ul.innerHTML = '' - datalayer.eachFeature(function (feature) { + datalayer.eachFeature((feature) => { if ( (filterValue && !feature.matchFilter(filterValue, filterKeys)) || feature.properties.isVisible === false @@ -752,11 +752,11 @@ L.U.Map.include({ } build() datalayer.on('datachanged', build) - datalayer.map.ui.once('panel:closed', function () { + datalayer.map.ui.once('panel:closed', () => { datalayer.off('datachanged', build) }) - datalayer.map.ui.once('panel:ready', function () { - datalayer.map.ui.once('panel:ready', function () { + datalayer.map.ui.once('panel:ready', () => { + datalayer.map.ui.once('panel:ready', () => { datalayer.off('datachanged', build) }) }) @@ -765,12 +765,12 @@ L.U.Map.include({ var appendAll = function () { this.options.filter = filterValue = filter.value featuresContainer.innerHTML = '' - this.eachBrowsableDataLayer(function (datalayer) { + this.eachBrowsableDataLayer((datalayer) => { append(datalayer) }) } var resetLayers = function () { - this.eachBrowsableDataLayer(function (datalayer) { + this.eachBrowsableDataLayer((datalayer) => { datalayer.resetLayer(true) }) } @@ -812,8 +812,8 @@ L.U.Map.include({ this.getMap().options.advancedFilters[property] = [] } }) - this.eachDataLayer(function (datalayer) { - datalayer.eachFeature(function (feature) { + this.eachDataLayer((datalayer) => { + datalayer.eachFeature((feature) => { advancedFilterKeys.forEach((property) => { if (feature.properties[property]) { if (!advancedFiltersFull[property].includes(feature.properties[property])) { @@ -875,7 +875,7 @@ L.U.Map.include({ var filterFeatures = function () { var noResults = true - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { datalayer.eachFeature(function (feature) { feature.properties.isVisible = true for (const [property, values] of Object.entries( @@ -1038,11 +1038,11 @@ L.U.Search = L.PhotonSearch.extend({ edit.title = L._('Save this location as new feature') // We need to use "mousedown" because Leaflet.Photon listen to mousedown // on el. - L.DomEvent.on(zoom, 'mousedown', function (e) { + L.DomEvent.on(zoom, 'mousedown', (e) => { L.DomEvent.stop(e) self.zoomToFeature(feature) }) - L.DomEvent.on(edit, 'mousedown', function (e) { + L.DomEvent.on(edit, 'mousedown', (e) => { L.DomEvent.stop(e) var datalayer = self.map.defaultDataLayer() var layer = datalayer.geojsonToFeatures(feature) @@ -1079,7 +1079,7 @@ L.U.SearchControl = L.Control.extend({ var link = L.DomUtil.create('a', '', container) link.href = '#' link.title = L._('Search a place name') - L.DomEvent.on(link, 'click', function (e) { + L.DomEvent.on(link, 'click', (e) => { L.DomEvent.stop(e) self.openPanel(map) }) @@ -1100,14 +1100,14 @@ L.U.SearchControl = L.Control.extend({ var resultsContainer = L.DomUtil.create('div', 'photon-autocomplete', container) this.search = new L.U.Search(map, input, options) var id = Math.random() - this.search.on('ajax:send', function () { + this.search.on('ajax:send', () => { map.fire('dataloading', { id: id }) }) - this.search.on('ajax:return', function () { + this.search.on('ajax:return', () => { map.fire('dataload', { id: id }) }) this.search.resultsContainer = resultsContainer - map.ui.once('panel:ready', function () { + map.ui.once('panel:ready', () => { input.focus() }) map.ui.openPanel({ data: { html: container } }) @@ -1214,7 +1214,7 @@ L.U.IframeExporter = L.Evented.extend({ this.queryString.feature = this.map.currentFeature.getSlug() } if (this.options.keepCurrentDatalayers) { - this.map.eachDataLayer(function (datalayer) { + this.map.eachDataLayer((datalayer) => { if (datalayer.isVisible() && datalayer.umap_id) { datalayers.push(datalayer.umap_id) } @@ -1250,7 +1250,7 @@ L.U.Editable = L.Editable.extend({ ) this.on('editable:drawing:end', this.closeTooltip) // Layer for items added by users - this.on('editable:drawing:cancel', function (e) { + this.on('editable:drawing:cancel', (e) => { if (e.layer._latlngs && e.layer._latlngs.length < e.layer.editor.MIN_VERTEX) e.layer.del() if (e.layer instanceof L.U.Marker) e.layer.del() @@ -1259,7 +1259,7 @@ L.U.Editable = L.Editable.extend({ e.layer.isDirty = true if (this.map.editedFeature !== e.layer) e.layer.edit(e) }) - this.on('editable:editing', function (e) { + this.on('editable:editing', (e) => { var layer = e.layer layer.isDirty = true if (layer._tooltip && layer.isTooltipOpen()) { @@ -1267,12 +1267,12 @@ L.U.Editable = L.Editable.extend({ layer._tooltip.update() } }) - this.on('editable:vertex:ctrlclick', function (e) { + this.on('editable:vertex:ctrlclick', (e) => { var index = e.vertex.getIndex() if (index === 0 || (index === e.vertex.getLastIndex() && e.vertex.continue)) e.vertex.continue() }) - this.on('editable:vertex:altclick', function (e) { + this.on('editable:vertex:altclick', (e) => { if (e.vertex.editor.vertexCanBeDeleted(e.vertex)) e.vertex.delete() }) this.on('editable:vertex:rawclick', this.onVertexRawClick) diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index 43f25d01..30b4d081 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -7,10 +7,8 @@ L.U.Map = L.Map.extend({}) /* * Utils */ -L.Util.queryString = function (name, fallback) { - var decode = function (s) { - return decodeURIComponent(s.replace(/\+/g, ' ')) - } +L.Util.queryString = (name, fallback) => { + var decode = (s) => decodeURIComponent(s.replace(/\+/g, ' ')) var qs = window.location.search.slice(1).split('&'), qa = {} for (var i in qs) { @@ -21,21 +19,21 @@ L.Util.queryString = function (name, fallback) { return qa[name] || fallback } -L.Util.booleanFromQueryString = function (name) { +L.Util.booleanFromQueryString = (name) => { var value = L.Util.queryString(name) return value === '1' || value === 'true' } -L.Util.setFromQueryString = function (options, name) { +L.Util.setFromQueryString = (options, name) => { var value = L.Util.queryString(name) if (typeof value !== 'undefined') options[name] = value } -L.Util.setBooleanFromQueryString = function (options, name) { +L.Util.setBooleanFromQueryString = (options, name) => { var value = L.Util.queryString(name) if (typeof value !== 'undefined') options[name] = value == '1' || value == 'true' } -L.Util.setNullableBooleanFromQueryString = function (options, name) { +L.Util.setNullableBooleanFromQueryString = (options, name) => { var value = L.Util.queryString(name) if (typeof value !== 'undefined') { if (value === 'null') value = null @@ -44,11 +42,11 @@ L.Util.setNullableBooleanFromQueryString = function (options, name) { options[name] = value } } -L.Util.escapeHTML = function (s) { +L.Util.escapeHTML = (s) => { s = s ? s.toString() : '' return s.replace(/ { if (!r) return '' var ii @@ -113,13 +111,9 @@ L.Util.toHTML = function (r) { return r } -L.Util.isObject = function (what) { - return typeof what === 'object' && what !== null -} -L.Util.CopyJSON = function (geojson) { - return JSON.parse(JSON.stringify(geojson)) -} -L.Util.detectFileType = function (f) { +L.Util.isObject = (what) => typeof what === 'object' && what !== null +L.Util.CopyJSON = (geojson) => JSON.parse(JSON.stringify(geojson)) +L.Util.detectFileType = (f) => { var filename = f.name ? escape(f.name.toLowerCase()) : '' function ext(_) { return filename.indexOf(_) !== -1 @@ -136,11 +130,10 @@ L.Util.detectFileType = function (f) { if (ext('.umap')) return 'umap' } -L.Util.usableOption = function (options, option) { - return options[option] !== undefined && options[option] !== '' -} +L.Util.usableOption = (options, option) => + options[option] !== undefined && options[option] !== '' -L.Util.greedyTemplate = function (str, data, ignore) { +L.Util.greedyTemplate = (str, data, ignore) => { function getValue(data, path) { var value = data for (var i = 0; i < path.length; i++) { @@ -152,7 +145,7 @@ L.Util.greedyTemplate = function (str, data, ignore) { return str.replace( /\{ *([\w_\:\.\|]+)(?:\|("[^"]*"))? *\}/g, - function (str, key, staticFallback) { + (str, key, staticFallback) => { var vars = key.split('|'), value, path @@ -175,10 +168,10 @@ L.Util.greedyTemplate = function (str, data, ignore) { ) } -L.Util.sortFeatures = function (features, sortKey) { +L.Util.sortFeatures = (features, sortKey) => { var sortKeys = (sortKey || 'name').split(',') - var sort = function (a, b, i) { + var sort = (a, b, i) => { var sortKey = sortKeys[i], score, valA = a.properties[sortKey] || '', @@ -194,7 +187,7 @@ L.Util.sortFeatures = function (features, sortKey) { return score } - features.sort(function (a, b) { + features.sort((a, b) => { if (!a.properties || !b.properties) { return 0 } @@ -204,12 +197,12 @@ L.Util.sortFeatures = function (features, sortKey) { return features } -L.Util.flattenCoordinates = function (coords) { +L.Util.flattenCoordinates = (coords) => { while (coords[0] && typeof coords[0][0] !== 'number') coords = coords[0] return coords } -L.Util.buildQueryString = function (params) { +L.Util.buildQueryString = (params) => { var query_string = [] for (var key in params) { query_string.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key])) @@ -217,11 +210,9 @@ L.Util.buildQueryString = function (params) { return query_string.join('&') } -L.Util.getBaseUrl = function () { - return '//' + window.location.host + window.location.pathname -} +L.Util.getBaseUrl = () => '//' + window.location.host + window.location.pathname -L.DomUtil.add = function (tagName, className, container, content) { +L.DomUtil.add = (tagName, className, container, content) => { var el = L.DomUtil.create(tagName, className, container) if (content) { if (content.nodeType && content.nodeType === 1) { @@ -233,7 +224,7 @@ L.DomUtil.add = function (tagName, className, container, content) { return el } -L.DomUtil.createFieldset = function (container, legend, options) { +L.DomUtil.createFieldset = (container, legend, options) => { options = options || {} var fieldset = L.DomUtil.create('div', 'fieldset toggle', container) var legendEl = L.DomUtil.add('h5', 'legend style_options_toggle', fieldset, legend) @@ -249,12 +240,12 @@ L.DomUtil.createFieldset = function (container, legend, options) { return fieldsEl } -L.DomUtil.classIf = function (el, className, bool) { +L.DomUtil.classIf = (el, className, bool) => { if (bool) L.DomUtil.addClass(el, className) else L.DomUtil.removeClass(el, className) } -L.DomUtil.element = function (what, attrs, parent) { +L.DomUtil.element = (what, attrs, parent) => { var el = document.createElement(what) for (var attr in attrs) { el[attr] = attrs[attr] @@ -265,19 +256,19 @@ L.DomUtil.element = function (what, attrs, parent) { return el } -L.DomUtil.before = function (target, el) { +L.DomUtil.before = (target, el) => { target.parentNode.insertBefore(el, target) return el } -L.DomUtil.after = function (target, el) { +L.DomUtil.after = (target, el) => { target.parentNode.insertBefore(el, target.nextSibling) return el } L.DomUtil.RGBRegex = /rgb *\( *([0-9]{1,3}) *, *([0-9]{1,3}) *, *([0-9]{1,3}) *\)/ -L.DomUtil.TextColorFromBackgroundColor = function (el) { +L.DomUtil.TextColorFromBackgroundColor = (el) => { var out = '#000000' if (!window.getComputedStyle) { return out @@ -293,7 +284,7 @@ L.DomUtil.TextColorFromBackgroundColor = function (el) { } return out } -L.DomEvent.once = function (el, types, fn, context) { +L.DomEvent.once = (el, types, fn, context) => { // cf https://github.com/Leaflet/Leaflet/pull/3528#issuecomment-134551575 if (typeof types === 'object') { @@ -303,7 +294,7 @@ L.DomEvent.once = function (el, types, fn, context) { return L.DomEvent } - var handler = L.bind(function () { + var handler = L.bind(() => { L.DomEvent.off(el, types, fn, context).off(el, types, handler, context) }, L.DomEvent) @@ -405,7 +396,7 @@ L.U.Help = L.Class.extend({ self = this, title = L.DomUtil.create('h3', '', container), actionsContainer = L.DomUtil.create('ul', 'umap-edit-actions', container) - var addAction = function (action) { + var addAction = (action) => { var actionContainer = L.DomUtil.add('li', '', actionsContainer) L.DomUtil.add('i', action.options.className, actionContainer), L.DomUtil.add('span', '', actionContainer, action.options.tooltip) diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index ba92dd38..7cf5903c 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -622,7 +622,7 @@ L.U.Marker = L.Marker.extend({ zoomTo: function (e) { if (this.datalayer.isClustered() && !this._icon) { // callback is mandatory for zoomToShowLayer - this.datalayer.layer.zoomToShowLayer(this, e.callback || function () {}) + this.datalayer.layer.zoomToShowLayer(this, e.callback || (() => {})) } else { L.U.FeatureMixin.zoomTo.call(this, e) } diff --git a/umap/static/umap/js/umap.forms.js b/umap/static/umap/js/umap.forms.js index eef555ce..a2ca0558 100644 --- a/umap/static/umap/js/umap.forms.js +++ b/umap/static/umap/js/umap.forms.js @@ -296,7 +296,7 @@ L.FormBuilder.ColorPicker = L.FormBuilder.Input.extend({ onBlur: function () { var self = this, - closePicker = function () { + closePicker = () => { self.container.style.display = 'none' } // We must leave time for the click to be listened. @@ -395,7 +395,7 @@ L.FormBuilder.SlideshowDelay = L.FormBuilder.IntSelect.extend({ L.FormBuilder.DataLayerSwitcher = L.FormBuilder.Select.extend({ getOptions: function () { var options = [] - this.builder.map.eachDataLayerReverse(function (datalayer) { + this.builder.map.eachDataLayerReverse((datalayer) => { if (datalayer.isLoaded() && !datalayer.isRemoteLayer() && datalayer.canBrowse()) { options.push([L.stamp(datalayer), datalayer.getName()]) } @@ -864,9 +864,7 @@ L.FormBuilder.ManageEditors = L.FormBuilder.Element.extend({ }, onUnselect: function (choice) { - var index = this._values.findIndex(function (item) { - return item.id === choice.item.value - }) + var index = this._values.findIndex((item) => item.id === choice.item.value) if (index !== -1) { this._values.splice(index, 1) this.set() diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index d9479f0e..7b6e911f 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -255,7 +255,7 @@ L.U.Map.include({ if (slug && this.features_index[slug]) this.features_index[slug].view() }) - window.onbeforeunload = function (e) { + window.onbeforeunload = (e) => { var msg = L._('You have unsaved changes.') if (self.isDirty) { e.returnValue = msg @@ -374,19 +374,19 @@ L.U.Map.include({ var toload = (dataToload = seen = this.options.datalayers.length), self = this, datalayer - var loaded = function () { + var loaded = () => { self.datalayersLoaded = true self.fire('datalayersloaded') } - var decrementToLoad = function () { + var decrementToLoad = () => { toload-- if (toload === 0) loaded() } - var dataLoaded = function () { + var dataLoaded = () => { self.dataLoaded = true self.fire('dataloaded') } - var decrementDataToLoad = function () { + var decrementDataToLoad = () => { dataToload-- if (dataToload === 0) dataLoaded() } @@ -413,7 +413,7 @@ L.U.Map.include({ }, ensurePanesOrder: function () { - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { datalayer.bringToTop() }) }, @@ -707,7 +707,7 @@ L.U.Map.include({ updateTileLayers: function () { var self = this, - callback = function (tilelayer) { + callback = (tilelayer) => { self.options.tilelayer = tilelayer.toJSON() self.isDirty = true } @@ -755,7 +755,7 @@ L.U.Map.include({ UIFields.push('queryString.' + this.HIDDABLE_CONTROLS[i] + 'Control') } var iframeExporter = new L.U.IframeExporter(this) - var buildIframeCode = function () { + var buildIframeCode = () => { iframe.innerHTML = iframeExporter.build() } buildIframeCode() @@ -785,7 +785,7 @@ L.U.Map.include({ L._('Only visible features will be downloaded.') ) exportCaveat.id = 'export_caveat_text' - var toggleCaveat = function () { + var toggleCaveat = () => { if (typeInput.value === 'umap') exportCaveat.style.display = 'none' else exportCaveat.style.display = 'inherit' } @@ -853,7 +853,7 @@ L.U.Map.include({ toGeoJSON: function () { var features = [] - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { if (datalayer.isVisible()) { features = features.concat(datalayer.featuresToGeoJSON()) } @@ -901,7 +901,7 @@ L.U.Map.include({ var clearFlag = L.DomUtil.create('input', '', clearLabel) clearFlag.type = 'checkbox' clearFlag.name = 'clear' - this.eachDataLayerReverse(function (datalayer) { + this.eachDataLayerReverse((datalayer) => { if (datalayer.isLoaded() && !datalayer.isRemoteLayer()) { var id = L.stamp(datalayer) option = L.DomUtil.create('option', '', layerInput) @@ -993,7 +993,7 @@ L.U.Map.include({ L.DomEvent.on( fileInput, 'change', - function (e) { + (e) => { var type = '', newType for (var i = 0; i < e.target.files.length; i++) { @@ -1026,7 +1026,7 @@ L.U.Map.include({ if (importedData.geometry) this.options.center = this.latLng(importedData.geometry) var self = this - importedData.layers.forEach(function (geojson) { + importedData.layers.forEach((geojson) => { var dataLayer = self.createDataLayer() dataLayer.fromUmapGeoJSON(geojson) }) @@ -1034,7 +1034,7 @@ L.U.Map.include({ this.initTileLayers() this.renderControls() this.handleLimitBounds() - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { if (mustReindex) datalayer.reindex() datalayer.redraw() }) @@ -1046,7 +1046,7 @@ L.U.Map.include({ var reader = new FileReader() reader.readAsText(file) var self = this - reader.onload = function (e) { + reader.onload = (e) => { var rawData = e.target.result try { self.importRaw(rawData) @@ -1082,7 +1082,7 @@ L.U.Map.include({ description.innerHTML = L.Util.toHTML(this.options.description) } var datalayerContainer = L.DomUtil.create('div', 'datalayer-container', container) - this.eachVisibleDataLayer(function (datalayer) { + this.eachVisibleDataLayer((datalayer) => { var p = L.DomUtil.create('p', '', datalayerContainer), color = L.DomUtil.create('span', 'datalayer-color', p), headline = L.DomUtil.create('strong', '', p), @@ -1169,15 +1169,11 @@ L.U.Map.include({ }, eachBrowsableDataLayer: function (method, context) { - this.eachDataLayerReverse(method, context, function (d) { - return d.allowBrowse() - }) + this.eachDataLayerReverse(method, context, (d) => d.allowBrowse()) }, eachVisibleDataLayer: function (method, context) { - this.eachDataLayerReverse(method, context, function (d) { - return d.isVisible() - }) + this.eachDataLayerReverse(method, context, (d) => d.isVisible()) }, findDataLayer: function (method, context) { @@ -1196,7 +1192,7 @@ L.U.Map.include({ if (this.editTools) this.editTools.stopDrawing() this.resetOptions() this.datalayers_index = [].concat(this._datalayers_index_bk) - this.dirty_datalayers.slice().forEach(function (datalayer) { + this.dirty_datalayers.slice().forEach((datalayer) => { if (datalayer.isDeleted) datalayer.connectToMap() datalayer.reset() }) @@ -1305,7 +1301,7 @@ L.U.Map.include({ layers: [], } - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { umapfile.layers.push(datalayer.umapGeoJSON()) }) @@ -1389,7 +1385,7 @@ L.U.Map.include({ ) { return datalayer } - datalayer = this.findDataLayer(function (datalayer) { + datalayer = this.findDataLayer((datalayer) => { if (!datalayer.isRemoteLayer() && datalayer.canBrowse()) { fallback = datalayer if (datalayer.isVisible()) return true @@ -1405,9 +1401,7 @@ L.U.Map.include({ }, getDataLayerByUmapId: function (umap_id) { - return this.findDataLayer(function (d) { - return d.umap_id == umap_id - }) + return this.findDataLayer((d) => d.umap_id == umap_id) }, _editControls: function (container) { @@ -1453,7 +1447,7 @@ L.U.Map.include({ builder = new L.U.FormBuilder(this, shapeOptions, { callback: function (e) { - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { datalayer.redraw() }) }, @@ -1516,7 +1510,7 @@ L.U.Map.include({ builder = new L.U.FormBuilder(this, optionsFields, { callback: function (e) { this.initCaptionBar() - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { if (e.helper.field === 'options.sortKey') datalayer.reindex() datalayer.redraw() }) @@ -1546,7 +1540,7 @@ L.U.Map.include({ e.helper.field === 'options.popupShape' ) return - this.eachDataLayer(function (datalayer) { + this.eachDataLayer((datalayer) => { datalayer.redraw() }) }, @@ -1990,7 +1984,7 @@ L.U.Map.include({ }, empty: function () { - this.eachDataLayerReverse(function (datalayer) { + this.eachDataLayerReverse((datalayer) => { datalayer._delete() }) }, diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index cae8ba3b..c64ccede 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -343,7 +343,7 @@ L.U.DataLayer = L.Evented.extend({ reindex: function () { var features = [] - this.eachFeature(function (feature) { + this.eachFeature((feature) => { features.push(feature) }) L.Util.sortFeatures(features, this.map.getOption('sortKey')) @@ -375,7 +375,7 @@ L.U.DataLayer = L.Evented.extend({ verb: 'GET', callback: function (raw) { self.clear() - self.rawToGeoJSON(raw, self.options.remoteData.format, function (geojson) { + self.rawToGeoJSON(raw, self.options.remoteData.format, (geojson) => { self.fromGeoJSON(geojson) }) }, @@ -509,16 +509,14 @@ L.U.DataLayer = L.Evented.extend({ addRawData: function (c, type) { var self = this - this.rawToGeoJSON(c, type, function (geojson) { + this.rawToGeoJSON(c, type, (geojson) => { self.addData(geojson) }) }, rawToGeoJSON: function (c, type, callback) { var self = this - var toDom = function (x) { - return new DOMParser().parseFromString(x, 'text/xml') - } + var toDom = (x) => new DOMParser().parseFromString(x, 'text/xml') // TODO add a duck typing guessType if (type === 'csv') { @@ -528,7 +526,7 @@ L.U.DataLayer = L.Evented.extend({ delimiter: 'auto', includeLatLon: false, }, - function (err, result) { + (err, result) => { if (err) { var message if (err.type === 'Error') { @@ -674,7 +672,7 @@ L.U.DataLayer = L.Evented.extend({ self = this type = type || L.Util.detectFileType(f) reader.readAsText(f) - reader.onload = function (e) { + reader.onload = (e) => { self.importRaw(e.target.result, type) } }, @@ -1034,7 +1032,7 @@ L.U.DataLayer = L.Evented.extend({ featuresToGeoJSON: function () { var features = [] - this.eachLayer(function (layer) { + this.eachLayer((layer) => { features.push(layer.toGeoJSON()) }) return features diff --git a/umap/static/umap/js/umap.permissions.js b/umap/static/umap/js/umap.permissions.js index 2592c32d..90eab5f1 100644 --- a/umap/static/umap/js/umap.permissions.js +++ b/umap/static/umap/js/umap.permissions.js @@ -140,9 +140,7 @@ L.U.MapPermissions = L.Class.extend({ if (!this.isDirty) return this.map.continueSaving() var formData = new FormData() if (!this.isAnonymousMap() && this.options.editors) { - var editors = this.options.editors.map(function (u) { - return u.id - }) + var editors = this.options.editors.map((u) => u.id) for (var i = 0; i < this.options.editors.length; i++) formData.append('editors', this.options.editors[i].id) } diff --git a/umap/static/umap/js/umap.popup.js b/umap/static/umap/js/umap.popup.js index 0bcd2baa..6a729a69 100644 --- a/umap/static/umap/js/umap.popup.js +++ b/umap/static/umap/js/umap.popup.js @@ -136,10 +136,10 @@ L.U.PopupTemplate.Default = L.Class.extend({ feature: prev.properties.name || L._('previous'), }) zoomLi.title = L._('Zoom to this feature') - L.DomEvent.on(nextLi, 'click', function () { + L.DomEvent.on(nextLi, 'click', () => { if (next) next.zoomTo({ callback: next.view }) }) - L.DomEvent.on(previousLi, 'click', function () { + L.DomEvent.on(previousLi, 'click', () => { if (prev) prev.zoomTo({ callback: prev.view }) }) L.DomEvent.on( diff --git a/umap/static/umap/js/umap.slideshow.js b/umap/static/umap/js/umap.slideshow.js index 54d89c54..aae7772d 100644 --- a/umap/static/umap/js/umap.slideshow.js +++ b/umap/static/umap/js/umap.slideshow.js @@ -62,9 +62,7 @@ L.U.Slideshow = L.Class.extend({ }, defaultDatalayer: function () { - return this.map.findDataLayer(function (d) { - return d.allowBrowse() && d.hasData() - }) + return this.map.findDataLayer((d) => d.allowBrowse() && d.hasData()) }, timeSpinner: function () { diff --git a/umap/static/umap/js/umap.tableeditor.js b/umap/static/umap/js/umap.tableeditor.js index 423d73ce..92506952 100644 --- a/umap/static/umap/js/umap.tableeditor.js +++ b/umap/static/umap/js/umap.tableeditor.js @@ -27,7 +27,7 @@ L.U.TableEditor = L.Class.extend({ L._('Are you sure you want to delete this property on all the features?') ) ) { - this.datalayer.eachLayer(function (feature) { + this.datalayer.eachLayer((feature) => { feature.deleteProperty(property) }) this.datalayer.deindexProperty(property) @@ -38,7 +38,7 @@ L.U.TableEditor = L.Class.extend({ var doRename = function () { var newName = prompt(L._('Please enter the new name of this property'), property) if (!newName || !this.validateName(newName)) return - this.datalayer.eachLayer(function (feature) { + this.datalayer.eachLayer((feature) => { feature.renameProperty(property, newName) }) this.datalayer.deindexProperty(property) diff --git a/umap/static/umap/js/umap.xhr.js b/umap/static/umap/js/umap.xhr.js index 7e0ca806..4ffec117 100644 --- a/umap/static/umap/js/umap.xhr.js +++ b/umap/static/umap/js/umap.xhr.js @@ -6,7 +6,7 @@ L.U.Xhr = L.Evented.extend({ _wrapper: function () { var wrapper if (window.XMLHttpRequest === undefined) { - wrapper = function () { + wrapper = () => { try { return new window.ActiveXObject('Microsoft.XMLHTTP.6.0') } catch (e1) { @@ -28,7 +28,7 @@ L.U.Xhr = L.Evented.extend({ id = Math.random(), self = this this.fire('dataloading', { id: id }) - var loaded = function () { + var loaded = () => { self.fire('dataload', { id: id }) } @@ -58,7 +58,7 @@ L.U.Xhr = L.Evented.extend({ } } - xhr.onreadystatechange = function () { + xhr.onreadystatechange = () => { if (xhr.readyState === 4) { if (xhr.status == 200) { settings.callback.call(settings.context || xhr, xhr.responseText, xhr) @@ -194,7 +194,7 @@ L.U.Xhr = L.Evented.extend({ if (!form) return L.DomEvent.on(form, 'submit', L.DomEvent.stopPropagation) .on(form, 'submit', L.DomEvent.preventDefault) - .on(form, 'submit', function () { + .on(form, 'submit', () => { self.submit_form(form_id, options) }) }, @@ -203,7 +203,7 @@ L.U.Xhr = L.Evented.extend({ var link = L.DomUtil.get(link_id), self = this if (link) { - L.DomEvent.on(link, 'click', L.DomEvent.stop).on(link, 'click', function () { + L.DomEvent.on(link, 'click', L.DomEvent.stop).on(link, 'click', () => { if (options.confirm && !confirm(options.confirm)) { return } @@ -252,12 +252,12 @@ L.U.Xhr = L.Evented.extend({ // data.html: login form // args: args of the first _json call, to call again at process end var self = this - var proceed = function () { + var proceed = () => { self.ui.closePanel() if (typeof args !== 'undefined') self._json.apply(self, args) else self.default_callback(data, {}) } - var ask_for_login = function (data) { + var ask_for_login = (data) => { self.ui.openPanel({ data: data, className: 'login-panel' }) self.listen_form('login_form', { callback: function (data) { @@ -267,12 +267,12 @@ L.U.Xhr = L.Evented.extend({ }) // Auth links var links = document.getElementsByClassName('umap-login-popup') - Object.keys(links).forEach(function (el) { + Object.keys(links).forEach((el) => { var link = links[el] - L.DomEvent.on(link, 'click', L.DomEvent.stop).on(link, 'click', function () { + L.DomEvent.on(link, 'click', L.DomEvent.stop).on(link, 'click', () => { self.ui.closePanel() var win = window.open(link.href) - window.umap_proceed = function () { + window.umap_proceed = () => { proceed() win.close() } From d88eee9ca42765f3f2da382d2574403d6a53618e Mon Sep 17 00:00:00 2001 From: David Larlet Date: Tue, 16 May 2023 16:19:14 -0400 Subject: [PATCH 2/2] Manual lebab conversions --- umap/static/umap/js/umap.autocomplete.js | 11 ++---- umap/static/umap/js/umap.layer.js | 43 ++++++++---------------- 2 files changed, 17 insertions(+), 37 deletions(-) diff --git a/umap/static/umap/js/umap.autocomplete.js b/umap/static/umap/js/umap.autocomplete.js index c1f98bd0..04d66558 100644 --- a/umap/static/umap/js/umap.autocomplete.js +++ b/umap/static/umap/js/umap.autocomplete.js @@ -129,10 +129,7 @@ L.U.AutoComplete = L.Class.extend({ }, onBlur: function () { - var self = this - setTimeout(() => { - self.hide() - }, 100) + setTimeout(() => this.hide(), 100) }, clear: function () { @@ -217,12 +214,11 @@ L.U.AutoComplete = L.Class.extend({ }, handleResults: function (data) { - var self = this this.clear() this.container.style.display = 'block' this.resizeContainer() this.forEach(data, (item) => { - self.RESULTS.push(self.createResult(item)) + this.RESULTS.push(this.createResult(item)) }) this.CURRENT = 0 this.highlight() @@ -230,9 +226,8 @@ L.U.AutoComplete = L.Class.extend({ }, highlight: function () { - var self = this this.forEach(this.RESULTS, (result, index) => { - if (index === self.CURRENT) L.DomUtil.addClass(result.el, 'on') + if (index === this.CURRENT) L.DomUtil.addClass(result.el, 'on') else L.DomUtil.removeClass(result.el, 'on') }) }, diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index c64ccede..6b9c5750 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -343,9 +343,7 @@ L.U.DataLayer = L.Evented.extend({ reindex: function () { var features = [] - this.eachFeature((feature) => { - features.push(feature) - }) + this.eachFeature((feature) => features.push(feature)) L.Util.sortFeatures(features, this.map.getOption('sortKey')) this._index = [] for (var i = 0; i < features.length; i++) { @@ -366,18 +364,17 @@ L.U.DataLayer = L.Evented.extend({ } if (!this.options.remoteData.dynamic && this.hasDataLoaded()) return if (!this.isVisible()) return - var self = this, - url = this.map.localizeUrl(this.options.remoteData.url) + var url = this.map.localizeUrl(this.options.remoteData.url) if (this.options.remoteData.proxy) url = this.map.proxyUrl(url, this.options.remoteData.ttl) this.map.ajax({ uri: url, verb: 'GET', - callback: function (raw) { - self.clear() - self.rawToGeoJSON(raw, self.options.remoteData.format, (geojson) => { - self.fromGeoJSON(geojson) - }) + callback: (raw) => { + this.clear() + this.rawToGeoJSON(raw, this.options.remoteData.format, (geojson) => + this.fromGeoJSON(geojson) + ) }, }) }, @@ -508,14 +505,10 @@ L.U.DataLayer = L.Evented.extend({ }, addRawData: function (c, type) { - var self = this - this.rawToGeoJSON(c, type, (geojson) => { - self.addData(geojson) - }) + this.rawToGeoJSON(c, type, (geojson) => this.addData(geojson)) }, rawToGeoJSON: function (c, type, callback) { - var self = this var toDom = (x) => new DOMParser().parseFromString(x, 'text/xml') // TODO add a duck typing guessType @@ -537,7 +530,7 @@ L.U.DataLayer = L.Evented.extend({ message: err[0].message, }) } - self.map.ui.alert({ content: message, level: 'error', duration: 10000 }) + this.map.ui.alert({ content: message, level: 'error', duration: 10000 }) console.log(err) } if (result && result.features.length) { @@ -564,7 +557,7 @@ L.U.DataLayer = L.Evented.extend({ var gj = JSON.parse(c) callback(gj) } catch (err) { - self.map.ui.alert({ content: 'Invalid JSON file: ' + err }) + this.map.ui.alert({ content: 'Invalid JSON file: ' + err }) return } } @@ -668,24 +661,18 @@ L.U.DataLayer = L.Evented.extend({ }, importFromFile: function (f, type) { - var reader = new FileReader(), - self = this + var reader = new FileReader() type = type || L.Util.detectFileType(f) reader.readAsText(f) - reader.onload = (e) => { - self.importRaw(e.target.result, type) - } + reader.onload = (e) => this.importRaw(e.target.result, type) }, importFromUrl: function (url, type) { url = this.map.localizeUrl(url) - var self = this this.map.xhr._ajax({ verb: 'GET', uri: url, - callback: function (data) { - self.importRaw(data, type) - }, + callback: (data) => this.importRaw(data, type), }) }, @@ -1032,9 +1019,7 @@ L.U.DataLayer = L.Evented.extend({ featuresToGeoJSON: function () { var features = [] - this.eachLayer((layer) => { - features.push(layer.toGeoJSON()) - }) + this.eachLayer((layer) => features.push(layer.toGeoJSON())) return features },