New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

conjunct

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conjunct

Glue array items together, with a different glue for the last pair.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

conjunct

Glue array items together, with a different glue for the last pair.

API

This module exports one function that also holds some convenience functions:

conj(list[, fin=' and/or '[, glue=', '[, serial='']]])

The list must support Array-like .slice() and .join().

  • For a single item list, returns the first item verbatim.
  • For an empty list, returns the empty string.
  • For a list with two items, returns them joined by fin.
  • For a list with three or more items, returns them concatenated by serial + fin for the last pair, and glue for all other gaps.
    • Set serial to ',' to achieve a serial comma (also Oxford comma or Harvard comma).

No spaces are added except those contained in fin/glue/serial.

conj.a(list)

Convenience function for fin = ' and ' and defaults for everything else.

conj.o(list)

Convenience function for fin = ' or ' and defaults for everything else.

conj.s(finWord, list)

Convenience function for easy serial comma. Uses fin = ' ' + finWord + ' ', i.e. one space character is added to each side of your finWord.

conj.sa(list)

Convenience function for fin = ' and ' and `serial = ','.

conj.so(list)

Convenience function for fin = ' or ' and `serial = ','.

Usage

see test.usage.js.

Known issues

  • Needs more/better tests and docs.

 

License

ISC

Keywords

and

FAQs

Package last updated on 14 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts