Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
module.exports = require('./lib/Utils2js.js') | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports._Url=exports._String=exports._Number=exports._Brower=exports._Main=void 0;var _brower=require("./lib/brower"),_Brower=_interopRequireWildcard(_brower),_index=require("./lib/index"),_Main=_interopRequireWildcard(_index),_number=require("./lib/number"),_Number=_interopRequireWildcard(_number),_string=require("./lib/string"),_String=_interopRequireWildcard(_string),_url=require("./lib/url"),_Url=_interopRequireWildcard(_url);function _interopRequireWildcard(r){if(r&&r.__esModule)return r;var e={};if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e.default=r,e}exports._Main=_Main,exports._Brower=_Brower,exports._Number=_Number,exports._String=_String,exports._Url=_Url; |
{ | ||
"name": "utils2js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Common tool method encapsulation", | ||
@@ -10,3 +10,8 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"dev": "webpack-dev-server --config webpack.config.js", | ||
"prod": "gulp && npm run publish", | ||
"publish": "npm publish ./publish", | ||
"doc": "./node_modules/.bin/esdoc", | ||
"tsc6": "tsc", | ||
"pack": "npm run tsc6 && npm run doc" | ||
}, | ||
@@ -26,3 +31,25 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/Megan-TA/Utils2js#readme" | ||
"homepage": "https://github.com/Megan-TA/Utils2js#readme", | ||
"devDependencies": { | ||
"awesome-typescript-loader": "3.5.0", | ||
"babel-core": "^6.26.3", | ||
"babel-preset-es2015": "^6.24.1", | ||
"esdoc": "^1.1.0", | ||
"esdoc-standard-plugin": "^1.0.0", | ||
"esdoc-typescript-plugin": "^1.0.1", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^7.0.1", | ||
"gulp-load-plugins": "^1.5.0", | ||
"gulp-plumber": "^1.2.0", | ||
"gulp-uglify": "^3.0.0", | ||
"html-webpack-plugin": "^3.2.0", | ||
"mockjs": "^1.0.1-beta3", | ||
"pump": "^3.0.0", | ||
"source-map-loader": "^0.2.3", | ||
"tslint": "^5.10.0", | ||
"typescript": "^2.9.2", | ||
"webpack": "3.5.5", | ||
"webpack-dev-server": "2.7.1", | ||
"webpack-merge": "^4.1.2" | ||
} | ||
} |
101
README.md
@@ -1,100 +0,5 @@ | ||
# utils2js | ||
--- | ||
# Utils2js | ||
```shell | ||
npm install utils2js --save-dev | ||
``` | ||
一个基于`TypeScript`和`esdoc`编写的工具方法 | ||
### API | ||
> 1. prop | ||
获取指定对象下指定字段的值,支持递归 | ||
举例: | ||
* prop({a: {b: 1}}, 'a.b') // 1 | ||
* prop({a: {b: 1}}, 'a') // {b: 1} | ||
* prop({a: {b: 1}}, 'm') // null | ||
--- | ||
> 2. interpolation | ||
自定义插值 | ||
适用于取到接口返回的JSON根据需要转换成指定格式的字符串 | ||
举例: | ||
``` | ||
utils2js.interpolation('{0}{3}{1}{1}{2}', 'A', 'B', 'C', 'D') // ADBBC | ||
utils2js.interpolation('{name} - {userID}', {name: 'test',userID: 1, age: 12}) // test - 1 | ||
``` | ||
--- | ||
> 3. getRandomAssignNum | ||
随机生成指定位数的16进制数 | ||
举例: | ||
``` | ||
utils2js.getRandomAssignNum(6) // 6位数的随机十六进制数 | ||
``` | ||
--- | ||
> 4. Logger | ||
更简单多色彩的现代浏览器控制台输出显示 | ||
举例: | ||
``` | ||
var test = utils2js.Logger('box1') | ||
test.info('666') // [box1] 666 | ||
``` | ||
--- | ||
> 5. extend | ||
重名默认覆盖 | ||
举例: | ||
``` | ||
utils2js.extend({name: '张三'}, {age: 12}) | ||
``` | ||
--- | ||
> 6. deepCopy | ||
空值或者undefined默认拷贝为空对象{} | ||
举例: | ||
``` | ||
utils2js.deepCopy({name: 'zhansgan', obj: {}, arr: [2, 3]}) | ||
``` | ||
--- | ||
> 7. float | ||
举例: | ||
``` | ||
utils2js.float.add(0.22, 0.1) | ||
utils2js.float.sub(0.22, 0.1) | ||
utils2js.float.ride(0.22, 0.1) | ||
utils2js.float.divide(0.22, 0.1) | ||
``` | ||
> 8. 识别浏览器类型 | ||
举例: | ||
``` | ||
utils2js.brower.browerVal() | ||
utils2js.brower.isIE() | ||
``` | ||
相应的工具方法已生成文档 |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
15
10549
20
0
4
6
2