compile-linux-mount-options-from-dict-pmb

Make a comma-separated list from mount options in a dictionary object.

Usage no npm install needed!

<script type="module">
  import compileLinuxMountOptionsFromDictPmb from 'https://cdn.skypack.dev/compile-linux-mount-options-from-dict-pmb';
</script>

README



compile-linux-mount-options-from-dict-pmb

Make a comma-separated list from mount options in a dictionary object.

API

This module exports one function:

compile(opt)

Where opt are your mount options, as…

  • a string: will be returned as-is.
  • any false-y value except empty string: returns 'defaults'.
  • an array: returns all truthy elements from that array, .join()ed by ','.
  • or a dictionary object, the actual reason for this module.

Values supported in the dictionary are:

  • undefined to ignore that entry
  • A string
  • A number
  • null or true to add the option with neither = nor value.
  • false to add the option with prefix no and neither = nor value.
  • An array to specify an option multiple times.

Usage

see test/basics.mjs

Known issues

  • Needs more/better tests and docs.

 

License

ISC