@akromio/dataset
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -72,4 +72,11 @@ "use strict"; | ||
name = decl.fn; | ||
} else if (_core.dogma.includes(decl, "input")) { | ||
var _decl$tags; | ||
Datum = ConstDatum; | ||
name = decl.input; | ||
decl.value = "$(args." + name + ")"; | ||
decl.required = true; | ||
decl.tags = ((_decl$tags = decl.tags) !== null && _decl$tags !== void 0 ? _decl$tags : []).concat("input"); | ||
} else { | ||
_core.dogma.raise(TypeError(`Item of dataset declaration must contain var, const or fn. Got: ${(0, _core.fmt)(decl)}.`)); | ||
_core.dogma.raise(TypeError(`Datum declaration must be 'const', 'fn', 'input' or 'var'. Got: ${(0, _core.fmt)(decl)}.`)); | ||
} | ||
@@ -94,3 +101,10 @@ const constraints = Constraints(); | ||
} | ||
constraints.validateValue(value); | ||
{ | ||
const [ok, err] = _core.dogma.peval(() => { | ||
return constraints.validateValue(value); | ||
}); | ||
if (!ok) { | ||
_core.dogma.raise(TypeError(`Error on datum '${name}': ${err.message}`)); | ||
} | ||
} | ||
datum = Datum(_core.dogma.clone(decl, { | ||
@@ -97,0 +111,0 @@ "name": name, |
{ | ||
"name": "@akromio/dataset", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "Dataset library for Akromio.", | ||
@@ -37,10 +37,9 @@ "author": { | ||
"scripts": { | ||
"lint": "dogmac check src tests", | ||
"lint": "dogmac check src", | ||
"build": "npm run build/src", | ||
"build/src": "rm -rf dist/ && dogmac js -o dist/cjs src && babel -d dist dist", | ||
"test": "npm run test/build && mocha --config .mocharc.yaml", | ||
"test/build": "rm -rf ./__tests__ && dogmac js -o __tests__ tests && babel -d __tests__ __tests__", | ||
"test": "mocha --config .mocharc.yaml", | ||
"cov": "c8 mocha --config .mocharc.yaml" | ||
}, | ||
"gitHead": "7f5bab8de6a7343cfeeee8b1a89044413dca7d1d" | ||
"gitHead": "8c34370eac014ab940b454dc777ec6043bc1f4be" | ||
} |
78705
35
2218