my-idlers/node_modules/collect.js/dist/methods/get.js
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

22 lines
444 B
JavaScript
Vendored

'use strict';
var _require = require('../helpers/is'),
isFunction = _require.isFunction;
module.exports = function get(key) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
if (this.items[key] !== undefined) {
return this.items[key];
}
if (isFunction(defaultValue)) {
return defaultValue();
}
if (defaultValue !== null) {
return defaultValue;
}
return null;
};