wikibase-cli 17.0.5 → 17.0.7
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/lib/parse_command_utils.js +13 -11
- package/package.json +2 -2
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
// Normalize prefixed statements GUIDs as returned by SPARQL queries:
|
|
2
|
+
// to the format used by Wikibase API
|
|
3
|
+
// - from: wds:Q1827902-6706334E-D27E-4F4B-B6DA-ABE7544DF11C
|
|
4
|
+
// - to: Q1827902$6706334E-D27E-4F4B-B6DA-ABE7544DF11C
|
|
5
|
+
// Also accept Q1827902-6706334E-D27E-4F4B-B6DA-ABE7544DF11C
|
|
1
6
|
export const parseGuid = guid => {
|
|
2
7
|
guid = guid
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.replace(/("|')/g, '')
|
|
12
|
-
.replace('\\$', '$')
|
|
13
|
-
.trim()
|
|
8
|
+
// Drop prefix
|
|
9
|
+
.replace(/^[a-z]+:/, '')
|
|
10
|
+
.replace(/^([QPLM]\d+(-[FS]\d+)?)-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i, '$1$$$3')
|
|
11
|
+
// Often required when getting guids from the command line, as passing a value with a $
|
|
12
|
+
// can be challenging, and require different quoting strategies
|
|
13
|
+
.replace(/("|')/g, '')
|
|
14
|
+
.replace('\\$', '$')
|
|
15
|
+
.trim()
|
|
14
16
|
return guid
|
|
15
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikibase-cli",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.7",
|
|
4
4
|
"description": "A command-line interface to Wikibase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"shell-quote": "^1.8.1",
|
|
59
59
|
"split": "^1.0.1",
|
|
60
60
|
"through": "^2.3.8",
|
|
61
|
-
"wikibase-edit": "^6.0.
|
|
61
|
+
"wikibase-edit": "^6.0.4",
|
|
62
62
|
"wikibase-sdk": "^9.2.3",
|
|
63
63
|
"wikidata-lang": "^2.0.11"
|
|
64
64
|
},
|