Common script utils for developer.
npm install bmz-js-utils
or
npm i bmz-js-utils
import {BmzJsUtils} from 'bmz-js-utils';
Test: console.log(BmzJsUtils.getDeviceName());
// Result: mobile | tablet | desktop
You will would define aliases.
import {BmzJsUtils as common} from 'bmz-js-utils';
Test: console.log(common.getDeviceName());
// Result: mobile | tablet | desktop
let utils = require('bmz-js-utils').BmzJsUtils;
Test: console.log(utils.getDeviceName());
// Result: mobile | tablet | desktop
console.log('getDeviceName ==> ', utils.getDeviceName());
console.log('isDeviceIPad ==> ', utils.isDeviceIPad());
console.log('isDeviceTablet ==> ', utils.isDeviceTablet());
console.log('isDeviceMobile ==> ', utils.isDeviceMobile());
console.log('isDeviceDesktop ==> ', utils.isDeviceDesktop());
console.log('trim ==> ', utils.trim(' bamossza'));
console.log('strPadRight ==> ', utils.strPadRight('moss', 10, '9'));
console.log('strPadLeft ==> ', utils.strPadLeft('moss', 10, '9'));
console.log('PI ==> ', utils.PI());
console.log('abs ==> ', utils.abs(-1245));
console.log('uuidv4 ==> ', utils.uuidv4());
console.log('mergeArray ==> ', utils.mergeArray([{a: '1234'}, {b: '4321'}], [{b: '567'}, {b: '765'}]));
console.log('sumValueArray ==> ', utils.sumValueArray([1, 2, 3]));
Result:
- Panusitt Khuenkham - Senior Developer
See also the list of contributors who participated in this project.
##Profiles
MIT License