multi-convention-namer
Advanced tools
Comparing version 0.1.10 to 0.1.11
366
API.md
@@ -1,183 +0,335 @@ | ||
# API Reference | ||
# API Reference <a name="API Reference"></a> | ||
**Classes** | ||
Name|Description | ||
----|----------- | ||
[Namer](#multi-convention-namer-namer)|*No description* | ||
## Structs <a name="Structs"></a> | ||
### NamerProps <a name="multi-convention-namer.NamerProps"></a> | ||
**Structs** | ||
#### Initializer <a name="[object Object].Initializer"></a> | ||
Name|Description | ||
----|----------- | ||
[NamerProps](#multi-convention-namer-namerprops)|*No description* | ||
```typescript | ||
import { NamerProps } from 'multi-convention-namer' | ||
const namerProps: NamerProps = { ... } | ||
``` | ||
**Enums** | ||
##### `defaultFormat`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.defaultFormat"></a> | ||
Name|Description | ||
----|----------- | ||
[Format](#multi-convention-namer-format)|Too many naming conventions? | ||
```typescript | ||
public readonly defaultFormat: Format; | ||
``` | ||
- *Type:* [`multi-convention-namer.Format`](#multi-convention-namer.Format) | ||
- *Default:* raise an error if no default specified and toString invoked | ||
When using toString(), which format should be provided? | ||
## class Namer <a id="multi-convention-namer-namer"></a> | ||
--- | ||
##### `deleteCharacters`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.deleteCharacters"></a> | ||
```typescript | ||
public readonly deleteCharacters: string; | ||
``` | ||
- *Type:* `string` | ||
- *Default:* '-_' | ||
### Initializer | ||
Characters to strip from name parts. | ||
--- | ||
Create a namer. | ||
##### `illegalCharacters`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.illegalCharacters"></a> | ||
```ts | ||
new Namer(parts: Array<string>, props?: NamerProps) | ||
```typescript | ||
public readonly illegalCharacters: string; | ||
``` | ||
* **parts** (<code>Array<string></code>) an array of strings to be composed into a name. | ||
* **props** (<code>[NamerProps](#multi-convention-namer-namerprops)</code>) modify the behavior of namer. | ||
* **defaultFormat** (<code>[Format](#multi-convention-namer-format)</code>) When using toString(), which format should be provided? __*Default*__: raise an error if no default specified and toString invoked | ||
* **deleteCharacters** (<code>string</code>) Characters to strip from name parts. __*Default*__: '-_' | ||
* **illegalCharacters** (<code>string</code>) Characters which will cause an error if included in a name part tested AFTER deleteCharacters. __*Default*__: '! | ||
* **maxLength** (<code>number</code>) How long can the name be? __*Default*__: no limit | ||
* **maxLengthTruncateHead** (<code>boolean</code>) If the name exceeds maxLength, should I snip the head or the tail? __*Default*__: false | ||
* **maxPartLength** (<code>number</code>) How long can a part of the name be? __*Default*__: no limit | ||
* **maxPartLengthTruncateHead** (<code>boolean</code>) If the part exceeds maxPartLength, should I snip the head or the tail? __*Default*__: false | ||
* **uniqueSeed** (<code>any</code>) Include a uniquifying suffix? __*Default*__: do not include a uniquifier | ||
- *Type:* `string` | ||
- *Default:* '! | ||
Characters which will cause an error if included in a name part tested AFTER deleteCharacters. | ||
--- | ||
### Properties | ||
##### `maxLength`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.maxLength"></a> | ||
```typescript | ||
public readonly maxLength: number; | ||
``` | ||
Name | Type | Description | ||
-----|------|------------- | ||
**camel** | <code>string</code> | camelCase. | ||
**kebab** | <code>string</code> | kebab-case. | ||
**parts** | <code>Array<string></code> | <span></span> | ||
**partsWithUnique** | <code>Array<string></code> | <span></span> | ||
**pascal** | <code>string</code> | PascalCase. | ||
**snake** | <code>string</code> | snake_case. | ||
**props**? | <code>[NamerProps](#multi-convention-namer-namerprops)</code> | __*Optional*__ | ||
- *Type:* `number` | ||
- *Default:* no limit | ||
### Methods | ||
How long can the name be? | ||
--- | ||
#### addPrefix(prefix, props?) <a id="multi-convention-namer-namer-addprefix"></a> | ||
##### `maxLengthTruncateHead`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.maxLengthTruncateHead"></a> | ||
Create a new Namer with the added prefix. | ||
```typescript | ||
public readonly maxLengthTruncateHead: boolean; | ||
``` | ||
```ts | ||
addPrefix(prefix: Namer | Array<string>, props?: NamerProps): Namer | ||
- *Type:* `boolean` | ||
- *Default:* false | ||
If the name exceeds maxLength, should I snip the head or the tail? | ||
--- | ||
##### `maxPartLength`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.maxPartLength"></a> | ||
```typescript | ||
public readonly maxPartLength: number; | ||
``` | ||
* **prefix** (<code>[Namer](#multi-convention-namer-namer) | Array<string></code>) the prefix to add. | ||
* **props** (<code>[NamerProps](#multi-convention-namer-namerprops)</code>) properties to over-ride the parent props. | ||
* **defaultFormat** (<code>[Format](#multi-convention-namer-format)</code>) When using toString(), which format should be provided? __*Default*__: raise an error if no default specified and toString invoked | ||
* **deleteCharacters** (<code>string</code>) Characters to strip from name parts. __*Default*__: '-_' | ||
* **illegalCharacters** (<code>string</code>) Characters which will cause an error if included in a name part tested AFTER deleteCharacters. __*Default*__: '! | ||
* **maxLength** (<code>number</code>) How long can the name be? __*Default*__: no limit | ||
* **maxLengthTruncateHead** (<code>boolean</code>) If the name exceeds maxLength, should I snip the head or the tail? __*Default*__: false | ||
* **maxPartLength** (<code>number</code>) How long can a part of the name be? __*Default*__: no limit | ||
* **maxPartLengthTruncateHead** (<code>boolean</code>) If the part exceeds maxPartLength, should I snip the head or the tail? __*Default*__: false | ||
* **uniqueSeed** (<code>any</code>) Include a uniquifying suffix? __*Default*__: do not include a uniquifier | ||
- *Type:* `number` | ||
- *Default:* no limit | ||
__Returns__: | ||
* <code>[Namer](#multi-convention-namer-namer)</code> | ||
How long can a part of the name be? | ||
#### addSuffix(suffix, props?) <a id="multi-convention-namer-namer-addsuffix"></a> | ||
--- | ||
Create a new Namer with the added suffix. | ||
##### `maxPartLengthTruncateHead`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.maxPartLengthTruncateHead"></a> | ||
```ts | ||
addSuffix(suffix: Namer | Array<string>, props?: NamerProps): Namer | ||
```typescript | ||
public readonly maxPartLengthTruncateHead: boolean; | ||
``` | ||
* **suffix** (<code>[Namer](#multi-convention-namer-namer) | Array<string></code>) the suffix to add. | ||
* **props** (<code>[NamerProps](#multi-convention-namer-namerprops)</code>) properties to over-ride the parent props. | ||
* **defaultFormat** (<code>[Format](#multi-convention-namer-format)</code>) When using toString(), which format should be provided? __*Default*__: raise an error if no default specified and toString invoked | ||
* **deleteCharacters** (<code>string</code>) Characters to strip from name parts. __*Default*__: '-_' | ||
* **illegalCharacters** (<code>string</code>) Characters which will cause an error if included in a name part tested AFTER deleteCharacters. __*Default*__: '! | ||
* **maxLength** (<code>number</code>) How long can the name be? __*Default*__: no limit | ||
* **maxLengthTruncateHead** (<code>boolean</code>) If the name exceeds maxLength, should I snip the head or the tail? __*Default*__: false | ||
* **maxPartLength** (<code>number</code>) How long can a part of the name be? __*Default*__: no limit | ||
* **maxPartLengthTruncateHead** (<code>boolean</code>) If the part exceeds maxPartLength, should I snip the head or the tail? __*Default*__: false | ||
* **uniqueSeed** (<code>any</code>) Include a uniquifying suffix? __*Default*__: do not include a uniquifier | ||
- *Type:* `boolean` | ||
- *Default:* false | ||
__Returns__: | ||
* <code>[Namer](#multi-convention-namer-namer)</code> | ||
If the part exceeds maxPartLength, should I snip the head or the tail? | ||
#### enforceMaxLength(raw) <a id="multi-convention-namer-namer-enforcemaxlength"></a> | ||
--- | ||
##### `uniqueSeed`<sup>Optional</sup> <a name="multi-convention-namer.NamerProps.property.uniqueSeed"></a> | ||
```typescript | ||
public readonly uniqueSeed: any; | ||
``` | ||
```ts | ||
enforceMaxLength(raw: string): string | ||
- *Type:* `any` | ||
- *Default:* do not include a uniquifier | ||
Include a uniquifying suffix? | ||
If so, this is the seed for that suffix. | ||
--- | ||
## Classes <a name="Classes"></a> | ||
### Namer <a name="multi-convention-namer.Namer"></a> | ||
#### Initializers <a name="multi-convention-namer.Namer.Initializer"></a> | ||
```typescript | ||
import { Namer } from 'multi-convention-namer' | ||
new Namer(parts: string[], props?: NamerProps) | ||
``` | ||
* **raw** (<code>string</code>) *No description* | ||
##### `parts`<sup>Required</sup> <a name="multi-convention-namer.Namer.parameter.parts"></a> | ||
__Returns__: | ||
* <code>string</code> | ||
- *Type:* `string`[] | ||
#### toString() <a id="multi-convention-namer-namer-tostring"></a> | ||
an array of strings to be composed into a name. | ||
--- | ||
##### `props`<sup>Optional</sup> <a name="multi-convention-namer.Namer.parameter.props"></a> | ||
```ts | ||
toString(): string | ||
- *Type:* [`multi-convention-namer.NamerProps`](#multi-convention-namer.NamerProps) | ||
modify the behavior of namer. | ||
--- | ||
#### Methods <a name="Methods"></a> | ||
##### `addPrefix` <a name="multi-convention-namer.Namer.addPrefix"></a> | ||
```typescript | ||
public addPrefix(prefix: Namer | string[], props?: NamerProps) | ||
``` | ||
###### `prefix`<sup>Required</sup> <a name="multi-convention-namer.Namer.parameter.prefix"></a> | ||
__Returns__: | ||
* <code>string</code> | ||
- *Type:* [`multi-convention-namer.Namer`](#multi-convention-namer.Namer) | `string`[] | ||
#### unique(uniqueItem) <a id="multi-convention-namer-namer-unique"></a> | ||
the prefix to add. | ||
Create a new Namer with a unique suffix. | ||
--- | ||
```ts | ||
unique(uniqueItem: any): Namer | ||
###### `props`<sup>Optional</sup> <a name="multi-convention-namer.Namer.parameter.props"></a> | ||
- *Type:* [`multi-convention-namer.NamerProps`](#multi-convention-namer.NamerProps) | ||
properties to over-ride the parent props. | ||
--- | ||
##### `addSuffix` <a name="multi-convention-namer.Namer.addSuffix"></a> | ||
```typescript | ||
public addSuffix(suffix: Namer | string[], props?: NamerProps) | ||
``` | ||
* **uniqueItem** (<code>any</code>) : any value to use as the seed for generating a unique hash. | ||
###### `suffix`<sup>Required</sup> <a name="multi-convention-namer.Namer.parameter.suffix"></a> | ||
__Returns__: | ||
* <code>[Namer](#multi-convention-namer-namer)</code> | ||
- *Type:* [`multi-convention-namer.Namer`](#multi-convention-namer.Namer) | `string`[] | ||
the suffix to add. | ||
--- | ||
## struct NamerProps <a id="multi-convention-namer-namerprops"></a> | ||
###### `props`<sup>Optional</sup> <a name="multi-convention-namer.Namer.parameter.props"></a> | ||
- *Type:* [`multi-convention-namer.NamerProps`](#multi-convention-namer.NamerProps) | ||
properties to over-ride the parent props. | ||
--- | ||
##### `enforceMaxLength` <a name="multi-convention-namer.Namer.enforceMaxLength"></a> | ||
```typescript | ||
public enforceMaxLength(raw: string) | ||
``` | ||
Name | Type | Description | ||
-----|------|------------- | ||
**defaultFormat**? | <code>[Format](#multi-convention-namer-format)</code> | When using toString(), which format should be provided?<br/>__*Default*__: raise an error if no default specified and toString invoked | ||
**deleteCharacters**? | <code>string</code> | Characters to strip from name parts.<br/>__*Default*__: '-_' | ||
**illegalCharacters**? | <code>string</code> | Characters which will cause an error if included in a name part tested AFTER deleteCharacters.<br/>__*Default*__: '! | ||
**maxLength**? | <code>number</code> | How long can the name be?<br/>__*Default*__: no limit | ||
**maxLengthTruncateHead**? | <code>boolean</code> | If the name exceeds maxLength, should I snip the head or the tail?<br/>__*Default*__: false | ||
**maxPartLength**? | <code>number</code> | How long can a part of the name be?<br/>__*Default*__: no limit | ||
**maxPartLengthTruncateHead**? | <code>boolean</code> | If the part exceeds maxPartLength, should I snip the head or the tail?<br/>__*Default*__: false | ||
**uniqueSeed**? | <code>any</code> | Include a uniquifying suffix?<br/>__*Default*__: do not include a uniquifier | ||
###### `raw`<sup>Required</sup> <a name="multi-convention-namer.Namer.parameter.raw"></a> | ||
- *Type:* `string` | ||
--- | ||
## enum Format <a id="multi-convention-namer-format"></a> | ||
##### `toString` <a name="multi-convention-namer.Namer.toString"></a> | ||
```typescript | ||
public toString() | ||
``` | ||
##### `unique` <a name="multi-convention-namer.Namer.unique"></a> | ||
```typescript | ||
public unique(uniqueItem: any) | ||
``` | ||
###### `uniqueItem`<sup>Required</sup> <a name="multi-convention-namer.Namer.parameter.uniqueItem"></a> | ||
- *Type:* `any` | ||
: any value to use as the seed for generating a unique hash. | ||
--- | ||
#### Properties <a name="Properties"></a> | ||
##### `camel`<sup>Required</sup> <a name="multi-convention-namer.Namer.property.camel"></a> | ||
```typescript | ||
public readonly camel: string; | ||
``` | ||
- *Type:* `string` | ||
camelCase. | ||
--- | ||
##### `kebab`<sup>Required</sup> <a name="multi-convention-namer.Namer.property.kebab"></a> | ||
```typescript | ||
public readonly kebab: string; | ||
``` | ||
- *Type:* `string` | ||
kebab-case. | ||
--- | ||
##### `parts`<sup>Required</sup> <a name="multi-convention-namer.Namer.property.parts"></a> | ||
```typescript | ||
public readonly parts: string[]; | ||
``` | ||
- *Type:* `string`[] | ||
--- | ||
##### `partsWithUnique`<sup>Required</sup> <a name="multi-convention-namer.Namer.property.partsWithUnique"></a> | ||
```typescript | ||
public readonly partsWithUnique: string[]; | ||
``` | ||
- *Type:* `string`[] | ||
--- | ||
##### `pascal`<sup>Required</sup> <a name="multi-convention-namer.Namer.property.pascal"></a> | ||
```typescript | ||
public readonly pascal: string; | ||
``` | ||
- *Type:* `string` | ||
PascalCase. | ||
--- | ||
##### `snake`<sup>Required</sup> <a name="multi-convention-namer.Namer.property.snake"></a> | ||
```typescript | ||
public readonly snake: string; | ||
``` | ||
- *Type:* `string` | ||
snake_case. | ||
--- | ||
##### `props`<sup>Optional</sup> <a name="multi-convention-namer.Namer.property.props"></a> | ||
```typescript | ||
public readonly props: NamerProps; | ||
``` | ||
- *Type:* [`multi-convention-namer.NamerProps`](#multi-convention-namer.NamerProps) | ||
--- | ||
## Enums <a name="Enums"></a> | ||
### Format <a name="Format"></a> | ||
Too many naming conventions? | ||
Name | Description | ||
-----|----- | ||
**KEBAB** | | ||
**PASCAL** | | ||
**SNAKE** | | ||
**CAMEL** | | ||
#### `KEBAB` <a name="multi-convention-namer.Format.KEBAB"></a> | ||
--- | ||
#### `PASCAL` <a name="multi-convention-namer.Format.PASCAL"></a> | ||
--- | ||
#### `SNAKE` <a name="multi-convention-namer.Format.SNAKE"></a> | ||
--- | ||
#### `CAMEL` <a name="multi-convention-namer.Format.CAMEL"></a> | ||
--- | ||
@@ -241,3 +241,3 @@ "use strict"; | ||
_a = JSII_RTTI_SYMBOL_1; | ||
Namer[_a] = { fqn: "multi-convention-namer.Namer", version: "0.1.10" }; | ||
Namer[_a] = { fqn: "multi-convention-namer.Namer", version: "0.1.11" }; | ||
// https://stackoverflow.com/a/3561711 | ||
@@ -244,0 +244,0 @@ function escapeRegex(s) { |
@@ -6,8 +6,6 @@ { | ||
"type": "git", | ||
"url": "github:myhelix/multi-convention-namer" | ||
"url": "https://github.com/myhelix/multi-convention-namer" | ||
}, | ||
"scripts": { | ||
"clobber": "npx projen clobber", | ||
"bump": "npx projen bump", | ||
"unbump": "npx projen unbump", | ||
"compile": "npx projen compile", | ||
@@ -19,3 +17,6 @@ "test:compile": "npx projen test:compile", | ||
"test:update": "npx projen test:update", | ||
"upgrade-dependencies": "npx projen upgrade-dependencies", | ||
"bump": "npx projen bump", | ||
"unbump": "npx projen unbump", | ||
"publish:github": "npx projen publish:github", | ||
"upgrade": "npx projen upgrade", | ||
"upgrade-projen": "npx projen upgrade-projen", | ||
@@ -27,5 +28,7 @@ "default": "npx projen default", | ||
"compat": "npx projen compat", | ||
"publish:npm": "npx projen publish:npm", | ||
"publish:pypi": "npx projen publish:pypi", | ||
"docgen": "npx projen docgen", | ||
"projen": "npx projen", | ||
"start": "npx projen start" | ||
"release": "npx projen release", | ||
"projen": "npx projen" | ||
}, | ||
@@ -38,27 +41,27 @@ "author": { | ||
"devDependencies": { | ||
"@types/jest": "^26.0.23", | ||
"@types/node": "^10.17.0", | ||
"@typescript-eslint/eslint-plugin": "^4.28.0", | ||
"@typescript-eslint/parser": "^4.28.0", | ||
"esbuild": "^0.12.9", | ||
"eslint": "^7.29.0", | ||
"@types/jest": "^27.0.2", | ||
"@types/node": "^14.17.0", | ||
"@typescript-eslint/eslint-plugin": "^4.32.0", | ||
"@typescript-eslint/parser": "^4.32.0", | ||
"esbuild": "^0.13.3", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-import-resolver-node": "^0.3.4", | ||
"eslint-import-resolver-typescript": "^2.4.0", | ||
"eslint-plugin-import": "^2.23.4", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"jest": "^27.0.5", | ||
"eslint-import-resolver-node": "^0.3.6", | ||
"eslint-import-resolver-typescript": "^2.5.0", | ||
"eslint-plugin-import": "^2.24.2", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^27.2.3", | ||
"jest-junit": "^12", | ||
"jsii": "^1.30.0", | ||
"jsii-diff": "^1.30.0", | ||
"jsii-docgen": "^1.8.104", | ||
"jsii-pacmak": "^1.30.0", | ||
"jsii-release": "^0.2.55", | ||
"jsii": "^1.34.0", | ||
"jsii-diff": "^1.34.0", | ||
"jsii-docgen": "^3.6.3", | ||
"jsii-pacmak": "^1.34.0", | ||
"jsii-release": "^0.2.132", | ||
"json-schema": "^0.3.0", | ||
"npm-check-updates": "^11", | ||
"prettier": "^2.3.1", | ||
"projen": "^0.18.16", | ||
"prettier": "^2.4.1", | ||
"projen": "^0.28.32", | ||
"standard-version": "^9", | ||
"ts-jest": "^27.0.3", | ||
"typescript": "^4.3.4" | ||
"ts-jest": "^27.0.5", | ||
"typescript": "^4.4.3" | ||
}, | ||
@@ -68,3 +71,3 @@ "bundledDependencies": [], | ||
"license": "Apache-2.0", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"jest": { | ||
@@ -113,3 +116,8 @@ "testMatch": [ | ||
"outdir": "dist", | ||
"targets": {}, | ||
"targets": { | ||
"python": { | ||
"distName": "multi-convention-namer", | ||
"module": "multi_convention_namer" | ||
} | ||
}, | ||
"tsc": { | ||
@@ -116,0 +124,0 @@ "outDir": "lib", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
71607
12
441