Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

filepond-plugin-file-rename

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filepond-plugin-file-rename - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

17

dist/filepond-plugin-file-rename.esm.js

@@ -1,9 +0,10 @@

/*
* FilePondPluginFileRename 1.1.2
* Licensed under MIT, https://opensource.org/licenses/MIT
* Please visit https://pqina.nl/filepond for details.
/*!
* FilePondPluginFileRename 1.1.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
/* eslint-disable */
var plugin$1 = ({ addFilter, utils }) => {
const plugin = ({ addFilter, utils }) => {
// get quick reference to Type utils

@@ -67,11 +68,11 @@ const {

// fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags
const isBrowser =
typeof window !== 'undefined' && typeof window.document !== 'undefined';
if (isBrowser) {
document.dispatchEvent(
new CustomEvent('FilePond:pluginloaded', { detail: plugin$1 })
new CustomEvent('FilePond:pluginloaded', { detail: plugin })
);
}
export default plugin$1;
export default plugin;

@@ -1,8 +0,9 @@

/*
* FilePondPluginFileRename 1.1.2
* Licensed under MIT, https://opensource.org/licenses/MIT
* Please visit https://pqina.nl/filepond for details.
/*!
* FilePondPluginFileRename 1.1.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
/* eslint-disable */
var plugin$1=({addFilter:e,utils:n})=>{const{Type:i,renameFile:t,isFile:o,getExtensionFromFilename:l,getFilenameWithoutExtension:s}=n;return e("LOAD_FILE",(e,{query:n})=>new Promise((i,a)=>{const d=n("GET_ALLOW_FILE_RENAME"),r=n("GET_FILE_RENAME_FUNCTION");if(!o(e)||!d||!r)return void i(e);const u=r({name:e.name,basename:s(e.name),extension:`.${l(e.name)}`}),m=n=>{i(t(e,n))};"string"!=typeof u?u.then(m):m(u)})),{options:{allowFileRename:[!0,i.BOOLEAN],fileRenameFunction:[null,i.FUNCTION]}}};const isBrowser="undefined"!=typeof window&&void 0!==window.document;isBrowser&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:plugin$1}));export default plugin$1;
const e=({addFilter:e,utils:n})=>{const{Type:t,renameFile:i,isFile:o,getExtensionFromFilename:a,getFilenameWithoutExtension:l}=n;return e("LOAD_FILE",(e,{query:n})=>new Promise((t,d)=>{const m=n("GET_ALLOW_FILE_RENAME"),s=n("GET_FILE_RENAME_FUNCTION");if(!o(e)||!m||!s)return void t(e);const E=s({name:e.name,basename:l(e.name),extension:`.${a(e.name)}`}),F=n=>{t(i(e,n))};"string"!=typeof E?E.then(F):F(E)})),{options:{allowFileRename:[!0,t.BOOLEAN],fileRenameFunction:[null,t.FUNCTION]}}};"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e}));export default e;

@@ -1,8 +0,9 @@

/*
* FilePondPluginFileRename 1.1.2
* Licensed under MIT, https://opensource.org/licenses/MIT
* Please visit https://pqina.nl/filepond for details.
/*!
* FilePondPluginFileRename 1.1.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
/* eslint-disable */
(function(global, factory) {

@@ -12,11 +13,11 @@ typeof exports === 'object' && typeof module !== 'undefined'

: typeof define === 'function' && define.amd
? define(factory)
: (global.FilePondPluginFileRename = factory());
? define(factory)
: ((global = global || self),
(global.FilePondPluginFileRename = factory()));
})(this, function() {
'use strict';
var plugin$1 = function(_ref) {
var plugin = function plugin(_ref) {
var addFilter = _ref.addFilter,
utils = _ref.utils;
// get quick reference to Type utils

@@ -27,5 +28,3 @@ var Type = utils.Type,

getExtensionFromFilename = utils.getExtensionFromFilename,
getFilenameWithoutExtension = utils.getFilenameWithoutExtension;
// called for each file that is loaded
getFilenameWithoutExtension = utils.getFilenameWithoutExtension; // called for each file that is loaded
// right before it is set to the item state

@@ -40,30 +39,26 @@ // should return a promise

var renameFunction = query('GET_FILE_RENAME_FUNCTION');
if (!isFile(file) || !allowFileRename || !renameFunction) {
resolve(file);
return;
}
} // can either return a name or a promise
// can either return a name or a promise
var newFilename = renameFunction({
name: file.name,
basename: getFilenameWithoutExtension(file.name),
extension: '.' + getExtensionFromFilename(file.name)
});
extension: '.'.concat(getExtensionFromFilename(file.name))
}); // renames the file and resolves
// renames the file and resolves
var rename = function rename(name) {
resolve(renameFile(file, name));
};
}; // has returned new filename immidiately
// has returned new filename immidiately
if (typeof newFilename === 'string') {
rename(newFilename);
return;
}
} // is promise
// is promise
newFilename.then(rename);
});
});
return {

@@ -73,3 +68,2 @@ options: {

allowFileRename: [true, Type.BOOLEAN],
// Rename function to run for this

@@ -79,3 +73,3 @@ fileRenameFunction: [null, Type.FUNCTION]

};
};
}; // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags

@@ -87,7 +81,9 @@ var isBrowser =

document.dispatchEvent(
new CustomEvent('FilePond:pluginloaded', { detail: plugin$1 })
new CustomEvent('FilePond:pluginloaded', {
detail: plugin
})
);
}
return plugin$1;
return plugin;
});

@@ -1,8 +0,9 @@

/*
* FilePondPluginFileRename 1.1.2
* Licensed under MIT, https://opensource.org/licenses/MIT
* Please visit https://pqina.nl/filepond for details.
/*!
* FilePondPluginFileRename 1.1.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
/* eslint-disable */
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.FilePondPluginFileRename=n()}(this,function(){"use strict";var e=function(e){var n=e.addFilter,i=e.utils,t=i.Type,l=i.renameFile,r=i.isFile,f=i.getExtensionFromFilename,m=i.getFilenameWithoutExtension;return n("LOAD_FILE",function(a,e){var d=e.query;return new Promise(function(n,e){var i=d("GET_ALLOW_FILE_RENAME"),t=d("GET_FILE_RENAME_FUNCTION");if(r(a)&&i&&t){var o=t({name:a.name,basename:m(a.name),extension:"."+f(a.name)}),u=function(e){n(l(a,e))};"string"!=typeof o?o.then(u):u(o)}else n(a)})}),{options:{allowFileRename:[!0,t.BOOLEAN],fileRenameFunction:[null,t.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).FilePondPluginFileRename=n()}(this,function(){"use strict";var e=function(e){var n=e.addFilter,i=e.utils,t=i.Type,o=i.renameFile,u=i.isFile,a=i.getExtensionFromFilename,d=i.getFilenameWithoutExtension;return n("LOAD_FILE",function(e,n){var i=n.query;return new Promise(function(n,t){var l=i("GET_ALLOW_FILE_RENAME"),f=i("GET_FILE_RENAME_FUNCTION");if(u(e)&&l&&f){var r=f({name:e.name,basename:d(e.name),extension:".".concat(a(e.name))}),m=function(i){n(o(e,i))};"string"!=typeof r?r.then(m):m(r)}else n(e)})}),{options:{allowFileRename:[!0,t.BOOLEAN],fileRenameFunction:[null,t.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e});
{
"name": "filepond-plugin-file-rename",
"version": "1.1.2",
"version": "1.1.3",
"description": "File Rename Plugin for FilePond",
"homepage": "https://pqina.nl/filepond",
"license": "MIT",
"author": {
"name": "PQINA",
"url": "https://pqina.nl/"
},
"homepage": "https://pqina.nl/filepond/",
"repository": "pqina/filepond-plugin-file-rename",

@@ -10,10 +15,23 @@ "main": "dist/filepond-plugin-file-rename.js",

"module": "dist/filepond-plugin-file-rename.esm.js",
"license": "MIT",
"author": {
"name": "PQINA",
"url": "https://pqina.nl"
"files": [
"dist"
],
"scripts": {
"start": "npx rollup -c -w",
"build": "npx rollup -c"
},
"peerDependencies": {
"filepond": ">=1.8.x <5.x"
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"rollup": "^1.7.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.2.1",
"rollup-plugin-license": "^0.8.1",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-prettier": "^0.6.0",
"rollup-plugin-terser": "^4.0.4"
}
}
}

@@ -8,1 +8,3 @@ # File Rename plugin for FilePond

Using the File Rename plugin we can automatically rename files before the are added to FilePond.
[Demo](https://pqina.github.io/filepond-plugin-file-rename/)
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