basic tools
npm install @om-design/utila base util library
some basic usage for some modules
##### typings
``typescript
import {Action, Action2, Func, Func2, Predicate, Tuple, Tuple2} from '@om-design/util'
const action: Action
const action2: Action2
const func: Func
const func2: Func
const predicate: Predicate
const tuple: Tuple
const tuple2: Tuple2
`
##### string operation
`typescript
import { pad, padRight, kebablize, pascalize, camelize } from '@om-design/util'
console.log(pad('12', 4)) // 0012
console.log(pad('12', 4, 'nn')) // nn12
console.log(padRight('12', 4)) // 1200
console.log(padRight('12', 4, 'nn')) // 12nn
console.log(kebablize('HelloWorld')) // hello-world
console.log(pascalize('hello-world')) // HelloWorld
console.log(camelize('HelloWorld')) // helloWorld
console.log(camelize('hello-world')) // helloWorld
`
##### math operation
`typescript
import { clamp, toFixedEx } from '@om-design/util'
console.log(clamp(-1, 0, 100)) // 0
console.log(clamp(101, 0, 100)) // 100
console.log(clamp(2, 0, 100)) // 2
console.log(toFixedEx(99.9999,2), 99.9999.toFixed(2)) // 99.99 100.00
`
##### hash algorithm
`typescript
import { murmurHash3, Murmur3 } from '@om-design/util';
(async()=>{
const str = 'hello world';
const hash1 = murmurHash3(str); // use javascript float number
const hash2 = await Murmur3.hash32Async(str); // use strickly int32 number
console.log(hash1, hash2, hash1 === hash2);
})();
`
##### style relevant
`typescript
import { createRoot } from '@om-design/util';
const [bem] = createRoot('o');
console.log(bem('btn')) // o-btn
console.log(bem('btn',{active: true, hide: false})) // o-btn o-btn--active
console.log(bem('btn', ['long'])) // o-btn o-btn--long
cossole.log(bem('btn', ['long',{active: true}])) // o-btn o-btn--long o-btn--active
`
##### functions
`typescript
import { debounce, throttle } from '@om-design/util';
const dfunc = debounce(()=>console.log(1), 200) // ship from lodash
const tfunc = throttle(() => console.log(2), 300) // ship from lodash
``