-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add Transforms #16
base: main
Are you sure you want to change the base?
Add Transforms #16
Commits on Dec 8, 2019
-
(feat): simple version of transforms
- object with `toStorage` and `fromStorage` functions - `toStorage` is called after removing whitelist and blacklists and before serializing to JSON - `fromStorage` is called after deserializing from JSON
Configuration menu - View commit details
-
Copy full SHA for 8bba87c - Browse repository at this point
Copy the full SHA 8bba87cView commit details -
(refactor): whitelist and blacklist as transforms
- so that these can work as examples and so that their order is very explicit as they're treated like any other transform internally - create new transforms/ directory that will hold all built-in transforms moving forward - and export them in transforms/index.ts
Configuration menu - View commit details
-
Copy full SHA for a4d8f16 - Browse repository at this point
Copy the full SHA a4d8f16View commit details -
(optim): return early if white|blacklist doesn't exist
- more importantly, makes the logic a little simpler / easier to read
Configuration menu - View commit details
-
Copy full SHA for c12fd90 - Browse repository at this point
Copy the full SHA c12fd90View commit details -
(docs): transforms usage & example, ordering & visual
- describe usage, link to MST snapshots, show typings, and link to internal examples of whitelist and blacklist transforms - use commit permalink for internal transforms so it won't 404 or change over time (though ofc will need to be updated if the transforms API changes) - describe ordering and show a small diagram of it end-to-end
Configuration menu - View commit details
-
Copy full SHA for 86099a1 - Browse repository at this point
Copy the full SHA 86099a1View commit details -
(docs): README is not longer than the source anymore :'(
- more because we added whitespace and split up functionality, not because transforms are in any way a big code addition (~15 LoC)
Configuration menu - View commit details
-
Copy full SHA for ac1bbf3 - Browse repository at this point
Copy the full SHA ac1bbf3View commit details -
(refactor): w/blist transform args shouldn't be optional
- the array passed into the transforms should be required - same for arrToDict function - they're now called only when array is defined, and I think that behavior is more intuitive -- it should error if the array isn't defined - (test): in internal usage, they're never undefined, so this was reducing coverage because it was dead code - if the transforms were to eventually be externally visible / import-able, they should definitely throw an error in that case too -- if external users pass undefined to it - and the typings change means it'll happen at design-time too - definitely think it's more intuitive for external users this way too - (docs): use this commit for w/blist transform examples - or a variant of this commit -- just one where arr is required
Configuration menu - View commit details
-
Copy full SHA for 6b51a29 - Browse repository at this point
Copy the full SHA 6b51a29View commit details -
(test): ensure transforms apply and do so in correct order
- yay back to 100% code coverage now! - there's a transform branch missing bc there's no test case where there's something in storage and at least one toStorage-only transform - but covering this else branch doesn't really matter - create some transform fixtures - abstract out a setItem function - should consider splitting the tests and fixtures into separate files soon, esp now that we have a few different test suites here
Configuration menu - View commit details
-
Copy full SHA for 8417f22 - Browse repository at this point
Copy the full SHA 8417f22View commit details -
(docs): add link to fixtures as another transform example
- not necessarily the most useful transforms there, but they are examples nonetheless - and they show both to and from Storage usage
Configuration menu - View commit details
-
Copy full SHA for 7998213 - Browse repository at this point
Copy the full SHA 7998213View commit details
Commits on Dec 17, 2019
-
(docs): add an example of building a custom transform
- now docs are roughly same size as source - and README is getting a bit unwieldy, thinking about splitting the Transform docs into their own file
Configuration menu - View commit details
-
Copy full SHA for a117d91 - Browse repository at this point
Copy the full SHA a117d91View commit details