1.2.1 • Published 2 years ago

name-formatter-js v1.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Name Formatter JS

This library help you to convert formate names of data.

Installation

  npm install name-formatter-js

Usage

Import Function

  import nameFormatter from "name-formatter-js";

Call Function

  nameFormatter({
    data: myData,
    convert: {
        from: "snake_case" ,
        to: "camelCase"
    }
});

Parameters

ParameterTypeValues
dataAll TypeEnter your data
convert.fromStringcamelCase or snake_case
convert.toStringcamelCase or snake_case

Examples

import nameFormatter from 'name-formatter-js';

// test data
const myData = {
    file_type: "image" ,
    list: [
        {
            file_link: "https://example.com"
        }
    ]
};

// call function
nameFormatter({
    data: myData,
    convert: {
        from: "snake_case" ,
        to: "camelCase"
    }
});

// function return:
// {
//    fileType: "image" ,
//    list: [
//        {
//            fileLink: "https://example.com"
//        }
//    ]
// }
1.2.1

2 years ago

1.2.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago