isotropy-ast-analyzer-keyvaluedb
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -10,3 +10,3 @@ "use strict"; | ||
analyzeCallExpression: function analyzeCallExpression(path, state) { | ||
return (0, _makeAnalyzer2.default)([schemas.get], path, state, analysisState); | ||
return (0, _makeAnalyzer2.default)([schemas.get, _isotropyAnalyzerErrors.schemas.readErrorSchema(schemas.root)], path, state, analysisState); | ||
} | ||
@@ -24,2 +24,4 @@ }; | ||
var _isotropyAnalyzerErrors = require("isotropy-analyzer-errors"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -26,0 +28,0 @@ |
@@ -10,3 +10,3 @@ "use strict"; | ||
analyzeAssignmentExpression: function analyzeAssignmentExpression(path, state) { | ||
return (0, _makeAnalyzer2.default)([schemas.put, schemas.del], path, state, analysisState); | ||
return (0, _makeAnalyzer2.default)([schemas.put, schemas.del, _isotropyAnalyzerErrors.schemas.writeErrorSchema(schemas.root)], path, state, analysisState); | ||
} | ||
@@ -24,2 +24,4 @@ }; | ||
var _isotropyAnalyzerErrors = require("isotropy-analyzer-errors"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -26,0 +28,0 @@ |
@@ -18,5 +18,5 @@ "use strict"; | ||
}).first(function (x, i) { | ||
return x instanceof _chimpanzee.Match || i === schemas.length - 1; | ||
return x instanceof _chimpanzee.Match || x instanceof _chimpanzee.Fault || i === schemas.length - 1; | ||
}); | ||
} | ||
//# sourceMappingURL=make-analyzer.js.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.default = function (state, analysisState) { | ||
return (0, _isotropyAnalyzerUtils.composite)({ | ||
var schema = { | ||
type: "AssignmentExpression", | ||
@@ -34,4 +34,5 @@ operator: "=", | ||
} | ||
}, { | ||
build: function build() { | ||
}; | ||
return (0, _isotropyAnalyzerUtils.composite)(schema, { | ||
build: function build(obj) { | ||
return function () { | ||
@@ -42,3 +43,3 @@ return function (result) { | ||
key: result.value.arguments[0].argument | ||
}) : result; | ||
}) : (0, _isotropyAnalyzerErrors.canParse)(schema.right.callee.object, obj.get("right.callee.object")) && obj.node.right.callee.property.name === "filter" ? new _chimpanzee.Fault("Invalid database expression. Should look like: myDb.todos = myDb.todos.filter(todo => !(todo.key === \"Task\"))") : result; | ||
}; | ||
@@ -56,2 +57,4 @@ }; | ||
var _isotropyAnalyzerErrors = require("isotropy-analyzer-errors"); | ||
var binaryExpression = (0, _isotropyAnalyzerUtils.composite)({ | ||
@@ -61,3 +64,3 @@ type: "BinaryExpression", | ||
return function () { | ||
return _isotropyAnalyzerUtils.arrowFunctions.isMemberExpressionDefinedOnParameter(obj) ? new _chimpanzee.Match(obj) : new _chimpanzee.Error("Expression must be defined on the arrow function parameter."); | ||
return _isotropyAnalyzerUtils.arrowFunctions.isMemberExpressionDefinedOnParameter(obj) ? new _chimpanzee.Match(obj) : new Error("Expression must be defined on the arrow function parameter."); | ||
}; | ||
@@ -64,0 +67,0 @@ }, { selector: "path" }), |
@@ -33,3 +33,3 @@ "use strict"; | ||
key: result.value.arguments[0].body | ||
}) : result instanceof _chimpanzee.Skip && canParse(schema.callee.object, obj.get("callee").get("object")) ? new _chimpanzee.Fault("Invalid database expression. Should look like myDb.todos.find(todo => todo.key === \"some_key\")") : result; | ||
}) : result instanceof _chimpanzee.Skip && (0, _isotropyAnalyzerErrors.canParse)(schema.callee.object, obj.get("callee.object")) && obj.node.callee.property.name === "find" ? new _chimpanzee.Fault("Invalid database expression. Should look like: myDb.todos.find(todo => todo.key === \"some_key\")") : result; | ||
}; | ||
@@ -47,6 +47,3 @@ }; | ||
function canParse(schema, obj) { | ||
var result = (0, _chimpanzee.parse)(schema)(obj)(); | ||
return result instanceof _chimpanzee.Match || result instanceof _chimpanzee.Empty; | ||
} | ||
var _isotropyAnalyzerErrors = require("isotropy-analyzer-errors"); | ||
@@ -53,0 +50,0 @@ var binaryExpression = (0, _isotropyAnalyzerUtils.composite)({ |
@@ -7,44 +7,44 @@ "use strict"; | ||
var _del = require("./del"); | ||
var _root = require("./root"); | ||
Object.defineProperty(exports, "del", { | ||
Object.defineProperty(exports, "root", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_del).default; | ||
return _interopRequireDefault(_root).default; | ||
} | ||
}); | ||
var _put = require("./put"); | ||
var _collection = require("./collection"); | ||
Object.defineProperty(exports, "put", { | ||
Object.defineProperty(exports, "collection", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_put).default; | ||
return _interopRequireDefault(_collection).default; | ||
} | ||
}); | ||
var _root = require("./root"); | ||
var _get = require("./get"); | ||
Object.defineProperty(exports, "root", { | ||
Object.defineProperty(exports, "get", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_root).default; | ||
return _interopRequireDefault(_get).default; | ||
} | ||
}); | ||
var _get = require("./get"); | ||
var _put = require("./put"); | ||
Object.defineProperty(exports, "get", { | ||
Object.defineProperty(exports, "put", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_get).default; | ||
return _interopRequireDefault(_put).default; | ||
} | ||
}); | ||
var _collection = require("./collection"); | ||
var _del = require("./del"); | ||
Object.defineProperty(exports, "collection", { | ||
Object.defineProperty(exports, "del", { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_collection).default; | ||
return _interopRequireDefault(_del).default; | ||
} | ||
@@ -51,0 +51,0 @@ }); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.default = function (state, analysisState) { | ||
return (0, _isotropyAnalyzerUtils.composite)({ | ||
var schema = { | ||
type: "AssignmentExpression", | ||
@@ -25,5 +25,6 @@ operator: "=", | ||
}, | ||
arguments: (0, _chimpanzee.capture)() | ||
arguments: [(0, _chimpanzee.capture)()] | ||
} | ||
}, { | ||
}; | ||
return (0, _isotropyAnalyzerUtils.composite)(schema, { | ||
build: function build(obj) { | ||
@@ -35,3 +36,3 @@ return function (context) { | ||
items: result.value.arguments | ||
}) : result; | ||
}) : (0, _isotropyAnalyzerErrors.canParse)(schema.right.callee.object, obj.get("right.callee.object")) && obj.node.right.callee.property.name === "concat" ? new _chimpanzee.Fault("Invalid database expression. Should look like: myDb.todos = myDb.todos.concat({ key: \"First_Task\", value: \"Get Eggs\" })") : result; | ||
}; | ||
@@ -48,2 +49,4 @@ }; | ||
var _isotropyAnalyzerUtils = require("isotropy-analyzer-utils"); | ||
var _isotropyAnalyzerErrors = require("isotropy-analyzer-errors"); | ||
//# sourceMappingURL=put.js.map |
{ | ||
"name": "isotropy-ast-analyzer-keyvaluedb", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": "Isotropy Team<isotropy@agilehead.com>", | ||
@@ -17,2 +17,3 @@ "contributors": [ | ||
"chimpanzee": "^0.0.61", | ||
"isotropy-analyzer-errors": "^0.0.5", | ||
"isotropy-analyzer-utils": "^0.0.1", | ||
@@ -19,0 +20,0 @@ "lazily": "^0.0.17", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
126605
5
31
384
+ Addedisotropy-analyzer-errors@0.0.5(transitive)