Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@accounts/common

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accounts/common - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4-alpha.98931215

flow-typed/npm/jest_v18.x.x.js

3

lib/config.js

@@ -12,3 +12,6 @@ 'use strict';

exports.default = {
siteUrl: 'http://localhost:3000',
sendVerificationEmail: false,
sendEnrollmentEmail: false,
sendWelcomeEmail: false,
forbidClientAccountCreation: false,

@@ -15,0 +18,0 @@ restrictCreationByEmailDomain: null,

@@ -6,9 +6,79 @@ 'use strict';

});
exports.AccountsError = undefined;
var _apolloErrors = require('apollo-errors');
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var AccountsError = (0, _apolloErrors.createError)('AccountsError', {});
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _extendableBuiltin(cls) {
function ExtendableBuiltin() {
var instance = Reflect.construct(cls, Array.from(arguments));
Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
return instance;
}
ExtendableBuiltin.prototype = Object.create(cls.prototype, {
constructor: {
value: cls,
enumerable: false,
writable: true,
configurable: true
}
});
if (Object.setPrototypeOf) {
Object.setPrototypeOf(ExtendableBuiltin, cls);
} else {
ExtendableBuiltin.__proto__ = cls;
}
return ExtendableBuiltin;
}
// eslint-disable-next-line import/prefer-default-export
exports.AccountsError = AccountsError;
var AccountsError = exports.AccountsError = function (_extendableBuiltin2) {
_inherits(AccountsError, _extendableBuiltin2);
function AccountsError(message, loginInfo, errorCode) {
_classCallCheck(this, AccountsError);
var _this = _possibleConstructorReturn(this, (AccountsError.__proto__ || Object.getPrototypeOf(AccountsError)).call(this, message));
_this.epochTime = Date.now();
if (loginInfo) {
_this.loginInfo = loginInfo;
}
if (errorCode) {
_this.errorCode = errorCode;
}
return _this;
}
_createClass(AccountsError, [{
key: 'toString',
value: function toString() {
try {
return JSON.stringify({
message: this.message,
loginInfo: this.loginInfo,
errorCode: this.errorCode,
epochTime: this.epochTime
});
} catch (e) {
return 'Error was thrown but could not be serialized. ' + 'Make sure there is no circular references parameters passed to constructor';
}
}
}, {
key: 'serialize',
value: function serialize() {
return this.toString();
}
}]);
return AccountsError;
}(_extendableBuiltin(Error));

3

lib/index.js

@@ -34,2 +34,3 @@ 'use strict';

exports.toUsernameAndEmail = _toUsernameAndEmail2.default;
exports.config = _config2.default; /* eslint-disable import/no-named-as-default */
exports.config = _config2.default;
/* eslint-disable import/no-named-as-default */

@@ -13,8 +13,7 @@ 'use strict';

var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// $FlowFixMe
return re.test(email);
return email && re.test(email);
};
var validateEmail = exports.validateEmail = function validateEmail(email) {
var isValid = !(0, _lodash.isEmpty)((0, _lodash.trim)(email));
var isValid = !(0, _lodash.isEmpty)((0, _lodash.trim)(email || ''));
return isValid;

@@ -29,4 +28,4 @@ };

var validateUsername = exports.validateUsername = function validateUsername(username) {
var isValid = !(0, _lodash.isEmpty)((0, _lodash.trim)(username));
var isValid = !(0, _lodash.isEmpty)((0, _lodash.trim)(username || ''));
return isValid;
};
{
"name": "@accounts/common",
"version": "0.0.3",
"version": "0.0.4-alpha.98931215",
"description": "Fullstack authentication and accounts-management",

@@ -12,3 +12,3 @@ "main": "lib/index.js",

"compile": "babel ./src --out-dir ./lib",
"flow:check": "flow check",
"postcompile": "npm run flow:prepublish",
"prepublish": "npm run compile",

@@ -18,2 +18,5 @@ "test": "npm run testonly",

"testonly": "jest",
"flow:check": "flow check",
"flow:gen": "flow gen-flow-files ./src/index.js > ./lib/index.js.flow",
"flow:prepublish": "for i in `ls ./src/*.js`; do cp $i `echo $i | sed \"s/src/lib/g\" | sed \"s/js/js\\.flow/g\"`; done",
"coverage": "npm run testonly -- --coverage",

@@ -24,3 +27,6 @@ "coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"

"testEnvironment": "node",
"testRegex": "(/.*.(test|spec)).(js|jsx)$"
"testRegex": "(/.*.(test|spec)).(js|jsx)$",
"testPathDirs": [
"src"
]
},

@@ -49,2 +55,3 @@ "repository": {

"babel-plugin-transform-async-to-generator": "^6.16.0",
"babel-plugin-transform-builtin-extend": "^1.1.0",
"babel-plugin-transform-flow-strip-types": "^6.21.0",

@@ -56,3 +63,3 @@ "babel-plugin-transform-object-rest-spread": "^6.16.0",

"coveralls": "^2.11.14",
"flow-bin": "^0.37.0",
"flow-bin": "^0.39.0",
"jest": "^18.0.0",

@@ -65,5 +72,4 @@ "localstorage-polyfill": "^1.0.1",

"dependencies": {
"apollo-errors": "^1.2.1",
"lodash": "^4.16.4"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc