@khanacademy/perseus-core 3.0.5 → 3.1.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/data-schema.d.ts +981 -0
- package/dist/es/index.js +2305 -2
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2312 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/objective_.d.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* _ utilities for objects
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Does a pluck on keys inside objects in an object
|
|
6
|
+
*
|
|
7
|
+
* Ex:
|
|
8
|
+
* tools = {
|
|
9
|
+
* translation: {
|
|
10
|
+
* enabled: true
|
|
11
|
+
* },
|
|
12
|
+
* rotation: {
|
|
13
|
+
* enabled: false
|
|
14
|
+
* }
|
|
15
|
+
* };
|
|
16
|
+
* pluckObject(tools, "enabled") returns {
|
|
17
|
+
* translation: true
|
|
18
|
+
* rotation: false
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export declare const pluck: (table: any, subKey: string) => any;
|
|
22
|
+
/**
|
|
23
|
+
* Maps an object to an object
|
|
24
|
+
*
|
|
25
|
+
* > mapObject({a: '1', b: '2'}, (value, key) => {
|
|
26
|
+
* return value + 1;
|
|
27
|
+
* });
|
|
28
|
+
* {a: 2, b: 3}
|
|
29
|
+
*/
|
|
30
|
+
export declare const mapObject: <K extends string, V, U>(obj: Record<K, V>, lambda: (arg1: V, arg2: K) => U) => Record<K, U>;
|