Last active
April 17, 2020 03:10
-
-
Save develohpanda/717750abf140a9631a6aa4df2d3a7ce0 to your computer and use it in GitHub Desktop.
I wanted a challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const node = (item?: string, separator?: string) => `${item && `${separator}${item}`}`; | |
const nodes = [ | |
node(parentEntityType), | |
node(currentEntityType, ':'), | |
node(fieldName, '::'), | |
node(fieldName && entityId, ':::'), | |
]; | |
return new Key(nodes.join('')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OG Code:
My version:
Changed rule to say that
:::
forfieldName
s withentityId
s dies and allentityId
s are now prefixed with::
instead.