@khanacademy/perseus-core 18.2.2 → 18.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.item-splitting.js +192 -0
- package/dist/es/index.item-splitting.js.map +1 -0
- package/dist/es/index.js +3 -3
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.item-splitting.d.ts +2 -0
- package/dist/index.item-splitting.js +220 -0
- package/dist/index.item-splitting.js.map +1 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/random-util.d.ts +7 -0
- package/package.json +18 -4
|
@@ -13,3 +13,10 @@ export declare function shuffle<T>(array: ReadonlyArray<T>, randomSeed: number |
|
|
|
13
13
|
export declare function constrainedShuffle<T>(array: readonly T[], random: RNG, isValidShuffle: (shuffled: readonly T[]) => boolean): T[];
|
|
14
14
|
export declare function randomIntInRange(min: number, max: number, random: RNG): number;
|
|
15
15
|
export declare const random: RNG;
|
|
16
|
+
/**
|
|
17
|
+
* Randomizes an array using the sort-by-random-key method
|
|
18
|
+
*
|
|
19
|
+
* @param inputArray - The array of elements to randomize
|
|
20
|
+
* @returns A new array containing the same elements in randomized order
|
|
21
|
+
*/
|
|
22
|
+
export declare function randomizeArrayElements<T>(inputArray: ReadonlyArray<T>): T[];
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Shared Perseus infrastructure",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "18.
|
|
6
|
+
"version": "18.4.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -18,14 +18,28 @@
|
|
|
18
18
|
"module": "dist/es/index.js",
|
|
19
19
|
"main": "dist/index.js",
|
|
20
20
|
"source": "src/index.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/es/index.js",
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"source": "./src/index.ts"
|
|
27
|
+
},
|
|
28
|
+
"./item-splitting": {
|
|
29
|
+
"import": "./dist/es/index.item-splitting.js",
|
|
30
|
+
"require": "./dist/index.item-splitting.js",
|
|
31
|
+
"types": "./dist/index.item-splitting.d.ts",
|
|
32
|
+
"source": "./src/index.item-splitting.ts"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
21
35
|
"files": [
|
|
22
36
|
"dist"
|
|
23
37
|
],
|
|
24
38
|
"dependencies": {
|
|
25
39
|
"tiny-invariant": "1.3.1",
|
|
26
|
-
"@khanacademy/
|
|
27
|
-
"@khanacademy/
|
|
28
|
-
"@khanacademy/pure-markdown": "2.
|
|
40
|
+
"@khanacademy/kas": "2.1.0",
|
|
41
|
+
"@khanacademy/perseus-utils": "2.1.0",
|
|
42
|
+
"@khanacademy/pure-markdown": "2.2.0"
|
|
29
43
|
},
|
|
30
44
|
"devDependencies": {
|
|
31
45
|
"@khanacademy/wonder-stuff-core": "1.5.5",
|