@aparajita/capacitor-native-decorator
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -48,2 +48,5 @@ #! /usr/bin/env node | ||
} | ||
function capitalize(str) { | ||
return `${str.at(0)?.toUpperCase()}${str.slice(1)}`; | ||
} | ||
function cli() { | ||
@@ -59,10 +62,9 @@ const pluginPath = checkPath(); | ||
const nativeMethods = [...plugin.matchAll(decoraterRE)].reduce((result, match) => { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const groups = match.groups; | ||
const returnType = ['none', 'callback'].includes(groups?.returnType ?? '') | ||
? 'CAPPluginReturnCallback' | ||
: 'CAPPluginReturnPromise'; | ||
const returnType = groups.returnType ?? 'promise'; | ||
const capReturnType = `CAPPluginReturn${capitalize(returnType)}`; | ||
result.push(pluginEntryTemplate | ||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers | ||
.replace('__method__', groups?.methodName ?? '') | ||
.replace('__type__', returnType)); | ||
.replace('__method__', groups.methodName) | ||
.replace('__type__', capReturnType)); | ||
return result; | ||
@@ -69,0 +71,0 @@ }, []); |
{ | ||
"name": "@aparajita/capacitor-native-decorator", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Decorator for Capacitor plugins that allows painless TypeScript<->native integration", | ||
@@ -41,8 +41,8 @@ "keywords": [ | ||
"push": "git push --follow-tags origin main", | ||
"release.check": "commit-and-tag-version $VERSION --dry-run", | ||
"release": "commit-and-tag-version $VERSION && pnpm push && pnpm publish" | ||
"release.check": "commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run", | ||
"release": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm push && pnpm publish" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/aparajita/capacitor-native-decorator.git" | ||
"url": "https://github.com/aparajita/capacitor-native-decorator.git" | ||
}, | ||
@@ -49,0 +49,0 @@ "bugs": { |
{ | ||
"name": "@aparajita/capacitor-native-decorator", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Decorator for Capacitor plugins that allows painless TypeScript<->native integration", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"type": "git", | ||
"url": "git+https://github.com/aparajita/capacitor-native-decorator.git" | ||
"url": "https://github.com/aparajita/capacitor-native-decorator.git" | ||
}, | ||
@@ -76,5 +76,5 @@ "bugs": { | ||
"push": "git push --follow-tags origin main", | ||
"release.check": "commit-and-tag-version $VERSION --dry-run", | ||
"release": "commit-and-tag-version $VERSION && pnpm push && pnpm publish" | ||
"release.check": "commit-and-tag-version ${VERSION:+-r $VERSION} --dry-run", | ||
"release": "commit-and-tag-version ${VERSION:+-r $VERSION} && pnpm push && pnpm publish" | ||
} | ||
} |
<div class="markdown-body"> | ||
# capacitor-native-decorator | ||
# capacitor-native-decorator [![npm version](https://badge.fury.io/js/@aparajita%2Fcapacitor-native-decorator.svg)](https://badge.fury.io/js/@aparajita%2Fcapacitor-native-decorator) | ||
@@ -5,0 +5,0 @@ This package adds a `@native` decorator to TypeScript, which fundamentally changes the way we write and call Capacitor plugins. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42471
482