diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ae1a7d --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# varkeeper + + ![npm](https://img.shields.io/npm/v/varkeeper) ![NPM](https://img.shields.io/npm/l/varkeeper) ![npm](https://img.shields.io/npm/dw/varkeeper) + + \ No newline at end of file diff --git a/package.json b/package.json index 4357038..5eda226 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,18 @@ "description": "", "main": "dist/index.js", "devDependencies": { - "mocha": "^9.0.2", "chai": "^4.3.4", "chai-arrays": "^2.2.0", "gulp": "^4.0.2", - "gulp-minify": "^3.1.0" + "gulp-minify": "^3.1.0", + "mocha": "^9.0.2" }, "scripts": { "test": "mocha", "build": "gulp build", "publish": "npm publish --access publish" }, - "repository": { - "type": "git", - "url": "git+https://github.com/lucaspalomodevelop/varkeeper.git" - }, + "repository": "git+https://github.com/lucaspalomodevelop/varkeeper.git", "keywords": [ "varkeeper", "var", diff --git a/src/index.js b/src/index.js index 7f25f93..aa8b9be 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,6 @@ function setprop(name, value) { props[name] = value; onchange_func(name, value); - ifis_func(name, value) } @@ -40,19 +39,5 @@ function onchange_func(name,value){ } } -function ifis(name, condition , callback) { - events.push({ name: name, callback: callback, condition: condition, type: 'ifis' }); -} -function ifis_func(name, value) { - let ifisevent = getEventsFromTypeAndName(name, 'ifis'); - ifisevent.forEach(element => { - if(element.condition){ - element.callback(value); - } - }); -} - - - -module.exports = { setprop, getprop, onchange, ifis } \ No newline at end of file +module.exports = { setprop, getprop, onchange } \ No newline at end of file diff --git a/test/test.js b/test/test.js index fac1dcf..367c123 100644 --- a/test/test.js +++ b/test/test.js @@ -47,13 +47,5 @@ describe('varkeeper', () => { assert.equal(a, true); }); }); - describe('ifis', () => { - it('will call funtion by change prop value', (done) => { - varkeeper.ifis('test', varkeeper.getprop('test').length > 1 , (value) => { - done(); - }); - varkeeper.setprop('test', [1,2,3]); - throw new Error(); - }); - }); + }); \ No newline at end of file