import { ensureArray } from "@thi.ng/arrays/ensure-array" ; import { isArray } from "@thi.ng/checks/is-array" ; import { isString } from "@thi.ng/checks/is-string" ; import { concat } from "./concat.js" ; remarks Also see the  duplicate transducer for achieving a different
 * kind of value duplication.
 *
 *  example param x export function dup ( x ) ; export function dup < T > ( x ) ; export function dup < T > ( x ) ; export function dup ( x ) { return isString ( x ) ? x + x : isArray ( x ) ? x . concat ( x ) : ( ( x = ensureArray ( x ) ) , concat ( x , x ) ) ; }