@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.
@@ -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>;
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": "3.0.5",
6
+ "version": "3.1.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },