ajax-manager
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "ajax-manager", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "An jQuery ajax management tool", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,4 +76,14 @@ // use global count instead of jquery global event because it does't support cross domain request | ||
let apiRegister = function (models = {}, registerConfig = {}, jquery) { | ||
let apiRegister = function (modelsArray = [], registerConfig = {}, jquery) { | ||
let $ = jquery | ||
// merge all models | ||
let models = {} | ||
modelsArray.forEach((m, i) => { | ||
for (let key in m) { | ||
let model = m[key] | ||
// test if there are api useing same name | ||
if (key in models) throw new Error(`model: api should not have same name "${key}".`) | ||
models[key] = model | ||
} | ||
}) | ||
// globle config | ||
@@ -80,0 +90,0 @@ $.ajaxSetup(Object.assign({}, models.__globlal || {}, { |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
9097
5
195
1
19