You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
3.1 KiB

{"ast":null,"code":"import arraySampleSize from './_arraySampleSize.js';\nimport baseSampleSize from './_baseSampleSize.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\nfunction sampleSize(collection, n, guard) {\n if (guard ? isIterateeCall(collection, n, guard) : n === undefined) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n}\nexport default sampleSize;","map":{"version":3,"names":["arraySampleSize","baseSampleSize","isArray","isIterateeCall","toInteger","sampleSize","collection","n","guard","undefined","func"],"sources":["D:/language/VScode/Front-end logistics/node_modules/lodash-es/sampleSize.js"],"sourcesContent":["import arraySampleSize from './_arraySampleSize.js';\nimport baseSampleSize from './_baseSampleSize.js';\nimport isArray from './isArray.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toInteger from './toInteger.js';\n\n/**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\nfunction sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n}\n\nexport default sampleSize;\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,uBAAuB;AACnD,OAAOC,cAAc,MAAM,sBAAsB;AACjD,OAAOC,OAAO,MAAM,cAAc;AAClC,OAAOC,cAAc,MAAM,sBAAsB;AACjD,OAAOC,SAAS,MAAM,gBAAgB;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAACC,UAAU,EAAEC,CAAC,EAAEC,KAAK,EAAE;EACxC,IAAKA,KAAK,GAAGL,cAAc,CAACG,UAAU,EAAEC,CAAC,EAAEC,KAAK,CAAC,GAAGD,CAAC,KAAKE,SAAS,EAAG;IACpEF,CAAC,GAAG,CAAC;EACP,CAAC,MAAM;IACLA,CAAC,GAAGH,SAAS,CAACG,CAAC,CAAC;EAClB;EACA,IAAIG,IAAI,GAAGR,OAAO,CAACI,UAAU,CAAC,GAAGN,eAAe,GAAGC,cAAc;EACjE,OAAOS,IAAI,CAACJ,UAAU,EAAEC,CAAC,CAAC;AAC5B;AAEA,eAAeF,UAAU","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}