Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!options.raw && this._customSetters[key]) {
this._customSetters[key].call(this, value, key);
} else {
// Check if we have included models, and if this key matches the include model names/aliases
if (this.options && this.options.include && this.options.includeNames.indexOf(key) !== -1 && value) {
// Pass it on to the include handler
this._setInclude(key, value, options);
return;
} else {
// Bunch of stuff we won't do when its raw
if (!options.raw) {
// If attribute is not in model definition, return
if (!this._isAttribute(key)) {
if (key.indexOf('.') > -1 && this.Model._isJsonAttribute(key.split('.')[0])) {
Dottie.set(this.dataValues, key, value);
this.changed(key, true);
}
return;
}
// If attempting to set primary key and primary key is already defined, return
if (this.Model._hasPrimaryKeys && originalValue && this.Model._isPrimaryKey(key)) {
return;
}
// If attempting to set read only attributes, return
if (!this.isNewRecord && this.Model._hasReadOnlyAttributes && this.Model._isReadOnlyAttribute(key)) {
return;
}
// Convert date fields to real date objects
} else {
// Check if we have included models, and if this key matches the include model names/aliases
if (this.$options && this.$options.include && this.$options.includeNames.indexOf(key) !== -1) {
// Pass it on to the include handler
this._setInclude(key, value, options);
return this;
} else {
// Bunch of stuff we won't do when its raw
if (!options.raw) {
// If attribute is not in model definition, return
if (!this._isAttribute(key)) {
if (key.indexOf('.') > -1 && this.Model._isJsonAttribute(key.split('.')[0])) {
var previousDottieValue = Dottie.get(this.dataValues, key);
if (!_.isEqual(previousDottieValue, value)) {
Dottie.set(this.dataValues, key, value);
this.changed(key.split('.')[0], true);
}
}
return this;
}
// If attempting to set primary key and primary key is already defined, return
if (this.Model._hasPrimaryKeys && originalValue && this.Model._isPrimaryKey(key)) {
return this;
}
// If attempting to set read only attributes, return
if (!this.isNewRecord && this.Model._hasReadOnlyAttributes && this.Model._isReadOnlyAttribute(key)) {
return this;
}
public handleInputChange = (e: React.FormEvent) => {
const name: string = get(e, "target.name");
const value = get(e, "target.value");
// @ts-ignore
this.setState({
[name]: value
});
};
result = results.map(function(result) {
var o = {};
for (var key in result) {
if (result.hasOwnProperty(key)) {
o[key] = result[key];
}
}
if (this.options.nest) {
o = Dot.transform(o);
}
return o;
}, this);
// Queries with include
result = results.map(result => {
let o = {};
for (const key in result) {
if (result.hasOwnProperty(key)) {
o[key] = result[key];
}
}
if (this.options.nest) {
o = Dot.transform(o);
}
return o;
});
// Queries with include
result = results.map(result => {
let o = {};
for (const key in result) {
if (Object.prototype.hasOwnProperty.call(result, key)) {
o[key] = result[key];
}
}
if (this.options.nest) {
o = Dot.transform(o);
}
return o;
});
// Queries with include
, outerBinding
, comparatorMap
, aliasMap
, comparator = '='
, field = options.field || options.model && options.model.rawAttributes && options.model.rawAttributes[key] || options.model && options.model.fieldRawAttributesMap && options.model.fieldRawAttributesMap[key]
, fieldType = options.type || (field && field.type)
, tmp;
if (key && typeof key === 'string' && key.indexOf('.') !== -1 && options.model) {
if (options.model.rawAttributes[key.split('.')[0]] && options.model.rawAttributes[key.split('.')[0]].type instanceof DataTypes.JSON) {
field = options.model.rawAttributes[key.split('.')[0]];
fieldType = field.type;
tmp = value;
value = {};
Dottie.set(value, key.split('.').slice(1), tmp);
key = key.split('.')[0];
}
}
comparatorMap = {
$eq: '=',
$ne: '!=',
$gte: '>=',
$gt: '>',
$lte: '<=',
$lt: '<',
$not: 'IS NOT',
$is: 'IS',
$like: 'LIKE',
$notLike: 'NOT LIKE',
$iLike: 'ILIKE',
listing.forEach(function(filePath) {
var actualPath = path.join(folderPath, filePath)
, stats = fs.statSync(actualPath)
, dotted
, fullPath;
dotted = folderPath.replace(appRoot, '').replace(modulesPath.replace(appRoot, ''), '').split(path.sep);
if (dotted[dotted.length-1] === '') {
dotted.pop();
}
dotted = dotted.slice(2, dotted.length).join('.');
if (dottie.get(cache, dotted) === undefined) {
dottie.set(cache, dotted, {});
}
if (stats.isFile()) {
if ((filePath.match(/.+\.js$/g) !== null || filePath.match(/.+\.es6$/g) !== null) && filePath !== 'index.js' && filePath !== 'module.js') {
filePath = filePath.replace('.js', '').replace('.es6', '');
fullPath = [dotted, filePath].join('.');
if (dottie.get(cache, fullPath) === undefined) {
Object.defineProperty(dottie.get(cache, dotted), filePath, {
get: function() {
if (dottie.get(loaded, fullPath) === undefined) {
if (debug.enabled) {
debug('Loading %s into magic module from %s...', fullPath, actualPath);
}
dottie.set(loaded, fullPath, require(actualPath));
const DataSourceContainer = ({
userDevices: { err, data = [] },
user,
timestamp,
handleUserChange,
handleDeviceChange,
handleTimestampStartChange,
handleTimestampEndChange,
}) => {
const users = data.map((entry) => entry.user);
const devices = dottie.get(data.find((entry) => entry.user === user), 'devices', []);
return (
<div>
{err && (
)}
</div>
function processDependencies (dir, shrinkwrapFile, shrinkwrapPath) {
let shrinkwrapContent = require(shrinkwrapFile);
let dependenciesPath = _.compact(_.flatten([shrinkwrapPath].concat('dependencies')));
let dependencies = dottie.get(shrinkwrapContent, dependenciesPath);
let depNames = Object.keys(dependencies || {});
return Bluebird.mapSeries(depNames, function (depName) {
let depDir = dir + '/node_modules/' + depName;
let depShrinkwrapPath = dependenciesPath.concat(depName);
return processDependency(depDir, shrinkwrapFile, depShrinkwrapPath, depName);
});
}