This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

auto-camel-case-with-rules
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

auto-camel-case-with-rules

This utils allows to change object props to camelcase with optional custom property names. The returned object has correct type.

Example

import autoCamelCaseWithRules from 'auto-camel-case-with-rules';

const mapUser = autoCamelCaseWithRules({
  id: 'userId',
} as const);

const result = mapUser({
  id: 1,
  ['do you.like__candy']: true,
  created_at: new Date()
});

// result === { userId: 1, doYouLikeCandy: true, createdAt: '2021-05-15T21:57:00.524Z' };

type TResult = typeof result;

// TResult === { userId: number, doYouLikeCandy: boolean, createdAt: Date }

Package Sidebar

Install

npm i auto-camel-case-with-rules

Weekly Downloads

1

Version

1.0.8

License

ISC

Unpacked Size

4.16 kB

Total Files

6

Last publish

Collaborators

  • jmmzon