9.7.0 • Published 9 months ago

@rline/names v9.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@rline/names

Utilities to create names, restfull api paths, and authentication service paths.

Installation

pnpm add @rline/names

Usage

Rest api paths

let R = restPaths('category');

R.plural; // output:  'categories',
R.singular; // output:  'category',
R.id; // output:  'category/:id',
R.increment; // output:  'category/:id/increment',
R.decrement; // output:  'category/:id/decrement',
R.count; // output:  'categories/count',
R.relation; // output:  'category/:id/:relationName',
R.relationId; // output:  'category/:id/:relationName/:relationId',
R.file; // output:  'category/:id/file',
R.img; // output:  'category/:id/img',

Pluralize

pluralize('person'); // output : 'people'
pluralize('cat'); // output : 'cats'
pluralize('category'); // output : 'categories'
pluralize('bus'); // output : 'buses'
pluralize('box'); // output : 'boxes'
pluralize('buzz'); // output : 'buzzes'
pluralize('brush'); // output : 'brushes'
pluralize('church'); // output : 'churches'
// ...

Names

import { names } from '@rline/names';

let N = names('ab c');
N.camelCase; // output:  'abC'
N.constCase; // output:  'AB_C'
N.dotCase; // output:  'ab.c'
N.kebabCase; // output:  'ab-c'
N.pascalCase; // output:  'AbC'
N.titleCase; // output:  'Ab C'
N.sentenceCase; // output:  'Ab c'

N.moduleName; // output:  'AbCModule'
N.serviceName; // output:  'AbCService'
N.controllerName; // output:  'AbCController'
N.optionsName; // output:  'AbCOptions'
N.modelName; // output:  'AbCModel'
N.createDtoName; // output:  'CreateAbCDto'
N.updateDtoName; // output:  'UpdateAbCDto'
N.queryDtoName; // output:  'QueryAbCDto'

N = names('ab c', { prefix: 'SO' });
N.camelCase; // output:  'SOabC'
N.constCase; // output:  'SOAB_C'
N.dotCase; // output:  'SOab.c'
N.kebabCase; // output:  'SOab-c'
N.pascalCase; // output:  'SOAbC'
N.titleCase; // output:  'SOAb C'
N.sentenceCase; // output:  'SOAb c'
N.moduleName; // output:  'SOAbCModule'
N.serviceName; // output:  'SOAbCService'
N.controllerName; // output:  'SOAbCController'
N.optionsName; // output:  'SOAbCOptions'
N.modelName; // output:  'SOAbCModel'
N.createDtoName; // output:  'SOCreateAbCDto'
N.updateDtoName; // output:  'SOUpdateAbCDto'
N.queryDtoName; // output:  'SOQueryAbCDto'

N = names('ab c', { suffix: 'SO' });
N.camelCase; // output:  'abCSO'
N.constCase; // output:  'AB_CSO'
N.dotCase; // output:  'ab.cSO'
N.kebabCase; // output:  'ab-cSO'
N.pascalCase; // output:  'AbCSO'
N.titleCase; // output:  'Ab CSO'
N.sentenceCase; // output:  'Ab cSO'
N.moduleName; // output:  'AbCModuleSO'
N.serviceName; // output:  'AbCServiceSO'
N.controllerName; // output:  'AbCControllerSO'
N.optionsName; // output:  'AbCOptionsSO'
N.modelName; // output:  'AbCModelSO'
N.createDtoName; // output:  'CreateAbCDtoSO'
N.updateDtoName; // output:  'UpdateAbCDtoSO'
N.queryDtoName; // output:  'QueryAbCDtoSO'

N = names('ab c', { wrapper: '|' });
N.camelCase; // output:  '|abC|'
N.constCase; // output:  '|AB_C|'
N.dotCase; // output:  '|ab.c|'
N.kebabCase; // output:  '|ab-c|'
N.pascalCase; // output:  '|AbC|'
N.titleCase; // output:  '|Ab C|'
N.sentenceCase; // output:  '|Ab c|'
N.moduleName; // output:  '|AbCModule|'
N.serviceName; // output:  '|AbCService|'
N.controllerName; // output:  '|AbCController|'
N.optionsName; // output:  '|AbCOptions|'
N.modelName; // output:  '|AbCModel|'
N.createDtoName; // output:  '|CreateAbCDto|'
N.updateDtoName; // output:  '|UpdateAbCDto|'
N.queryDtoName; // output:  '|QueryAbCDto|'

Documentation

Detailed documentation Documentation

Funding

Thank you for using @puq/core It's an open-source project, and maintaining it takes time and effort. If you find this library useful, please consider supporting its ongoing development. Your contributions help ensure that the project stays up-to-date, secure, and well-maintained.

Instant Funding

Your funding will go toward

  • Bug fixes and updates to ensure compatibility with the latest versions of dependencies.
  • New features that will make the library even more powerful.
  • Documentation improvements to help users get the most out of Your Library Name.
  • General maintenance to keep the library running smoothly and securely.

Contact to the developer: robert.brightline@gmail.com

Support the developer

9.7.0

9 months ago

9.6.0

9 months ago

9.5.0

9 months ago

9.4.0

9 months ago

9.3.0

9 months ago

9.2.3

9 months ago

9.2.2

9 months ago

9.2.1

9 months ago

9.2.0

9 months ago

9.1.0

9 months ago

9.0.1

9 months ago

9.0.0

9 months ago

8.5.0

9 months ago

8.4.0

9 months ago

8.3.0

9 months ago

8.2.0

9 months ago

8.1.1

9 months ago

8.1.0

9 months ago

8.0.1

9 months ago

7.1.0

9 months ago

7.0.0

10 months ago

6.0.0

10 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago