1.0.10 • Published 5 years ago

@58fe/utils v1.0.10

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Utils

JS哆啦A梦工具包

Install

npm install @58fe/utils  --save

Usage

cookie

import { cookie } from '@58fe/utils';

cookie.getCookie(name);
cookie.setCookie(name, value, outdays, path, domain);

getOS

import { getOs } from '@58fe/utils';

console.log(getOs()); // android/wp/ios

urlQuery

import { urlQuery } from '@58fe/utils';

// for example url: https://www.baidu.com/?a=1&b=2
console.log(urlQuery.query('a'));
// 1
console.log(urlQuery.queryAll());
// {a: 1, b: 2}

calcaulate

import { calcaulate } from '@58fe/utils';
calcaulate(); // must do
const num = 7;
console.log(num.add(1));
// 8
console.log(num.sub(2));
// 5
console.log(num.mul(2));
// 14
console.log(num.div(2));
// 3.5
console.log(num.toFixedNew(2));
// 7
console.log(7.3456.toFixedNew(2));
// 7.35

其他

1.0.9

5 years ago

1.0.10

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago