driver-interface
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -11,5 +11,5 @@ /** | ||
outputDescription: 'The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
meta: '===' | ||
} | ||
}; |
42
index.js
@@ -6,22 +6,5 @@ /** | ||
var path = require('path'); | ||
var _ = require('@sailshq/lodash'); | ||
var Machine = require('machine'); | ||
var includeAll = require('include-all'); | ||
/** | ||
* Module constants | ||
*/ | ||
// Build up a constant array of unconventional method names | ||
// (used below to show a warning if a machine identity looks too similar to native JS or Node stuff.) | ||
var UNCONVENTIONAL_METHOD_NAMES = [ | ||
'inspect', 'toString', 'valueOf', 'toLocaleString', | ||
'prototype', 'constructor', | ||
'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable' | ||
]; | ||
var inventory = includeAll({ | ||
@@ -36,25 +19,2 @@ dirname: path.resolve(__dirname, 'layers/'), | ||
var PackedModules = _.reduce(inventory, function (memo, rawNMDef, key) { | ||
// Come up with an identity for debugging purposes. | ||
rawNMDef.identity = _.kebabCase(key); | ||
// Determine the method name. | ||
var methodName = Machine.getMethodName(rawNMDef.identity); | ||
if (_.contains(UNCONVENTIONAL_METHOD_NAMES, methodName)) { | ||
console.warn('Warning: Machine "'+rawNMDef.identity+'" has an unconventional identity that, when converted to a method name (`'+methodName+'`), could conflict with native features of JavaScript/Node.js. Please consider changing it!'); | ||
} | ||
if (rawNMDef.fn) { | ||
console.warn('Warning: Machine "'+rawNMDef.identity+'" has a `fn` -- but machines in an abstract interface pack shouldn\'t have those! Please remove the `fn`.'); | ||
} | ||
rawNMDef.fn = function(inputs, exits) { return exits.error(new Error('Not implemented')); }; | ||
memo[methodName] = Machine.build(rawNMDef); | ||
return memo; | ||
}, {}); | ||
module.exports = PackedModules; | ||
module.exports = inventory; |
@@ -62,3 +62,3 @@ module.exports = { | ||
outputDescription: 'The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
meta: '===' | ||
@@ -65,0 +65,0 @@ } |
@@ -46,3 +46,3 @@ module.exports = { | ||
outputDescription: 'The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
meta: '===' | ||
@@ -57,3 +57,3 @@ } | ||
outputDescription: 'The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
meta: '===' | ||
@@ -67,3 +67,3 @@ } | ||
outputDescription: 'The `error` property is a JavaScript Error instance explaining the exact error. The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
error: '===', | ||
@@ -70,0 +70,0 @@ meta: '===' |
@@ -10,3 +10,3 @@ module.exports = { | ||
cacheable: true, | ||
sideEffects: 'idempotent', | ||
@@ -40,3 +40,3 @@ | ||
outputDescription: 'The return value is true when the cache was successfully flushed.', | ||
example: true | ||
outputExample: true | ||
}, | ||
@@ -48,3 +48,3 @@ | ||
outputDescription: 'The `error` property is a JavaScript Error instance explaining the exact error. The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
error: '===', | ||
@@ -51,0 +51,0 @@ meta: '===' |
@@ -10,3 +10,3 @@ module.exports = { | ||
cacheable: true, | ||
sideEffects: 'cacheable', | ||
@@ -48,3 +48,3 @@ | ||
outputDescription: 'The `value` property is the cached value that was just retrieved. The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
value: '*', | ||
@@ -59,3 +59,3 @@ meta: '===' | ||
outputDescription: 'The `meta` property is reserved for custom driver-specific extensions.', | ||
example: { | ||
outputExample: { | ||
meta: '===' | ||
@@ -62,0 +62,0 @@ } |
{ | ||
"name": "driver-interface", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Standardized interface for common functionality, expressed in layers. Covers communication with databases, hardware, web services, and more.", | ||
@@ -17,7 +17,5 @@ "scripts": { | ||
"dependencies": { | ||
"@sailshq/lodash": "3.10.2", | ||
"include-all": "^4.0.0", | ||
"machine": "^15.0.0" | ||
"include-all": "^4.0.0" | ||
}, | ||
"repository": "https://github.com/node-machine/driver-interface" | ||
} |
1
66414
967
+ Added@sailshq/lodash@3.10.6(transitive)
- Removed@sailshq/lodash@3.10.2
- Removedmachine@^15.0.0
- Removed@sailshq/lodash@3.10.2(transitive)
- Removedanchor@1.4.1(transitive)
- Removedbluebird@3.2.1(transitive)
- Removedflaverr@1.10.0(transitive)
- Removedmachine@15.2.3(transitive)
- Removedparley@3.8.3(transitive)
- Removedrttc@10.0.1(transitive)
- Removedvalidator@13.7.0(transitive)