📦 Publicodes v1.0.0-beta.15
parent
b1d7325739
commit
854ce8d223
|
@ -16,11 +16,11 @@
|
|||
"dist/index.js"
|
||||
],
|
||||
"devDependencies": {
|
||||
"publicodes": "^1.0.0-beta.14",
|
||||
"publicodes": "^1.0.0-beta.15",
|
||||
"yaml": "^1.10.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"publicodes": "^1.0.0-beta.14"
|
||||
"publicodes": "^1.0.0-beta.15"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
"fuse.js": "5.2.1",
|
||||
"iframe-resizer": "^4.1.1",
|
||||
"modele-social": "^0.2.0",
|
||||
"publicodes": "^1.0.0-beta.14",
|
||||
"publicodes-react": "^1.0.0-beta.14",
|
||||
"publicodes": "^1.0.0-beta.15",
|
||||
"publicodes-react": "^1.0.0-beta.15",
|
||||
"ramda": "^0.27.0",
|
||||
"react": "^17.0.0",
|
||||
"react-color": "^2.14.0",
|
||||
|
|
|
@ -19,3 +19,9 @@
|
|||
- Corrige un bug bloquant qui empêchait l'utilisation de la bibliothèque
|
||||
- Enlève la dépendance à i18n et react-i18n et toute la traduction qui n'était pas utilisée de toute façon
|
||||
- Ajoute des tests et une publication automatique des paquets publicodes
|
||||
|
||||
## 1.0.0-beta.15
|
||||
|
||||
**core**
|
||||
|
||||
- Fix bug sur le mécanisme minimum, une valeur non applicable n'est plus considérée comme valant "0" (#1493)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "publicodes",
|
||||
"version": "1.0.0-beta.14",
|
||||
"version": "1.0.0-beta.15",
|
||||
"description": "A declarative language for encoding public algorithm",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/types/index.d.ts",
|
||||
|
|
|
@ -16,6 +16,18 @@ export const mecanismMin = (v, context) => {
|
|||
} as MinNode
|
||||
}
|
||||
|
||||
const evaluate = evaluateArray<'minimum'>((a, b) => Math.min(a, b), Infinity)
|
||||
const min = (a, b) => {
|
||||
if (a === false) {
|
||||
return b
|
||||
}
|
||||
if (b === false) {
|
||||
return a
|
||||
}
|
||||
if (a === null || b === null) {
|
||||
return null
|
||||
}
|
||||
return Math.min(a, b)
|
||||
}
|
||||
const evaluate = evaluateArray<'minimum'>(min, false)
|
||||
|
||||
registerEvaluationFunction('minimum', evaluate)
|
||||
|
|
|
@ -28,5 +28,14 @@ Minimum avec variables:
|
|||
- situation:
|
||||
assiette: 1000
|
||||
valeur attendue: 10
|
||||
|
||||
a: non
|
||||
Minimum avec valeur non applicable:
|
||||
formule:
|
||||
le minimum de:
|
||||
- a
|
||||
- 10
|
||||
exemples:
|
||||
- valeur attendue: 10
|
||||
# TODO
|
||||
# Pouvoir faire référence à une variable, ou mettre une valeur. Aujourd'hui il est seulement possible de lister des mécanismes numériques
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
"@testing-library/jest-dom": "^5.11.4",
|
||||
"@testing-library/react": "^11.1.0",
|
||||
"@testing-library/user-event": "^12.1.10",
|
||||
"publicodes": "../../core/publicodes-1.0.0-beta.14.tgz",
|
||||
"publicodes-react": "../../ui-react/publicodes-react-1.0.0-beta.14.tgz",
|
||||
"publicodes": "../../core/publicodes-1.0.0-beta.15.tgz",
|
||||
"publicodes-react": "../../ui-react/publicodes-react-1.0.0-beta.15.tgz",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-router": "^5.2.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "publicodes-react",
|
||||
"version": "1.0.0-beta.14",
|
||||
"version": "1.0.0-beta.15",
|
||||
"description": "UI to explore publicodes computations",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
@ -26,7 +26,7 @@
|
|||
"yaml": "^1.9.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"publicodes": "1.0.0-beta.14",
|
||||
"publicodes": "1.0.0-beta.15",
|
||||
"react": "^17.0.2",
|
||||
"react-router-dom": "^5.1.1",
|
||||
"react-router-hash-link": "^1.2.2"
|
||||
|
|
Loading…
Reference in New Issue