diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af1f52eab6365bb33ee4baea1fbd5fc9b0e0b0c4..f09782977fe1a64a29faa797fdcbbf250eaa632c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,9 +90,11 @@ npm: - cd ./generated/npm - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc - npm publish + - ARTIFACT_NAME="${CI_COMMIT_TAG}_for_nodejs" + - echo $ARTIFACT_NAME artifacts: untracked: true - name: '$CI_COMMIT_TAG_for_nodejs' + name: $ARTIFACT_NAME paths: - generated/npm/nodejs/ only: @@ -103,24 +105,24 @@ release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest script: - - cd ./generated/npm - - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc - - npm publish + - ls generated/npm/* + - ARTIFACT_BROWSER="${CI_COMMIT_TAG}_for_browser" + - echo $ARTIFACT_BROWSER release: tag_name: '$CI_COMMIT_TAG' name: '$CI_COMMIT_TAG' description: '$CI_COMMIT_MESSAGE' assets: links: - - name: 'g1lib_for_browser' + - name: "g1lib_${$CI_COMMIT_TAG}_for_browser" url: 'https://libs.duniter.io/g1lib.js/public/dist/browser/$CI_COMMIT_TAG.mjs' link_type: 'package' - - name: 'g1lib_for_nodejs' + - name: "g1lib_${$CI_COMMIT_TAG}_for_nodejs" url: 'https://libs.duniter.io/g1lib.js/public/dist/nodejs/$CI_COMMIT_TAG.mjs' link_type: 'package' artifacts: untracked: true - name: '$CI_COMMIT_TAG_for_browser' + name: $ARTIFACT_BROWSER paths: - generated/npm/browser/ only: diff --git a/CHANGELOG.fr.md b/CHANGELOG.fr.md index 2038eecbf7d5b4aca627ff349a5ff5f2d476e196..278c318ef1b2f09cd89a43944617fd23938aa4e1 100644 --- a/CHANGELOG.fr.md +++ b/CHANGELOG.fr.md @@ -14,6 +14,10 @@ et ce projet adhère au [versionnage sémantique](https://semver.org/spec/v2.0.0 ## [Non-publié/Non-Stabilisé] (par [1000i100]) +## [Version 3.5.1] - 2022-12-09 (par [1000i100]) +### Corrections +- Dictionary applique systématiquement les variantes passées en option. + ## [Version 3.5.0] - 2022-11-27 (par [1000i100]) ### Ajouté - dictionary intègre un mécanisme de cache pour détecter les doublons. Il est désactivable au-delà d'1_000_000 pour éviter les crashs et saturation de mémoire. diff --git a/README.fr.md b/README.fr.md index 31678bf381b32939a9e6f62f4f85e431bf68d60d..db0131e0a2d0bf5e970c48df087541056892dd09 100644 --- a/README.fr.md +++ b/README.fr.md @@ -29,7 +29,7 @@ pour mutualiser du code métier fiable, maintenable, facile à auditer et facile Pour la confidentialité de la navigation des internautes, les CDN publiques sont à proscrire en production. -Pour du prototypage rapide sans npm : https://unpkg.com/browse/g1lib/ +Pour du prototypage rapide sans npm : https://unpkg.com/g1lib/ ### Via npm Installez nodejs puis en cli : diff --git a/npm/package.json b/npm/package.json index 0206c04916871aa13552f3a82b7266af9a58773b..24424ff00161b726409793584818aaa8ee9f6452 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "g1lib", - "version": "3.5.0", + "version": "3.5.1", "description": "An ubiquitous static javascript toolbox lib for Ǧ1 / Duniter ecosystem with reliability in mind.", "main": "nodejs/all.mjs", "browser": "browser/all.mjs", diff --git a/src/dictionary.mjs b/src/dictionary.mjs index c8d82846415fbfa0e1a3b1f13d760f625fb3ff94..6c7be142ea7f8ca16dea33135dff7f5496a47d46 100644 --- a/src/dictionary.mjs +++ b/src/dictionary.mjs @@ -9,7 +9,7 @@ export class Dictionary { if(typeof this.config.cache === 'undefined') this.config.cache = true; if(typeof this.config.cacheMax === 'undefined') this.config.cacheMax = 1_000_000; if(typeof this.config.idSecPwd === 'undefined') this.config.idSecPwd = true; - this.tree = buildTreeStruct(parse(dictionaryString,this.config.idSecPwd)); + this.tree = buildTreeStruct(parse(dictionaryString,this.config.idSecPwd,this.config.accent,this.config.lowerCase,this.config.leetSpeak)); this.length = this.tree.altCount; this.estimateDuration = ()=>this.length/(this.config.speed || 1) this.estimateRemaining = ()=>(this.length-this.tried)/(this.config.speed || 1) diff --git a/src/dictionary.test.mjs b/src/dictionary.test.mjs index 2d846b358b6cc707e5051fa04be93df0fcce3f70..d87278834cf0582937bce11a46546682bcca1e7b 100644 --- a/src/dictionary.test.mjs +++ b/src/dictionary.test.mjs @@ -98,7 +98,12 @@ test("alt number >= 1_000_000 disable cache and variants attempt", t => { }); test("huge alt number work fine", t => { const x = 12; - const dico = new app.Dictionary(`[0-9]{${2+x}}@@[a-z0-9 ]`, {speed:Math.pow(10,x)}); + const dico = new app.Dictionary(`[0-9]{${2+x}}@@[a-z0-9 ]`, {speed: 10**x}); t.is(dico.length,3_700 * Math.pow(10,x)); t.is(typeof dico.duplicateTotal, 'undefined'); }); +test("huge alt number apply variants if set", t => { + const x = 12; + t.is((new app.Dictionary(`[0-9]{${2+x}}@@[A-Z]`, {lowerCase:0})).length,2_600 * 10**x); + t.is((new app.Dictionary(`[0-9]{${2+x}}@@[A-Z]`, {lowerCase:1})).length,5_200 * 10**x); +});