1.0.8 • Published 2 months ago

handlescript v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago
// combind array
import {
    reverseString,
    formatMoney, 
    combinedArray, 
    compareObject, 
    haftWidthToFull,
    fullWidthToHaft
} from 'handleScript'
const arrays = [
    {
        id: 1,
        name: 'test 1'
    },
     {
        id: 1,
        name: 'test 2'
    },
     {
        id: 1,
        name: 'test 3'
    },
     {
        id: 2,
        name: 'test 4'
    },
    {
        id: 2,
        name: 'test 5'
    }
]
const results = combinedArray(arrays , 'id');
console.log(results)
// Format money
const results = formatMoney(2000000) // => 2,000,000
// reverse String
const ex1 = reverseString('HELLO') // => OLLEH
const ex2 = reverseString('HELLO', "-") // => O-L-L-E-H
const ex3 = reverseString('2024-01-12', "-") // => 12-01-2024
// Compare object
// object origin: original array
// object: Array to compare  
const objectOrigin = {
    id: 1,
    name: 'duy',
    age: 25,
    year: 2024,
};
const object = {
    id: 2,
    name: 'duy 2',
    age: 24,
    year: 2024
};
console.log(compareObject(objectOrigin, object)); // return The value is different between the object to be compared and the object to be compared (trả về giá trị khác nhau giữa đối tượng cần so sánh và đối tượng so sánh: objectOrigin)
// convert string haftwidth - fullwidth
console.log(haftWidthToFull('testing')); // to full width
console.log(fullWidthToHaft('testing')); // to haft width
1.0.8

2 months ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.9

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

0.0.1

5 months ago

0.0.2

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago