@felte/common
Advanced tools
Comparing version 1.0.0-next.15 to 1.0.0-next.16
@@ -44,6 +44,35 @@ 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
} | ||
function handleArray(value) { | ||
return function (propVal) { | ||
if (_isPlainObject(propVal)) | ||
return deepSet(propVal, value); | ||
if (_isPlainObject(propVal)) { | ||
const _a = deepSet(propVal, value), field = __rest(_a, ["key"]); | ||
return field; | ||
} | ||
return value; | ||
@@ -340,2 +369,11 @@ }; | ||
function createId(length = 8) { | ||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | ||
let str = ''; | ||
for (let i = 0; i < length; i++) { | ||
str += chars.charAt(Math.floor(Math.random() * chars.length)); | ||
} | ||
return str; | ||
} | ||
/** | ||
@@ -502,2 +540,3 @@ * @ignore | ||
exports.addAttrsFromFieldset = addAttrsFromFieldset; | ||
exports.createId = createId; | ||
exports.deepSet = deepSet; | ||
@@ -504,0 +543,0 @@ exports.deepSome = deepSome; |
@@ -15,3 +15,2 @@ export { _some } from './utils/some.js'; | ||
export { deepSome } from './utils/deepSome.js'; | ||
export { isElement, isFieldSetElement, isFormControl, isInputElement, isSelectElement, isTextAreaElement } from './utils/typeGuards.js'; | ||
export { getPath } from './utils/getPath.js'; | ||
@@ -22,3 +21,5 @@ export { shouldIgnore } from './utils/shouldIgnore.js'; | ||
export { executeTransforms } from './utils/executeTransforms.js'; | ||
export { createId } from './utils/createId.js'; | ||
export { isElement, isFieldSetElement, isFormControl, isInputElement, isSelectElement, isTextAreaElement } from './utils/typeGuards.js'; | ||
export { addAttrsFromFieldset, getFormControls, getFormDefaultValues, getInputTextOrNumber, setControlValue, setForm } from './utils/domUtils.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,2 @@ | ||
import { __rest } from '../node_modules/.pnpm/tslib@2.3.1/node_modules/tslib/tslib.es6.js'; | ||
import { _mapValues } from './mapValues.js'; | ||
@@ -6,4 +7,6 @@ import { _isPlainObject } from './isPlainObject.js'; | ||
return function (propVal) { | ||
if (_isPlainObject(propVal)) | ||
return deepSet(propVal, value); | ||
if (_isPlainObject(propVal)) { | ||
const _a = deepSet(propVal, value), field = __rest(_a, ["key"]); | ||
return field; | ||
} | ||
return value; | ||
@@ -10,0 +13,0 @@ }; |
@@ -15,3 +15,2 @@ export { _some } from "./utils/some"; | ||
export { deepSome } from "./utils/deepSome"; | ||
export * from "./utils/typeGuards"; | ||
export { getPath } from "./utils/getPath"; | ||
@@ -22,4 +21,6 @@ export { shouldIgnore } from "./utils/shouldIgnore"; | ||
export { executeTransforms } from "./utils/executeTransforms"; | ||
export { createId } from "./utils/createId"; | ||
export * from "./utils/typeGuards"; | ||
export * from "./utils/domUtils"; | ||
export * from "./types-51c9b03c"; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@felte/common", | ||
"version": "1.0.0-next.15", | ||
"version": "1.0.0-next.16", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169708
78
1562