aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_countHolders.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/_countHolders.js')
-rw-r--r--node_modules/lodash/_countHolders.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/lodash/_countHolders.js b/node_modules/lodash/_countHolders.js
new file mode 100644
index 0000000..718fcda
--- /dev/null
+++ b/node_modules/lodash/_countHolders.js
@@ -0,0 +1,21 @@
+/**
+ * Gets the number of `placeholder` occurrences in `array`.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {*} placeholder The placeholder to search for.
+ * @returns {number} Returns the placeholder count.
+ */
+function countHolders(array, placeholder) {
+ var length = array.length,
+ result = 0;
+
+ while (length--) {
+ if (array[length] === placeholder) {
+ ++result;
+ }
+ }
+ return result;
+}
+
+module.exports = countHolders;