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

@felte/common

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@felte/common - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

6

CHANGELOG.md
# @felte/common
## 0.4.4
### Patch Changes
- Fix issues due to mutability of common functions
## 0.4.3

@@ -4,0 +10,0 @@

2

dist/esm/utils/cloneDeep.js

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

import{_isPlainObject as e}from"./isPlainObject.js";function t(s){return Object.keys(s||{}).reduce(((c,i)=>Object.assign(Object.assign({},c),{[i]:e(s[i])?t(s[i]):s[i]})),{})}export{t as _cloneDeep};
import{_isPlainObject as r}from"./isPlainObject.js";function e(s){return Object.keys(s||{}).reduce(((t,i)=>Object.assign(Object.assign({},t),{[i]:r(s[i])?e(s[i]):Array.isArray(s[i])?[...s[i]]:s[i]})),{})}export{e as _cloneDeep};
//# sourceMappingURL=cloneDeep.js.map

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

import{isFormControl as e,isFieldSetElement as t,isInputElement as r}from"./typeGuards.js";import{_mergeWith as n}from"./mergeWith.js";import{_isPlainObject as i}from"./isPlainObject.js";import{_get as o}from"./get.js";import{_set as f}from"./set.js";import{_update as a}from"./update.js";import{getPath as c}from"./getPath.js";import{getIndex as u}from"./getIndex.js";function l(r){if(e(r))return[r];if(0===r.childElementCount)return[];const n=new Set;for(const i of r.children){if(e(i)&&n.add(i),t(i))for(const t of i.elements)e(t)&&n.add(t);i.childElementCount>0&&l(i).forEach((e=>n.add(e)))}return Array.from(n)}function s(r){for(const n of r.elements)if(e(n)||t(n)){if(r.name&&n.name){const e=u(r),t=void 0===e?r.name:`${r.name}[${e}]`;n.dataset.felteFieldset=r.dataset.felteFieldset?`${r.dataset.felteFieldset}.${t}`:t}"true"!==r.dataset.felteUnsetOnRemove||n.hasAttribute("data-felte-unset-on-remove")||(n.dataset.felteUnsetOnRemove="true")}}function d(e){return e.type.match(/^(number|range)$/)?e.value?+e.value:void 0:e.value}function m(n){var i;const l={};for(const m of n.elements){if(t(m)&&s(m),!e(m)||!m.name)continue;const v=c(m),y=u(m);if(r(m)){if("checkbox"===m.type){if(void 0===o(l,v)){if(1===Array.from(n.querySelectorAll(`[name="${m.name}"]`)).filter((t=>{if(!e(t))return!1;if(void 0!==y){return Number(t.dataset.felteIndex)===y}return v===c(t)})).length){f(l,v,m.checked);continue}f(l,v,m.checked?[m.value]:[]);continue}Array.isArray(o(l,v))&&m.checked&&a(l,v,(e=>(void 0===y||Array.isArray(e)||(e=[]),[...e,m.value])));continue}if("radio"===m.type){if(o(l,v))continue;f(l,v,m.checked?m.value:void 0);continue}if("file"===m.type){f(l,v,m.multiple?Array.from(m.files||[]):null===(i=m.files)||void 0===i?void 0:i[0]);continue}}const p=d(m);f(l,v,p)}return{defaultData:l}}function v(t,n){if(!e(t))return;const i=n;if(r(t)){if("checkbox"===t.type){const e=i;return void 0===e||"boolean"==typeof e?void(t.checked=!!e):void(Array.isArray(e)&&(e.includes(t.value)?t.checked=!0:t.checked=!1))}if("radio"===t.type){const e=i;return void(t.value===e?t.checked=!0:t.checked=!1)}if("file"===t.type)return t.files=null,void(t.value="")}t.value=String(i||"")}function y(r,n){for(const i of r.elements){if(t(i)&&s(i),!e(i)||!i.name)continue;const r=c(i);v(i,o(n,r))}}function p(e,t){if(!i(e)&&!i(t)){if(null===e)return t;if(null===t)return e;if(e&&t)return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),[...e,...t]}}async function h(e,t){if(!t)return;if(!Array.isArray(t))return t(e);const r=await Promise.all(t.map((t=>t(e))));return n(...r,p)}export{s as addAttrsFromFieldset,h as executeValidation,l as getFormControls,m as getFormDefaultValues,d as getInputTextOrNumber,v as setControlValue,y as setForm};
import{isFormControl as e,isFieldSetElement as t,isInputElement as r}from"./typeGuards.js";import{_mergeWith as n}from"./mergeWith.js";import{_isPlainObject as i}from"./isPlainObject.js";import{_get as o}from"./get.js";import{_set as f}from"./set.js";import{_update as a}from"./update.js";import{getPath as u}from"./getPath.js";import{getIndex as c}from"./getIndex.js";function l(r){if(e(r))return[r];if(0===r.childElementCount)return[];const n=new Set;for(const i of r.children){if(e(i)&&n.add(i),t(i))for(const t of i.elements)e(t)&&n.add(t);i.childElementCount>0&&l(i).forEach((e=>n.add(e)))}return Array.from(n)}function s(r){for(const n of r.elements)if(e(n)||t(n)){if(r.name&&n.name){const e=c(r),t=void 0===e?r.name:`${r.name}[${e}]`;n.dataset.felteFieldset=r.dataset.felteFieldset?`${r.dataset.felteFieldset}.${t}`:t}"true"!==r.dataset.felteUnsetOnRemove||n.hasAttribute("data-felte-unset-on-remove")||(n.dataset.felteUnsetOnRemove="true")}}function d(e){return e.type.match(/^(number|range)$/)?e.value?+e.value:void 0:e.value}function m(n){var i;let l={};for(const m of n.elements){if(t(m)&&s(m),!e(m)||!m.name)continue;const v=u(m),y=c(m);if(r(m)){if("checkbox"===m.type){if(void 0===o(l,v)){if(1===Array.from(n.querySelectorAll(`[name="${m.name}"]`)).filter((t=>{if(!e(t))return!1;if(void 0!==y){return Number(t.dataset.felteIndex)===y}return v===u(t)})).length){l=f(l,v,m.checked);continue}l=f(l,v,m.checked?[m.value]:[]);continue}Array.isArray(o(l,v))&&m.checked&&a(l,v,(e=>(void 0===y||Array.isArray(e)||(e=[]),[...e,m.value])));continue}if("radio"===m.type){if(o(l,v))continue;l=f(l,v,m.checked?m.value:void 0);continue}if("file"===m.type){l=f(l,v,m.multiple?Array.from(m.files||[]):null===(i=m.files)||void 0===i?void 0:i[0]);continue}}const p=d(m);l=f(l,v,p)}return{defaultData:l}}function v(t,n){if(!e(t))return;const i=n;if(r(t)){if("checkbox"===t.type){const e=i;return void 0===e||"boolean"==typeof e?void(t.checked=!!e):void(Array.isArray(e)&&(e.includes(t.value)?t.checked=!0:t.checked=!1))}if("radio"===t.type){const e=i;return void(t.value===e?t.checked=!0:t.checked=!1)}if("file"===t.type)return t.files=null,void(t.value="")}t.value=String(i||"")}function y(r,n){for(const i of r.elements){if(t(i)&&s(i),!e(i)||!i.name)continue;const r=u(i);v(i,o(n,r))}}function p(e,t){if(!i(e)&&!i(t)){if(null===e)return t;if(null===t)return e;if(e&&t)return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),[...e,...t]}}async function h(e,t){if(!t)return;if(!Array.isArray(t))return t(e);const r=await Promise.all(t.map((t=>t(e))));return n(...r,p)}export{s as addAttrsFromFieldset,h as executeValidation,l as getFormControls,m as getFormDefaultValues,d as getInputTextOrNumber,v as setControlValue,y as setForm};
//# sourceMappingURL=domUtils.js.map

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

function t(t,e,r){Object(t)!==t&&(t={});let c=Array.isArray(e)?e:e.toString().match(/[^.[\]]+/g)||[];return c.slice(0,-1).reduce(((t,e,r)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(Number(c[r+1]))>>0==+c[r+1]?[]:{}),t)[c[c.length-1]]=r,t}export{t as _set};
import{_cloneDeep as e}from"./cloneDeep.js";function r(r,t,c){Object(r)!==r?r={}:void 0!==r&&(r=e(r));let o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[];return o.slice(0,-1).reduce(((e,r,t)=>Object(e[r])===e[r]?e[r]:e[r]=Math.abs(Number(o[t+1]))>>0==+o[t+1]?[]:{}),r)[o[o.length-1]]=c,r}export{r as _set};
//# sourceMappingURL=set.js.map

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

function e(e,r){var t;if(Object(e)!==e)return;let i=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[];return null===(t=i.slice(0,-1).reduce(((e,r)=>Object(e[r])===e[r]?e[r]:void 0),e))||void 0===t||delete t[i[i.length-1]],e}export{e as _unset};
import{_cloneDeep as e}from"./cloneDeep.js";function r(r,t){var i;if(Object(r)!==r)return;void 0!==r&&(r=e(r));let o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[];return null===(i=o.slice(0,-1).reduce(((e,r)=>Object(e[r])===e[r]?e[r]:void 0),r))||void 0===i||delete i[o[o.length-1]],r}export{r as _unset};
//# sourceMappingURL=unset.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Common={})}(this,(function(e){"use strict";function t(e,t){return Object.keys(e).some((n=>t(e[n])))}function n(e,t){return Object.keys(e).reduce(((n,r)=>Object.assign(Object.assign({},n),{[r]:t(e[r])})),{})}function r(e){return"[object Object]"===Object.prototype.toString.call(e)}function i(e){return Object.keys(e||{}).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:r(e[n])?i(e[n]):e[n]})),{})}function o(e,t){return n(e,(e=>r(e)?o(e,t):Array.isArray(e)?e.map(function(e){return function(t){return r(t)?o(t,e):e}}(t)):t))}function u(...e){const t=e.pop(),n=i(e.shift());if(0===e.length)return n;for(const a of e){if(!a)continue;const e=Object.keys(a);for(const c of e){const e=t(n[c],a[c]);if(void 0!==e)n[c]=e;else if(r(a[c])&&r(n[c]))n[c]=u(n[c],a[c],t);else if(Array.isArray(a[c])&&Array.isArray(n[c]))n[c]=a[c].map(((e,r)=>u(n[c][r],e,t)));else if(r(a[c])){const e=o(i(a[c]),void 0);n[c]=u(e,a[c],t)}else void 0!==a[c]&&(n[c]=a[c])}}return n}function a(e,t){if(!r(e)||!r(t)){if(Array.isArray(t)){if(t.some(r))return;const n=Array.isArray(e)?e:[];return t.map(((e,t)=>{var r;return null!==(r=n[t])&&void 0!==r?r:e}))}return void 0!==e?e:void 0}}function c(e,t,n){const r=n=>String.prototype.split.call(t,n).filter(Boolean).reduce(((e,t)=>null!=e?e[t]:e),e),i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===i||i===e?n:i}function f(e,t,n){Object(e)!==e&&(e={});let r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[];return r.slice(0,-1).reduce(((e,t,n)=>Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(r[n+1]))>>0==+r[n+1]?[]:{}),e)[r[r.length-1]]=n,e}function l(e,t,n){Object(e)!==e&&(e={});let r=t.toString().match(/[^.[\]]+/g)||[];return r.slice(0,-1).reduce(((e,t,n)=>Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(r[n+1]))>>0==+r[n+1]?[]:{}),e)[r[r.length-1]]=n(c(e,t)),e}function s(e){return e.hasAttribute("data-felte-index")?Number(e.dataset.felteIndex):void 0}function d(e){var t;return"INPUT"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function m(e){var t;return"TEXTAREA"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function y(e){var t;return"SELECT"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function v(e){var t;return"FIELDSET"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function p(e){return d(e)||m(e)||y(e)}function b(e){const t=e.dataset.felteFieldset,n=function(e){return e.hasAttribute("data-felte-index")?Number(e.dataset.felteIndex):void 0}(e),r=void 0===n?e.name:`${e.name}[${n}]`;return t?`${t}.${r}`:r}function A(e){for(const t of e.elements)if(p(t)||v(t)){if(e.name&&t.name){const n=s(e),r=void 0===n?e.name:`${e.name}[${n}]`;t.dataset.felteFieldset=e.dataset.felteFieldset?`${e.dataset.felteFieldset}.${r}`:r}"true"!==e.dataset.felteUnsetOnRemove||t.hasAttribute("data-felte-unset-on-remove")||(t.dataset.felteUnsetOnRemove="true")}}function h(e){return e.type.match(/^(number|range)$/)?e.value?+e.value:void 0:e.value}function g(e,t){if(!p(e))return;const n=t;if(d(e)){if("checkbox"===e.type){const t=n;return void 0===t||"boolean"==typeof t?void(e.checked=!!t):void(Array.isArray(t)&&(t.includes(e.value)?e.checked=!0:e.checked=!1))}if("radio"===e.type){const t=n;return void(e.value===t?e.checked=!0:e.checked=!1)}if("file"===e.type)return e.files=null,void(e.value="")}e.value=String(n||"")}function O(e,t){if(!r(e)&&!r(t)){if(null===e)return t;if(null===t)return e;if(e&&t)return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),[...e,...t]}}e._cloneDeep=i,e._defaultsDeep=function(...e){return u(...e,a)},e._get=c,e._isPlainObject=r,e._mapValues=n,e._merge=function(...e){return u(...e,(()=>{}))},e._mergeWith=u,e._set=f,e._some=t,e._unset=function(e,t){var n;if(Object(e)!==e)return;let r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[];return null===(n=r.slice(0,-1).reduce(((e,t)=>Object(e[t])===e[t]?e[t]:void 0),e))||void 0===n||delete n[r[r.length-1]],e},e._update=l,e.addAttrsFromFieldset=A,e.deepSet=o,e.deepSome=function e(n,i){return t(n,(t=>r(t)?e(t,i):i(t)))},e.executeValidation=async function(e,t){if(!t)return;return Array.isArray(t)?u(...await Promise.all(t.map((t=>t(e)))),O):t(e)},e.getFormControls=function e(t){if(p(t))return[t];if(0===t.childElementCount)return[];const n=new Set;for(const r of t.children){if(p(r)&&n.add(r),v(r))for(const e of r.elements)p(e)&&n.add(e);r.childElementCount>0&&e(r).forEach((e=>n.add(e)))}return Array.from(n)},e.getFormDefaultValues=function(e){var t;const n={};for(const r of e.elements){if(v(r)&&A(r),!p(r)||!r.name)continue;const i=b(r),o=s(r);if(d(r)){if("checkbox"===r.type){if(void 0===c(n,i)){if(1===Array.from(e.querySelectorAll(`[name="${r.name}"]`)).filter((e=>{if(!p(e))return!1;if(void 0!==o){return Number(e.dataset.felteIndex)===o}return i===b(e)})).length){f(n,i,r.checked);continue}f(n,i,r.checked?[r.value]:[]);continue}Array.isArray(c(n,i))&&r.checked&&l(n,i,(e=>(void 0===o||Array.isArray(e)||(e=[]),[...e,r.value])));continue}if("radio"===r.type){if(c(n,i))continue;f(n,i,r.checked?r.value:void 0);continue}if("file"===r.type){f(n,i,r.multiple?Array.from(r.files||[]):null===(t=r.files)||void 0===t?void 0:t[0]);continue}}const u=h(r);f(n,i,u)}return{defaultData:n}},e.getIndex=s,e.getInputTextOrNumber=h,e.getPath=b,e.isElement=function(e){return e.nodeType===Node.ELEMENT_NODE},e.isFieldSetElement=v,e.isFieldValue=function(e){return Array.isArray(e)?0===e.length||e.some((e=>e instanceof File||"string"==typeof e)):"string"==typeof e||"number"==typeof e||"boolean"==typeof e||e instanceof File},e.isFormControl=p,e.isInputElement=d,e.isSelectElement=y,e.isTextAreaElement=m,e.setControlValue=g,e.setForm=function(e,t){for(const n of e.elements){if(v(n)&&A(n),!p(n)||!n.name)continue;g(n,c(t,b(n)))}},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Common={})}(this,(function(e){"use strict";function t(e,t){return Object.keys(e).some((n=>t(e[n])))}function n(e,t){return Object.keys(e).reduce(((n,r)=>Object.assign(Object.assign({},n),{[r]:t(e[r])})),{})}function r(e){return"[object Object]"===Object.prototype.toString.call(e)}function i(e){return Object.keys(e||{}).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:r(e[n])?i(e[n]):Array.isArray(e[n])?[...e[n]]:e[n]})),{})}function o(e,t){return n(e,(e=>r(e)?o(e,t):Array.isArray(e)?e.map(function(e){return function(t){return r(t)?o(t,e):e}}(t)):t))}function u(...e){const t=e.pop(),n=i(e.shift());if(0===e.length)return n;for(const a of e){if(!a)continue;const e=Object.keys(a);for(const c of e){const e=t(n[c],a[c]);if(void 0!==e)n[c]=e;else if(r(a[c])&&r(n[c]))n[c]=u(n[c],a[c],t);else if(Array.isArray(a[c])&&Array.isArray(n[c]))n[c]=a[c].map(((e,r)=>u(n[c][r],e,t)));else if(r(a[c])){const e=o(i(a[c]),void 0);n[c]=u(e,a[c],t)}else void 0!==a[c]&&(n[c]=a[c])}}return n}function a(e,t){if(!r(e)||!r(t)){if(Array.isArray(t)){if(t.some(r))return;const n=Array.isArray(e)?e:[];return t.map(((e,t)=>{var r;return null!==(r=n[t])&&void 0!==r?r:e}))}return void 0!==e?e:void 0}}function c(e,t,n){const r=n=>String.prototype.split.call(t,n).filter(Boolean).reduce(((e,t)=>null!=e?e[t]:e),e),i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return void 0===i||i===e?n:i}function f(e,t,n){Object(e)!==e?e={}:void 0!==e&&(e=i(e));let r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[];return r.slice(0,-1).reduce(((e,t,n)=>Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(r[n+1]))>>0==+r[n+1]?[]:{}),e)[r[r.length-1]]=n,e}function l(e,t,n){Object(e)!==e&&(e={});let r=t.toString().match(/[^.[\]]+/g)||[];return r.slice(0,-1).reduce(((e,t,n)=>Object(e[t])===e[t]?e[t]:e[t]=Math.abs(Number(r[n+1]))>>0==+r[n+1]?[]:{}),e)[r[r.length-1]]=n(c(e,t)),e}function s(e){return e.hasAttribute("data-felte-index")?Number(e.dataset.felteIndex):void 0}function d(e){var t;return"INPUT"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function m(e){var t;return"TEXTAREA"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function y(e){var t;return"SELECT"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function v(e){var t;return"FIELDSET"===(null===(t=e)||void 0===t?void 0:t.nodeName)}function p(e){return d(e)||m(e)||y(e)}function A(e){const t=e.dataset.felteFieldset,n=function(e){return e.hasAttribute("data-felte-index")?Number(e.dataset.felteIndex):void 0}(e),r=void 0===n?e.name:`${e.name}[${n}]`;return t?`${t}.${r}`:r}function b(e){for(const t of e.elements)if(p(t)||v(t)){if(e.name&&t.name){const n=s(e),r=void 0===n?e.name:`${e.name}[${n}]`;t.dataset.felteFieldset=e.dataset.felteFieldset?`${e.dataset.felteFieldset}.${r}`:r}"true"!==e.dataset.felteUnsetOnRemove||t.hasAttribute("data-felte-unset-on-remove")||(t.dataset.felteUnsetOnRemove="true")}}function h(e){return e.type.match(/^(number|range)$/)?e.value?+e.value:void 0:e.value}function g(e,t){if(!p(e))return;const n=t;if(d(e)){if("checkbox"===e.type){const t=n;return void 0===t||"boolean"==typeof t?void(e.checked=!!t):void(Array.isArray(t)&&(t.includes(e.value)?e.checked=!0:e.checked=!1))}if("radio"===e.type){const t=n;return void(e.value===t?e.checked=!0:e.checked=!1)}if("file"===e.type)return e.files=null,void(e.value="")}e.value=String(n||"")}function O(e,t){if(!r(e)&&!r(t)){if(null===e)return t;if(null===t)return e;if(e&&t)return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),[...e,...t]}}e._cloneDeep=i,e._defaultsDeep=function(...e){return u(...e,a)},e._get=c,e._isPlainObject=r,e._mapValues=n,e._merge=function(...e){return u(...e,(()=>{}))},e._mergeWith=u,e._set=f,e._some=t,e._unset=function(e,t){var n;if(Object(e)!==e)return;void 0!==e&&(e=i(e));let r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[];return null===(n=r.slice(0,-1).reduce(((e,t)=>Object(e[t])===e[t]?e[t]:void 0),e))||void 0===n||delete n[r[r.length-1]],e},e._update=l,e.addAttrsFromFieldset=b,e.deepSet=o,e.deepSome=function e(n,i){return t(n,(t=>r(t)?e(t,i):i(t)))},e.executeValidation=async function(e,t){if(!t)return;return Array.isArray(t)?u(...await Promise.all(t.map((t=>t(e)))),O):t(e)},e.getFormControls=function e(t){if(p(t))return[t];if(0===t.childElementCount)return[];const n=new Set;for(const r of t.children){if(p(r)&&n.add(r),v(r))for(const e of r.elements)p(e)&&n.add(e);r.childElementCount>0&&e(r).forEach((e=>n.add(e)))}return Array.from(n)},e.getFormDefaultValues=function(e){var t;let n={};for(const r of e.elements){if(v(r)&&b(r),!p(r)||!r.name)continue;const i=A(r),o=s(r);if(d(r)){if("checkbox"===r.type){if(void 0===c(n,i)){if(1===Array.from(e.querySelectorAll(`[name="${r.name}"]`)).filter((e=>{if(!p(e))return!1;if(void 0!==o){return Number(e.dataset.felteIndex)===o}return i===A(e)})).length){n=f(n,i,r.checked);continue}n=f(n,i,r.checked?[r.value]:[]);continue}Array.isArray(c(n,i))&&r.checked&&l(n,i,(e=>(void 0===o||Array.isArray(e)||(e=[]),[...e,r.value])));continue}if("radio"===r.type){if(c(n,i))continue;n=f(n,i,r.checked?r.value:void 0);continue}if("file"===r.type){n=f(n,i,r.multiple?Array.from(r.files||[]):null===(t=r.files)||void 0===t?void 0:t[0]);continue}}const u=h(r);n=f(n,i,u)}return{defaultData:n}},e.getIndex=s,e.getInputTextOrNumber=h,e.getPath=A,e.isElement=function(e){return e.nodeType===Node.ELEMENT_NODE},e.isFieldSetElement=v,e.isFieldValue=function(e){return Array.isArray(e)?0===e.length||e.some((e=>e instanceof File||"string"==typeof e)):"string"==typeof e||"number"==typeof e||"boolean"==typeof e||e instanceof File},e.isFormControl=p,e.isInputElement=d,e.isSelectElement=y,e.isTextAreaElement=m,e.setControlValue=g,e.setForm=function(e,t){for(const n of e.elements){if(v(n)&&b(n),!p(n)||!n.name)continue;g(n,c(t,A(n)))}},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map
{
"name": "@felte/common",
"version": "0.4.3",
"version": "0.4.4",
"description": "Common utilities for Felte packages",

@@ -5,0 +5,0 @@ "author": "Pablo Berganza <pablo@berganza.dev>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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