vxrn 2.12.0 → 2.13.0
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/dist/utils/nativeSourceContract.mjs +3 -1
- package/dist/utils/nativeSourceContract.mjs.map +1 -1
- package/dist/utils/nativeSourceContract.native.js +5 -2
- package/dist/utils/nativeSourceContract.native.js.map +1 -1
- package/package.json +13 -13
- package/src/utils/nativeSourceContract.ts +4 -3
- package/types/utils/nativeSourceContract.d.ts.map +1 -1
|
@@ -1115,7 +1115,9 @@ function nativeSourceContract(file, source) {
|
|
|
1115
1115
|
if (!language) throw new Error(`${file}: expected a .swift or .kt source file`);
|
|
1116
1116
|
const list = tokens(file, source);
|
|
1117
1117
|
const packageToken = language === "kotlin" ? list.findIndex((token) => token.text === "package") : -1;
|
|
1118
|
-
const
|
|
1118
|
+
const packageLine = packageToken < 0 ? [] : list.slice(packageToken + 1).filter((token) => token.line === list[packageToken].line);
|
|
1119
|
+
while (packageLine.at(-1)?.text === ";") packageLine.pop();
|
|
1120
|
+
const packageName = packageToken < 0 ? void 0 : packageLine.map((token) => token.text).join("");
|
|
1119
1121
|
if (packageName && !/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(packageName)) {
|
|
1120
1122
|
fail(file, list[packageToken], `unsupported kotlin package ${packageName}`);
|
|
1121
1123
|
}
|