Permalink
Cannot retrieve contributors at this time
25 lines (23 sloc)
665 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/once.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var before = require('./before'); | |
/** | |
* Creates a function that is restricted to invoking `func` once. Repeat calls | |
* to the function return the value of the first invocation. The `func` is | |
* invoked with the `this` binding and arguments of the created function. | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Function | |
* @param {Function} func The function to restrict. | |
* @returns {Function} Returns the new restricted function. | |
* @example | |
* | |
* var initialize = _.once(createApplication); | |
* initialize(); | |
* initialize(); | |
* // => `createApplication` is invoked once | |
*/ | |
function once(func) { | |
return before(2, func); | |
} | |
module.exports = once; |