Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite ItemList; update ItemList typings #3005

Merged
merged 39 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5cf2ba1
Improve typings for ItemList
davwheat Aug 8, 2021
dbdd584
Add new `.replace()` syntax
davwheat Aug 8, 2021
905a5d0
Update JSDoc
davwheat Aug 8, 2021
e48b954
Add missing `T` type
davwheat Aug 8, 2021
cce095d
Fix typo
davwheat Aug 15, 2021
b139eb9
Allow choice to not set `itemName` property when calling `toArray`
davwheat Aug 17, 2021
2b0f710
Make `ItemList.items` read-only
davwheat Aug 17, 2021
b608016
Modify `.replace()`; add `.changePriority()`
davwheat Aug 17, 2021
39d2bdb
Complete rename
davwheat Aug 17, 2021
6dc1293
Update JSDoc
davwheat Aug 17, 2021
383bee8
Add `.toObject()` method; deprecate `.items`
davwheat Aug 17, 2021
c74c356
Rewrite `.toArray()` to use Proxy instead of modifying the item content
davwheat Aug 17, 2021
f86cafc
Simplify condition
davwheat Aug 17, 2021
9bdcd56
Remove debug code
davwheat Aug 17, 2021
535f3f8
Make proxying function protected instead of private
davwheat Aug 17, 2021
0f9895c
Update a usage of ItemList as an example
davwheat Aug 17, 2021
7bed38e
Make `itemName` property read-only
davwheat Aug 17, 2021
a40e8dd
Use correct capitalisation of `object`
davwheat Aug 17, 2021
81b2385
Invert `toArray` parameter function
davwheat Aug 17, 2021
b253026
Simplify isEmpty check
davwheat Aug 17, 2021
796af60
Update ItemList.ts
davwheat Aug 18, 2021
2930aad
Fix `merge()`
davwheat Aug 18, 2021
1dbc5a7
Remove extra JSDoc comment
davwheat Aug 19, 2021
b79b192
Use `._items` directly for merging
davwheat Aug 22, 2021
0876617
Rename methods: `replace` -> `set`; `changePriority` -> `setPriority`
davwheat Aug 22, 2021
5a2d5ce
Change `items` getter
davwheat Aug 22, 2021
89549f3
Simplify proxying
davwheat Aug 22, 2021
63a14fa
Update URL to source function
davwheat Aug 22, 2021
e08af03
Update compat
davwheat Aug 22, 2021
96635b8
Various changes to toObject
davwheat Aug 23, 2021
e879b12
Remove `Item.key`
davwheat Aug 23, 2021
17fdadb
Make item content proxy method private
davwheat Sep 3, 2021
c9e88e0
Enforce merge typings
davwheat Sep 3, 2021
abe8dc0
Update TSDoc comments to use `{@link}` for references to methods
davwheat Sep 3, 2021
088eb9a
Correct references to deprecated `.replace` method
davwheat Sep 3, 2021
1cdfae7
Throw error when setting content/priority of non-existent items
davwheat Sep 3, 2021
e784f39
Remove intermediary variable
davwheat Sep 3, 2021
2345641
Update TSDoc block
davwheat Sep 3, 2021
ad9ce52
Update js/src/@types/global.d.ts
davwheat Nov 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update URL to source function
  • Loading branch information
davwheat committed Sep 3, 2021
commit 63a14fa77e352750fa662d376fcaf11d1533dd70
2 changes: 1 addition & 1 deletion js/src/common/utils/ItemList.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isObject from '../helpers/isObject';
import isObject from './isObject';

class Item<T> {
davwheat marked this conversation as resolved.
Show resolved Hide resolved
content: T;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @example
* isObject("hello world"); // false
*
* @see https://github.com/jashkenas/underscore/blob/master/underscore.js#L87-L91
* @see https://github.com/jashkenas/underscore/blob/943977e34e2279503528a71ddcc2dd5f96483945/underscore.js#L87-L91
*/
export default function isObject(obj: unknown): obj is object {
const type = typeof obj;
Expand Down