Comparing version 0.1.1 to 0.1.2
30
index.js
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -10,14 +10,14 @@ /** | ||
const json = (type, msg, obj) => { | ||
var json = { | ||
success: true, | ||
msg: '', | ||
type: '', | ||
obj: null | ||
}; | ||
var json = { | ||
success: true, | ||
msg: "", | ||
type: "", | ||
obj: null, | ||
}; | ||
if (type) json.type = type; | ||
if (msg) json.msg = msg; | ||
if (obj) json.obj = obj; | ||
if (type) json.type = type; | ||
if (msg) json.msg = msg; | ||
if (obj) json.obj = obj; | ||
return json; | ||
return json; | ||
}; | ||
@@ -31,3 +31,3 @@ | ||
const success = (msg, obj) => { | ||
return json('success', msg, obj); | ||
return json("success", msg, obj); | ||
}; | ||
@@ -41,3 +41,3 @@ | ||
const info = (msg, obj) => { | ||
return json('info', msg, obj); | ||
return json("info", msg, obj); | ||
}; | ||
@@ -51,3 +51,3 @@ | ||
const warning = (msg, obj) => { | ||
return json('warning', msg, obj); | ||
return json("warning", msg, obj); | ||
}; | ||
@@ -61,3 +61,3 @@ | ||
const danger = (msg, obj) => { | ||
return json('danger', msg, obj); | ||
return json("danger", msg, obj); | ||
}; | ||
@@ -64,0 +64,0 @@ |
{ | ||
"name": "qiao-json", | ||
"version": "0.1.1", | ||
"description": "nodejs json data", | ||
"author": "uikoo9 <uikoo9@qq.com>", | ||
"homepage": "https://code.insistime.com/qiao-json", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"module": "src/index.js", | ||
"sideEffets": false, | ||
"files": [ | ||
"src" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/uikoo9/qiao-monorepo.git" | ||
}, | ||
"scripts": { | ||
"build": "rollup --config _config.rollup.js", | ||
"eslint": "eslint . --ext .js -c _config.eslint.js", | ||
"eslintfix": "eslint . --ext .js --fix -c _config.eslint.js", | ||
"prepublish": "npm run build && npm run eslintfix" | ||
}, | ||
"gitHead": "a90554b9aa8312bd0f5dac1b1c2eb297ea126ae5" | ||
"name": "qiao-json", | ||
"version": "0.1.2", | ||
"description": "nodejs json data", | ||
"author": "uikoo9 <uikoo9@qq.com>", | ||
"homepage": "https://code.insistime.com/qiao-json", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"module": "src/index.js", | ||
"sideEffets": false, | ||
"files": [ | ||
"src" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/uikoo9/qiao-monorepo.git" | ||
}, | ||
"scripts": { | ||
"build": "rollup --config _config.rollup.js" | ||
}, | ||
"gitHead": "10e87c4bb8a4dd7bde6ea4aac9ee50aa2ecb9fc2" | ||
} |
# qiao-json | ||
## api | ||
### json | ||
```javascript | ||
'use strict'; | ||
"use strict"; | ||
var q = require('qiao-json'); | ||
var q = require("qiao-json"); | ||
var json = q.json('success', 'test', {}); | ||
var json = q.json("success", "test", {}); | ||
console.log(json); | ||
@@ -15,8 +17,9 @@ ``` | ||
### success | ||
```javascript | ||
'use strict'; | ||
"use strict"; | ||
var q = require('qiao-json'); | ||
var q = require("qiao-json"); | ||
var success = q.success('test', {}); | ||
var success = q.success("test", {}); | ||
console.log(success); | ||
@@ -26,8 +29,9 @@ ``` | ||
### info | ||
```javascript | ||
'use strict'; | ||
"use strict"; | ||
var q = require('qiao-json'); | ||
var q = require("qiao-json"); | ||
var info = q.info('test', {}); | ||
var info = q.info("test", {}); | ||
console.log(info); | ||
@@ -37,8 +41,9 @@ ``` | ||
### warning | ||
```javascript | ||
'use strict'; | ||
"use strict"; | ||
var q = require('qiao-json'); | ||
var q = require("qiao-json"); | ||
var warning = q.warning('test', {}); | ||
var warning = q.warning("test", {}); | ||
console.log(warning); | ||
@@ -48,8 +53,9 @@ ``` | ||
### danger | ||
```javascript | ||
'use strict'; | ||
"use strict"; | ||
var q = require('qiao-json'); | ||
var q = require("qiao-json"); | ||
var danger = q.danger('test', {}); | ||
var danger = q.danger("test", {}); | ||
console.log(danger); | ||
@@ -59,18 +65,25 @@ ``` | ||
## version | ||
### 0.0.6.20220417 | ||
1. add lerna | ||
### 0.0.5.20220407 | ||
1. md | ||
### 0.0.4.20191204 | ||
1. add funding | ||
### 0.0.3.20181127 | ||
1. add .js | ||
### 0.0.2.20181122 | ||
1. npm audit | ||
### 0.0.1.20181113 | ||
1. init |
@@ -8,14 +8,14 @@ /** | ||
export const json = (type, msg, obj) => { | ||
var json = { | ||
success: true, | ||
msg: '', | ||
type: '', | ||
obj: null | ||
}; | ||
var json = { | ||
success: true, | ||
msg: "", | ||
type: "", | ||
obj: null, | ||
}; | ||
if (type) json.type = type; | ||
if (msg) json.msg = msg; | ||
if (obj) json.obj = obj; | ||
if (type) json.type = type; | ||
if (msg) json.msg = msg; | ||
if (obj) json.obj = obj; | ||
return json; | ||
return json; | ||
}; | ||
@@ -29,3 +29,3 @@ | ||
export const success = (msg, obj) => { | ||
return json('success', msg, obj); | ||
return json("success", msg, obj); | ||
}; | ||
@@ -39,3 +39,3 @@ | ||
export const info = (msg, obj) => { | ||
return json('info', msg, obj); | ||
return json("info", msg, obj); | ||
}; | ||
@@ -49,3 +49,3 @@ | ||
export const warning = (msg, obj) => { | ||
return json('warning', msg, obj); | ||
return json("warning", msg, obj); | ||
}; | ||
@@ -59,3 +59,3 @@ | ||
export const danger = (msg, obj) => { | ||
return json('danger', msg, obj); | ||
}; | ||
return json("danger", msg, obj); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106
85
4002