@small-tech/message-type
v1.0.0
Published
A basic utility for deriving key paths from an object-tree schema for use in creating statically-typed, unique message names for socket communication.
Downloads
3
Readme
@small-tech/message-type
A basic utility for deriving key paths from an object-tree schema for use in creating statically-typed, unique message names for socket communication.
Usage
import messageType from '@small-tech/message-type'
const MessageType = messageType({
settings: null,
dns: {
validate: {
request: null,
response: null,
progress: null
}
}
})
console.log(MessageType.settings) // 'settings'
console.log(MessageType.dns.validate.request) // 'dns.validate.request'
console.log(MessageType.dns.validate.response) // 'dns.validate.response'
console.log(MessageType.dns.validate.progress) // 'dns.validate.progress'
Test
npm run test
Coverage
npm run coverage
Like this? Fund us!
Small Technology Foundation is a tiny, independent not-for-profit.
We exist in part thanks to patronage by people like you. If you share our vision and want to support our work, please become a patron or donate to us today and help us continue to exist.
Copyright
© 2021-present Aral Balkan, Small Technology Foundation.