Skip to content

Commit

Permalink
Remove dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 18, 2017
1 parent d9a1e54 commit 497b5a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var afinn = require('afinn-165');
var has = require('has');
var emoji = require('./emoji');

module.exports = polarity;
Expand All @@ -10,6 +9,8 @@ polarity.polarities = {};

var polarities = polarity.polarities;

var own = {}.hasOwnProperty;

inject(afinn);
inject(emoji);

Expand Down Expand Up @@ -61,11 +62,11 @@ function inject(values) {

/* Get the polarity of a word. */
function getPolarity(value, inject) {
if (has(polarities, value)) {
if (own.call(polarities, value)) {
return polarities[value];
}

if (inject && has(inject, value)) {
if (inject && own.call(inject, value)) {
return inject[value];
}

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"emoji.json"
],
"dependencies": {
"afinn-165": "^1.0.0",
"has": "^1.0.1"
"afinn-165": "^1.0.0"
},
"devDependencies": {
"browserify": "^14.0.0",
Expand Down

0 comments on commit 497b5a5

Please sign in to comment.