UNPKG

1.84 kBJavaScriptView Raw
1!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).dotProp=e()}}(function(){return function(){return function e(t,n,r){function o(i,u){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!u&&l)return l(i,!0);if(f)return f(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var c=n[i]={exports:{}};t[i][0].call(c.exports,function(e){return o(t[i][1][e]||e)},c,c.exports,e,t,n,r)}return n[i].exports}for(var f="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}}()({1:[function(e,t,n){"use strict";const r=e("is-obj");function o(e){const t=e.split("."),n=[];for(let e=0;e<t.length;e++){let r=t[e];for(;"\\"===r[r.length-1]&&void 0!==t[e+1];)r=r.slice(0,-1)+".",r+=t[++e];n.push(r)}return n}t.exports={get(e,t,n){if(!r(e)||"string"!=typeof t)return void 0===n?e:n;const f=o(t);for(let t=0;t<f.length;t++){if(!Object.prototype.propertyIsEnumerable.call(e,f[t]))return n;if(null==(e=e[f[t]])){if(t!==f.length-1)return n;break}}return e},set(e,t,n){if(!r(e)||"string"!=typeof t)return e;const f=e,i=o(t);for(let t=0;t<i.length;t++){const o=i[t];r(e[o])||(e[o]={}),t===i.length-1&&(e[o]=n),e=e[o]}return f},delete(e,t){if(!r(e)||"string"!=typeof t)return;const n=o(t);for(let t=0;t<n.length;t++){const o=n[t];if(t===n.length-1)return void delete e[o];if(e=e[o],!r(e))return}},has(e,t){if(!r(e)||"string"!=typeof t)return!1;const n=o(t);for(let t=0;t<n.length;t++){if(!r(e))return!1;if(!(n[t]in e))return!1;e=e[n[t]]}return!0}}},{"is-obj":2}],2:[function(e,t,n){"use strict";t.exports=(e=>{const t=typeof e;return null!==e&&("object"===t||"function"===t)})},{}]},{},[1])(1)});
\No newline at end of file