wrapped-value

Simple helper for wrapping and unwrapping values

Usage no npm install needed!

<script type="module">
  import wrappedValue from 'https://cdn.skypack.dev/wrapped-value';
</script>

README

wrapped-value

A simple helper for generic value wrapping and unwrapping

Wraps a value with a "type" so it can be checked, "unwrapped" and processed at the appropriate point in a transformation chain.

var tableName = wrap('tableName', 'accounts');

wrap.isWrapped(tableName) // true

wrap.getType(tableName)   // 'tableName'

wrap.deref(tableName)     // 'accounts'

wrap.is(tableName, 'tableName') // true

License

MIT