Socket
Socket
Sign inDemoInstall

drag-drop

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drag-drop - npm Package Compare versions

Comparing version 2.2.4 to 2.3.0

2

dragdrop.bundle.js

@@ -1,1 +0,1 @@

!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.DragDrop=n()}}(function(){return function n(t,e,r){function o(a,u){if(!e[a]){if(!t[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var s=e[a]={exports:{}};t[a][0].call(s.exports,function(n){var e=t[a][1][n];return o(e?e:n)},s,s.exports,n,t,e,r)}return e[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(n,t,e){function r(){s=!1,u.length?c=u.concat(c):l=-1,c.length&&o()}function o(){if(!s){var n=setTimeout(r);s=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u[l].run();l=-1,t=c.length}u=null,s=!1,clearTimeout(n)}}function i(n,t){this.fun=n,this.array=t}function a(){}var u,f=t.exports={},c=[],s=!1,l=-1;f.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];c.push(new i(n,t)),1!==c.length||s||setTimeout(o,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=a,f.addListener=a,f.once=a,f.off=a,f.removeListener=a,f.removeAllListeners=a,f.emit=a,f.binding=function(n){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(n){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],2:[function(n,t,e){t.exports=function(n,t){function e(n,r){return n.reduce(function(n,o){return Array.isArray(o)&&t>r?n.concat(e(o,r+1)):n.concat(o)},[])}return t="number"==typeof t?t:1/0,e(n,1)}},{}],3:[function(n,t,e){function r(n,t,e){var r=!0,f=!0;if("function"!=typeof n)throw new TypeError(a);return e===!1?r=!1:o(e)&&(r="leading"in e?!!e.leading:r,f="trailing"in e?!!e.trailing:f),u.leading=r,u.maxWait=+t,u.trailing=f,i(n,t,u)}function o(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}var i=n("lodash.debounce"),a="Expected a function",u={leading:!1,maxWait:0,trailing:!1};t.exports=r},{"lodash.debounce":4}],4:[function(n,t,e){function r(n,t,e){function r(){m&&clearTimeout(m),p&&clearTimeout(p),p=m=y=void 0}function i(){var e=t-(c()-v);if(0>=e||e>t){p&&clearTimeout(p);var r=y;p=m=y=void 0,r&&(h=c(),d=n.apply(g,l),m||p||(l=g=null))}else m=setTimeout(i,e)}function f(){m&&clearTimeout(m),p=m=y=void 0,(x||w!==t)&&(h=c(),d=n.apply(g,l),m||p||(l=g=null))}function s(){if(l=arguments,v=c(),g=this,y=x&&(m||!T),w===!1)var e=T&&!m;else{p||T||(h=v);var r=w-(v-h),o=0>=r||r>w;o?(p&&(p=clearTimeout(p)),h=v,d=n.apply(g,l)):p||(p=setTimeout(f,r))}return o&&m?m=clearTimeout(m):m||t===w||(m=setTimeout(i,t)),e&&(o=!0,d=n.apply(g,l)),!o||m||p||(l=g=null),d}var l,p,d,v,g,m,y,h=0,w=!1,x=!0;if("function"!=typeof n)throw new TypeError(a);if(t=0>t?0:+t||0,e===!0){var T=!0;x=!1}else o(e)&&(T=e.leading,w="maxWait"in e&&u(+e.maxWait||0,t),x="trailing"in e?e.trailing:x);return s.cancel=r,s}function o(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}var i=n("lodash._getnative"),a="Expected a function",u=Math.max,f=i(Date,"now"),c=f||function(){return(new Date).getTime()};t.exports=r},{"lodash._getnative":5}],5:[function(n,t,e){function r(n){return"string"==typeof n?n:null==n?"":n+""}function o(n){return!!n&&"object"==typeof n}function i(n,t){var e=null==n?void 0:n[t];return a(e)?e:void 0}function a(n){return null==n?!1:g.call(n)==f?m.test(d.call(n)):o(n)&&l.test(n)}function u(n){return n=r(n),n&&s.test(n)?n.replace(c,"\\$&"):n}var f="[object Function]",c=/[.*+?^${}()|[\]\/\\]/g,s=RegExp(c.source),l=/^\[object .+?Constructor\]$/,p=Object.prototype,d=Function.prototype.toString,v=p.hasOwnProperty,g=p.toString,m=RegExp("^"+u(d.call(v)).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=i},{}],6:[function(n,t,e){var r=n("dezalgo");t.exports=function(n,t){function e(n,e,r){o[n]=r,(0===--i||e)&&(t&&t(e,o),t=null)}t&&(t=r(t));var o,i,a;Array.isArray(n)?(o=[],i=n.length):(a=Object.keys(n),o={},i=a.length),i?a?a.forEach(function(t){n[t](e.bind(void 0,t))}):n.forEach(function(n,t){n(e.bind(void 0,t))}):(t&&t(null,o),t=null)}},{dezalgo:7}],7:[function(n,t,e){function r(n){var t=!0;return i(function(){t=!1}),function(){var e=arguments,r=this;t?i(function(){n.apply(r,e)}):n.apply(r,e)}}var o=n("wrappy");t.exports=o(r);var i=n("asap")},{asap:8,wrappy:9}],8:[function(n,t,e){(function(n){function e(){for(;o.next;){o=o.next;var n=o.task;o.task=void 0;var t=o.domain;t&&(o.domain=void 0,t.enter());try{n()}catch(r){if(f)throw t&&t.exit(),setTimeout(e,0),t&&t.enter(),r;setTimeout(function(){throw r},0)}t&&t.exit()}a=!1}function r(t){i=i.next={task:t,domain:f&&n.domain,next:null},a||(a=!0,u())}var o={task:void 0,next:null},i=o,a=!1,u=void 0,f=!1;if("undefined"!=typeof n&&n.nextTick)f=!0,u=function(){n.nextTick(e)};else if("function"==typeof setImmediate)u="undefined"!=typeof window?setImmediate.bind(window,e):function(){setImmediate(e)};else if("undefined"!=typeof MessageChannel){var c=new MessageChannel;c.port1.onmessage=e,u=function(){c.port2.postMessage(0)}}else u=function(){setTimeout(e,0)};t.exports=r}).call(this,n("_process"))},{_process:1}],9:[function(n,t,e){function r(n,t){function e(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];var r=n.apply(this,t),o=t[t.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach(function(n){r[n]=o[n]}),r}if(n&&t)return r(n)(t);if("function"!=typeof n)throw new TypeError("need wrapper function");return Object.keys(n).forEach(function(t){e[t]=n[t]}),e}t.exports=r},{}],"/":[function(n,t,e){function r(n,t){"string"==typeof n&&(n=document.querySelector(n));var e=i(n),r=a(n,t);return n.addEventListener("dragenter",o,!1),n.addEventListener("dragover",e,!1),n.addEventListener("drop",r,!1),function(){n instanceof Element&&n.classList.remove("drag"),n.removeEventListener("dragenter",o,!1),n.removeEventListener("dragover",e,!1),n.removeEventListener("drop",r,!1)}}function o(n){return n.stopPropagation(),n.preventDefault(),!1}function i(n){var t=l(function(){n instanceof Element&&n.classList.add("drag"),n.timeout&&clearTimeout(n.timeout),n.timeout=setTimeout(function(){n instanceof Element&&n.classList.remove("drag")},150)},100,{trailing:!1});return function(n){n.stopPropagation(),n.preventDefault(),n.dataTransfer.dropEffect="copy",t()}}function a(n,t){return function(e){e.stopPropagation(),e.preventDefault(),n instanceof Element&&n.classList.remove("drag");var r={x:e.clientX,y:e.clientY};return e.dataTransfer.items?s(f(e.dataTransfer.items).map(function(n){return function(t){u(n.webkitGetAsEntry(),t)}}),function(n,e){n||t(c(e),r)}):t(f(e.dataTransfer.files),r),!1}}function u(n,t){function e(){i.readEntries(function(n){n.length>0?(o=o.concat(f(n)),e()):r()})}function r(){s(o.map(function(n){return function(t){u(n,t)}}),t)}var o=[];if(n.isFile)n.file(function(n){t(null,n)});else if(n.isDirectory){var i=n.createReader();e()}}function f(n){return Array.prototype.slice.call(n||[],0)}t.exports=r;var c=n("flatten"),s=n("run-parallel"),l=n("lodash.throttle")},{flatten:2,"lodash.throttle":3,"run-parallel":6}]},{},[])("/")});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.DragDrop=t()}}(function(){return function t(n,e,r){function o(a,u){if(!e[a]){if(!n[a]){var f="function"==typeof require&&require;if(!u&&f)return f(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[a]={exports:{}};n[a][0].call(l.exports,function(t){var e=n[a][1][t];return o(e?e:t)},l,l.exports,t,n,e,r)}return e[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,n,e){n.exports=function(t,n){function e(t,r){return t.reduce(function(t,o){return Array.isArray(o)&&n>r?t.concat(e(o,r+1)):t.concat(o)},[])}return n="number"==typeof n?n:1/0,e(t,1)}},{}],2:[function(t,n,e){function r(t,n,e){var r=!0,u=!0;if("function"!=typeof t)throw new TypeError(a);return e===!1?r=!1:o(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),i(t,n,{leading:r,maxWait:+n,trailing:u})}function o(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var i=t("lodash.debounce"),a="Expected a function";n.exports=r},{"lodash.debounce":3}],3:[function(t,n,e){function r(t,n,e){function r(){h&&clearTimeout(h),d&&clearTimeout(d),w=0,d=h=m=void 0}function i(n,e){e&&clearTimeout(e),d=h=m=void 0,n&&(w=c(),v=t.apply(y,p),h||d||(p=y=void 0))}function f(){var t=n-(c()-g);0>=t||t>n?i(m,d):h=setTimeout(f,t)}function l(){i(b,h)}function s(){if(p=arguments,g=c(),y=this,m=b&&(h||!x),E===!1)var e=x&&!h;else{d||x||(w=g);var r=E-(g-w),o=0>=r||r>E;o?(d&&(d=clearTimeout(d)),w=g,v=t.apply(y,p)):d||(d=setTimeout(l,r))}return o&&h?h=clearTimeout(h):h||n===E||(h=setTimeout(f,n)),e&&(o=!0,v=t.apply(y,p)),!o||h||d||(p=y=void 0),v}var p,d,v,g,y,h,m,w=0,E=!1,b=!0;if("function"!=typeof t)throw new TypeError(a);if(n=0>n?0:+n||0,e===!0){var x=!0;b=!1}else o(e)&&(x=!!e.leading,E="maxWait"in e&&u(+e.maxWait||0,n),b="trailing"in e?!!e.trailing:b);return s.cancel=r,s}function o(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}var i=t("lodash._getnative"),a="Expected a function",u=Math.max,f=i(Date,"now"),c=f||function(){return(new Date).getTime()};n.exports=r},{"lodash._getnative":4}],4:[function(t,n,e){function r(t){return!!t&&"object"==typeof t}function o(t,n){var e=null==t?void 0:t[n];return u(e)?e:void 0}function i(t){return a(t)&&d.call(t)==f}function a(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function u(t){return null==t?!1:i(t)?v.test(s.call(t)):r(t)&&c.test(t)}var f="[object Function]",c=/^\[object .+?Constructor\]$/,l=Object.prototype,s=Function.prototype.toString,p=l.hasOwnProperty,d=l.toString,v=RegExp("^"+s.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");n.exports=o},{}],5:[function(t,n,e){var r=t("dezalgo");n.exports=function(t,n){function e(t,e,r){o[t]=r,(0===--i||e)&&(n&&n(e,o),n=null)}n&&(n=r(n));var o,i,a;Array.isArray(t)?(o=[],i=t.length):(a=Object.keys(t),o={},i=a.length),i?a?a.forEach(function(n){t[n](e.bind(void 0,n))}):t.forEach(function(t,n){t(e.bind(void 0,n))}):(n&&n(null,o),n=null)}},{dezalgo:6}],6:[function(t,n,e){function r(t){var n=!0;return i(function(){n=!1}),function(){var e=arguments,r=this;n?i(function(){t.apply(r,e)}):t.apply(r,e)}}var o=t("wrappy");n.exports=o(r);var i=t("asap")},{asap:7,wrappy:9}],7:[function(t,n,e){"use strict";function r(){if(f.length)throw f.shift()}function o(t){var n;n=u.length?u.pop():new i,n.task=t,a(n)}function i(){this.task=null}var a=t("./raw"),u=[],f=[],c=a.makeRequestCallFromTimer(r);n.exports=o,i.prototype.call=function(){try{this.task.call()}catch(t){o.onerror?o.onerror(t):(f.push(t),c())}finally{this.task=null,u[u.length]=this}}},{"./raw":8}],8:[function(t,n,e){(function(t){"use strict";function e(t){u.length||(a(),f=!0),u[u.length]=t}function r(){for(;c<u.length;){var t=c;if(c+=1,u[t].call(),c>l){for(var n=0,e=u.length-c;e>n;n++)u[n]=u[n+c];u.length-=c,c=0}}u.length=0,c=0,f=!1}function o(t){var n=1,e=new s(t),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){n=-n,r.data=n}}function i(t){return function(){function n(){clearTimeout(e),clearInterval(r),t()}var e=setTimeout(n,0),r=setInterval(n,50)}}n.exports=e;var a,u=[],f=!1,c=0,l=1024,s=t.MutationObserver||t.WebKitMutationObserver;a="function"==typeof s?o(r):i(r),e.requestFlush=a,e.makeRequestCallFromTimer=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(t,n,e){function r(t,n){function e(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];var r=t.apply(this,n),o=n[n.length-1];return"function"==typeof r&&r!==o&&Object.keys(o).forEach(function(t){r[t]=o[t]}),r}if(t&&n)return r(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){e[n]=t[n]}),e}n.exports=r},{}],"/":[function(t,n,e){function r(t,n){"string"==typeof t&&(t=document.querySelector(t));var e=i(t),r=a(t,n);return t.addEventListener("dragenter",o,!1),t.addEventListener("dragover",e,!1),t.addEventListener("drop",r,!1),function(){t instanceof Element&&t.classList.remove("drag"),t.removeEventListener("dragenter",o,!1),t.removeEventListener("dragover",e,!1),t.removeEventListener("drop",r,!1)}}function o(t){return t.stopPropagation(),t.preventDefault(),!1}function i(t){var n=s(function(){t instanceof Element&&t.classList.add("drag"),t.timeout&&clearTimeout(t.timeout),t.timeout=setTimeout(function(){t instanceof Element&&t.classList.remove("drag")},150)},100,{trailing:!1});return function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy",n()}}function a(t,n){return function(e){e.stopPropagation(),e.preventDefault(),t instanceof Element&&t.classList.remove("drag");var r={x:e.clientX,y:e.clientY};if(e.dataTransfer.items)l(f(e.dataTransfer.items).map(function(t){return function(n){u(t.webkitGetAsEntry(),n)}}),function(t,e){t||n(c(e),r)});else{var o=f(e.dataTransfer.files);o.forEach(function(t){t.fullPath="/"+t.name}),n(o,r)}return!1}}function u(t,n){function e(){i.readEntries(function(t){t.length>0?(o=o.concat(f(t)),e()):r()})}function r(){l(o.map(function(t){return function(n){u(t,n)}}),n)}var o=[];if(t.isFile)t.file(function(e){e.fullPath=t.fullPath,n(null,e)});else if(t.isDirectory){var i=t.createReader();e()}}function f(t){return Array.prototype.slice.call(t||[],0)}n.exports=r;var c=t("flatten"),l=t("run-parallel"),s=t("lodash.throttle")},{flatten:1,"lodash.throttle":2,"run-parallel":5}]},{},[])("/")});

@@ -69,3 +69,7 @@ /* global Element */

} else {
ondrop(toArray(e.dataTransfer.files), pos)
var files = toArray(e.dataTransfer.files)
files.forEach(function (file) {
file.fullPath = '/' + file.name
})
ondrop(files, pos)
}

@@ -82,2 +86,3 @@

entry.file(function (file) {
file.fullPath = entry.fullPath // preserve pathing for consumer
cb(null, file)

@@ -84,0 +89,0 @@ })

{
"name": "drag-drop",
"description": "HTML5 drag & drop for humans",
"version": "2.2.4",
"version": "2.3.0",
"author": "Feross Aboukhadijeh <feross@feross.org> (http://feross.org/)",

@@ -6,0 +6,0 @@ "bugs": {

@@ -61,2 +61,3 @@ # drag-drop [![travis](https://img.shields.io/travis/feross/drag-drop.svg)](https://travis-ci.org/feross/drag-drop) [![npm](https://img.shields.io/npm/v/drag-drop.svg)](https://npmjs.org/package/drag-drop) [![downloads](https://img.shields.io/npm/dm/drag-drop.svg)](https://npmjs.org/package/drag-drop) [![gittip](https://img.shields.io/gittip/feross.svg)](https://www.gittip.com/feross/)

console.log(file.lastModifiedData)
console.log(file.fullPath)

@@ -63,0 +64,0 @@ // convert the file to a Buffer that we can use!

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc