Skip to content

Commit

Permalink
Prepare no_dist version (#110)
Browse files Browse the repository at this point in the history
* Prepare no_dist version

* Make getRandomInt public

* Refactor getRandomInt

* Update package.json
  • Loading branch information
puehringer authored Nov 9, 2023
1 parent e51060f commit 5ae02ef
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
38 changes: 35 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,41 @@
"type": "git",
"url": "git@github.com:Caleydo/tourdino.git"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"types": "src/index.ts",
"exports": {
".": {
"types": [
"./dist/index.d.ts",
"./src/index.ts"
],
"import": [
"./dist/index.js",
"./src/index.ts"
],
"default": [
"./dist/index.js",
"./src/index.ts"
]
},
"./phovea_registry": [
"./dist/phovea_registry.js",
"./src/phovea_registry.ts"
],
"./dist/phovea_registry": [
"./dist/phovea_registry.js",
"./src/phovea_registry.ts"
],
"./src/scss/*": [
"./dist/scss/*",
"./src/scss/*"
],
"./dist/scss/*": [
"./dist/scss/*",
"./src/scss/*"
],
"./package.json": "./package.json"
},
"files": [
"src",
"dist"
Expand All @@ -48,7 +81,6 @@
"docs": "visyn_scripts docs",
"lint:fix": "visyn_scripts lint --fix",
"lint": "visyn_scripts lint",
"prepack": "npm run build",
"start": "visyn_scripts start --env workspace_mode=single",
"storybook:build": "NODE_OPTIONS=--max_old_space_size=4096 build-storybook",
"storybook": "NODE_OPTIONS=--max_old_space_size=4096 start-storybook -p 6006",
Expand Down
4 changes: 2 additions & 2 deletions src/base/BaseUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ export class BaseUtils {

while (integers.length !== n) {
// skipped if n = max+1 --> all integers between 0 and max
integers.splice(getRandomInt(0, integers.length), 1); // definetly one hit per iteration
integers.splice(BaseUtils.getRandomInt(0, integers.length), 1); // definetly one hit per iteration
}
return integers;
}
const integers = [];
while (integers.length < n) {
const integer = getRandomInt(0, max);
const integer = BaseUtils.getRandomInt(0, max);
if (integers.indexOf(integer) === -1) {
// not every iteration might add an element
integers.push(integer);
Expand Down

0 comments on commit 5ae02ef

Please sign in to comment.