https://github.com/teclone/utils
collection of utility methods useful for day to day project and library development
https://github.com/teclone/utils
utility-function utility-library utils
Last synced: 11 months ago
JSON representation
collection of utility methods useful for day to day project and library development
- Host: GitHub
- URL: https://github.com/teclone/utils
- Owner: teclone
- Created: 2019-03-09T22:11:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-14T07:14:56.000Z (over 4 years ago)
- Last Synced: 2025-02-13T18:12:22.808Z (12 months ago)
- Topics: utility-function, utility-library, utils
- Language: TypeScript
- Homepage:
- Size: 570 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Utils
[](https://travis-ci.org/teclone/utils)
[](https://coveralls.io/github/teclone/utils?branch=master)
[](https://github.com/semantic-release/semantic-release)
[](https://badge.fury.io/js/%40teclone%2Futils)

Utils is a collection of utility methods for day to day web application and library development. It is developed for reusability purposes as it is utilized by most of all libraries published by same author.
If you bumped into this project and find it useful for your project, please don't hesitate to give us a star. Because it is a typescript project, you get excellent auto-completion and type checks.
## Installation
```bash
npm install @teclone/utils
```
## Usage Sample
```typescript
import { scopeCallback, camelCase, copy, range, expandProperty } from '@teclone/utils';
console.log(camelCase('my-string')); //logs myString
console.log(camelCase('my:string', ':')); //logs myString
//copy objects without creating references
const myObject = {
headers: {
contentType: 'text/html',
},
colors: ['#fff', 'green', '#808080'],
};
const myObjectCopy = copy({}, myObject);
//changing headers does not change the copy
myObject.headers.contentType = 'text/css';
console.log(myObjectCopy.headers.contentType); //logs text/html
// expand property into a target object
const result = expandProperty({}, 'headers.contentType', 'text/css');
console.log(result.headers.contentType); // logs text/css
```