wikibase-cli 18.3.0 → 18.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,7 +23,7 @@ This project received [a Wikimedia Project Grant](https://meta.wikimedia.org/wik
23
23
  [![DockerHub Badge](https://dockeri.co/image/maxlath/wikibase-cli)](https://hub.docker.com/r/maxlath/wikibase-cli/)
24
24
 
25
25
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
26
- [![Node](https://img.shields.io/badge/node-%3E=%20v6.4.0-brightgreen.svg)](http://nodejs.org)
26
+ [![Node](https://img.shields.io/badge/node-%3E=%20v18-brightgreen.svg)](http://nodejs.org)
27
27
  [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
28
28
 
29
29
  [Download stats](https://npm-stat.com/charts.html?package=wikibase-cli)
@@ -55,7 +55,7 @@ See [CHANGELOG.md](CHANGELOG.md) for version info
55
55
  ## Dependencies
56
56
 
57
57
  ### General
58
- * [NodeJs](https://nodejs.org) **>= v14** (recommended way to install it: use the awesome [NVM](https://github.com/creationix/nvm) to install the latest LTS version `nvm install --lts`)
58
+ * [NodeJs](https://nodejs.org) **>= v18** (recommended way to install it: use [NVM](https://github.com/creationix/nvm) to install the latest LTS version `nvm install --lts`)
59
59
  * [Git](https://git-scm.com/)
60
60
 
61
61
  ### Per feature
@@ -2,7 +2,18 @@ import errors_ from './errors.js'
2
2
  import validateFunctionArgs from './validate_function_args.js'
3
3
 
4
4
  export async function executeFunction (absoluePath, inputArgs) {
5
- let { default: fn } = await import(absoluePath)
5
+ const module = await import(absoluePath)
6
+ const firstArg = inputArgs[0]
7
+ let fn
8
+ if (firstArg && typeof module[firstArg] === 'function') {
9
+ fn = module[firstArg]
10
+ inputArgs.shift()
11
+ } else {
12
+ fn = module.default
13
+ }
14
+
15
+ if (typeof fn !== 'function') throw new Error('function not found')
16
+
6
17
  let metadata
7
18
 
8
19
  if (fn && fn.template) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikibase-cli",
3
- "version": "18.3.0",
3
+ "version": "18.3.2",
4
4
  "description": "A command-line interface to Wikibase",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "homepage": "https://github.com/maxlath/wikibase-cli#readme",
49
49
  "dependencies": {
50
- "chalk": "^5.3.0",
50
+ "chalk": "^5.4.1",
51
51
  "commander": "^6.0.0",
52
52
  "copy-paste": "^1.5.0",
53
53
  "lodash-es": "^4.17.21",
@@ -57,7 +57,7 @@
57
57
  "shell-quote": "^1.8.1",
58
58
  "split": "^1.0.1",
59
59
  "through": "^2.3.8",
60
- "wikibase-edit": "^7.1.2",
60
+ "wikibase-edit": "^7.2.3",
61
61
  "wikibase-sdk": "^10.1.0",
62
62
  "wikidata-lang": "^2.0.11"
63
63
  },