apibuilder-js
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -357,3 +357,3 @@ import { FullyQualifiedName } from '../language'; | ||
*/ | ||
get nickname(): void; | ||
get nickname(): string; | ||
get url(): string; | ||
@@ -360,0 +360,0 @@ get path(): string; |
@@ -16,2 +16,5 @@ "use strict"; | ||
} | ||
function pascalCase(string) { | ||
return lodash_1.upperFirst(lodash_1.camelCase(string)); | ||
} | ||
/** | ||
@@ -655,3 +658,23 @@ * An array is an enclosing type which points to another type. | ||
get: function () { | ||
throw new Error('Not Implemented'); | ||
var path = this.config.path; | ||
if (this.resource.path != null) { | ||
path = path.replace(this.resource.path, ''); | ||
} | ||
if (path.startsWith('/')) { | ||
path = path.slice(1); | ||
} | ||
var parts = path.split('/'); | ||
var dynamicParts = parts.filter(function (part) { | ||
return part.startsWith(':'); | ||
}).map(function (part, index) { | ||
var prefix = index === 0 ? 'By' : 'And'; | ||
return prefix + pascalCase(part); | ||
}); | ||
var staticParts = parts.filter(function (part) { | ||
return !part.startsWith(':'); | ||
}).map(function (part, index) { | ||
var prefix = index === 0 ? '' : 'And'; | ||
return prefix + pascalCase(part); | ||
}); | ||
return this.method.toLowerCase() + staticParts.concat(dynamicParts).join(''); | ||
}, | ||
@@ -658,0 +681,0 @@ enumerable: true, |
{ | ||
"name": "apibuilder-js", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "A reference implementation of API Builder for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -33,2 +33,6 @@ import { camelCase, flatMap, map, matchesProperty, overSome, snakeCase, toUpper, upperFirst } from 'lodash'; | ||
function pascalCase(string: string) { | ||
return upperFirst(camelCase(string)); | ||
} | ||
export interface ApiBuilderAnnotationConfig { | ||
@@ -772,3 +776,29 @@ readonly name: string; | ||
get nickname() { | ||
throw new Error('Not Implemented'); | ||
let path = this.config.path; | ||
if (this.resource.path != null) { | ||
path = path.replace(this.resource.path, ''); | ||
} | ||
if (path.startsWith('/')) { | ||
path = path.slice(1); | ||
} | ||
const parts = path.split('/'); | ||
const dynamicParts = parts.filter((part) => { | ||
return part.startsWith(':'); | ||
}).map((part, index) => { | ||
const prefix = index === 0 ? 'By' : 'And'; | ||
return prefix + pascalCase(part); | ||
}); | ||
const staticParts = parts.filter((part) => { | ||
return !part.startsWith(':'); | ||
}).map((part, index) => { | ||
const prefix = index === 0 ? '' : 'And'; | ||
return prefix + pascalCase(part); | ||
}); | ||
return this.method.toLowerCase() + staticParts.concat(dynamicParts).join(''); | ||
} | ||
@@ -775,0 +805,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
328871
10394
0