UNPKG

@macrostrat/column-components

Version:

React rendering primitives for stratigraphic columns

1 lines 1.24 kB
{"version":3,"file":"unpack.cjs","sources":["../../../../../../../../../.yarn/berry/cache/chroma-js-npm-3.2.0-d5c39f5077-10c0.zip/node_modules/chroma-js/src/utils/unpack.js"],"sourcesContent":["import type from './type.js';\n\nexport default (args, keyOrder = null) => {\n // if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) return Array.prototype.slice.call(args);\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n if (type(args[0]) == 'object' && keyOrder) {\n return keyOrder\n .split('')\n .filter((k) => args[0][k] !== undefined)\n .map((k) => args[0][k]);\n }\n // otherwise we just return the first argument\n // (which we suppose is an array of args)\n return args[0].slice(0);\n};\n"],"names":[],"mappings":";;AAEA,MAAA,SAAe,CAAC,MAAM,WAAW,SAAS;AAEtC,MAAI,KAAK,UAAU,EAAG,QAAO,MAAM,UAAU,MAAM,KAAK,IAAI;AAG5D,MAAI,KAAK,KAAK,CAAC,CAAC,KAAK,YAAY,UAAU;AACvC,WAAO,SACF,MAAM,EAAE,EACR,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,MAAM,MAAS,EACtC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,CAAC;AAAA,EAC9B;AAGA,SAAO,KAAK,CAAC,EAAE,MAAM,CAAC;AAC1B;;","x_google_ignoreList":[0]}