Skip to content

Commit e2864f7

Browse files
committed
v1.12.8.0: Get rid of v10 package 'data' deprecation warnings
1 parent 5cedb47 commit e2864f7

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.12.8.0 (2022-09-04)
2+
3+
- Get rid of FVTT v10 deprecation warnings caused by legacy style package 'data' accesses.
4+
- Shim updated to v1.12.2 to also get rid of these warnings when libWrapper is not installed.
5+
- Closes [Issue #71](https://github.com/ruipin/fvtt-lib-wrapper/issues/71). Thanks to wickermoon for the issue report and fix proposal!
6+
17
# 1.12.7.2 (2022-09-02)
28

39
- Add `authors` key to the module manifest to avoid compatibility warnings in FVTT v10.

module.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "lib-wrapper",
44
"title": "libWrapper",
55
"description": "Library for wrapping core Foundry VTT methods, meant to improve compatibility between packages that wrap the same methods.",
6-
"version": "1.12.7.2",
6+
"version": "1.12.8.0",
77
"author": "Rui Pinheiro",
88
"authors": [{
99
"name": "Rui Pinheiro",

shim/shim.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// A shim for the libWrapper library
88
export let libWrapper = undefined;
99

10-
export const VERSIONS = [1,12,1];
10+
export const VERSIONS = [1,12,2];
1111
export const TGT_SPLIT_RE = new RegExp("([^.[]+|\\[('([^'\\\\]|\\\\.)+?'|\"([^\"\\\\]|\\\\.)+?\")\\])", 'g');
1212
export const TGT_CLEANUP_RE = new RegExp("(^\\['|'\\]$|^\\[\"|\"\\]$)", 'g');
1313

@@ -90,9 +90,10 @@ Hooks.once('init', () => {
9090
if(match?.length !== 3) return [null,null];
9191
const dirs = match[2].split('/');
9292
if(match[1] === 'worlds') return dirs.find(n => n && game.world.id === n) ? [game.world.id, game.world.title] : [null,null];
93-
if(match[1] === 'systems') return dirs.find(n => n && game.system.id === n) ? [game.system.id, game.system.data.title] : [null,null];
93+
if(match[1] === 'systems') return dirs.find(n => n && game.system.id === n) ? [game.system.id, game.system.title ?? game.system.data.title] : [null,null];
9494
const id = dirs.find(n => n && game.modules.has(n));
95-
return [id, game.modules.get(id)?.data?.title];
95+
const mdl = game.modules.get(id);
96+
return [id, mdl?.title ?? mdl?.data?.title];
9697
})();
9798

9899
if(!PACKAGE_ID || !PACKAGE_TITLE) {

src/shared

0 commit comments

Comments
 (0)