haraka-constants
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"plugins": [ | ||
"haraka" | ||
], | ||
"extends": ["eslint:recommended", "plugin:haraka/recommended"], | ||
"extends": [ "eslint:recommended", "plugin:haraka/recommended" ], | ||
"rules": { | ||
"no-console": 0 | ||
} | ||
} |
24
index.js
@@ -6,3 +6,3 @@ 'use strict'; | ||
let translationTable = {}; | ||
const translationTable = {}; | ||
@@ -22,5 +22,6 @@ exports.cont = 900; | ||
exports.import = function (object) { | ||
for (var k in exports) { | ||
for (const k in exports) { | ||
if (k === 'import') continue; | ||
if (k === 'translate') continue; | ||
if (k === 'connection') continue; | ||
if (exports.hasOwnProperty(k)) { | ||
@@ -36,3 +37,3 @@ object[k.toUpperCase()] = exports[k]; | ||
if (Object.keys(translationTable).length === 0) { | ||
for (var k in exports) { | ||
for (const k in exports) { | ||
if (typeof exports[k] === 'number') { | ||
@@ -49,1 +50,18 @@ translationTable[exports[k]] = k.toUpperCase(); | ||
exports.import(exports); | ||
exports.connection = { | ||
state: { | ||
CMD: 1, | ||
LOOP: 2, | ||
DATA: 3, | ||
PAUSE: 4, | ||
PAUSE_SMTP: 5, | ||
PAUSE_DATA: 6, | ||
DISCONNECTING: 99, | ||
DISCONNECTED: 100, | ||
} | ||
} | ||
Object.keys(exports.connection.state).forEach((state) => { | ||
exports.connection.state['STATE_' + state] = exports.connection.state[state]; | ||
}) |
{ | ||
"author": "Haraka Team <harakamail@gmail.com>", | ||
"author": "Haraka Team <haraka.mail@gmail.com>", | ||
"name": "haraka-constants", | ||
"license": "MIT", | ||
"description": "Haraka constants", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"homepage": "http://haraka.github.io", | ||
@@ -8,0 +8,0 @@ "repository": { |
const node_const = require('constants'); | ||
let constants = require('../index'); | ||
let write_excl_val = node_const.O_CREAT | node_const.O_TRUNC | node_const.O_WRONLY | node_const.O_EXCL; | ||
const constants = require('../index'); | ||
const write_excl_val = node_const.O_CREAT | node_const.O_TRUNC | node_const.O_WRONLY | node_const.O_EXCL; | ||
@@ -48,4 +48,5 @@ exports.constants = { | ||
test.expect(1); | ||
var newObj = {}; | ||
const newObj = {}; | ||
constants.import(newObj); | ||
delete newObj.connection; | ||
test.deepEqual(newObj, | ||
@@ -83,1 +84,24 @@ { | ||
}; | ||
exports.connection = { | ||
'has connection state CMD' : function (test) { | ||
test.expect(1); | ||
test.equal(constants.connection.state.CMD, 1); | ||
test.done(); | ||
}, | ||
'has connection state STATE_CMD' : function (test) { | ||
test.expect(1); | ||
test.equal(constants.connection.state.STATE_CMD, 1); | ||
test.done(); | ||
}, | ||
'has connection state DISCONNECTED' : function (test) { | ||
test.expect(1); | ||
test.equal(constants.connection.state.DISCONNECTED, 100); | ||
test.done(); | ||
}, | ||
'has connection state STATE_DISCONNECTED' : function (test) { | ||
test.expect(1); | ||
test.equal(constants.connection.state.STATE_DISCONNECTED, 100); | ||
test.done(); | ||
}, | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
9706
163
1