camel-dot-prop-immutable
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -16,8 +16,4 @@ "use strict"; | ||
function camelDotMatch({ obj, prop }) { | ||
let result = _dotPropImmutable2.default.get(obj, prop); | ||
let result; | ||
if (result) { | ||
return { prop, result }; | ||
} | ||
for (let combo of camelCombos(prop)) { | ||
@@ -37,3 +33,3 @@ result = _dotPropImmutable2.default.get(obj, combo); | ||
let regexes = [/\.\w/, /\.[^.]+$/]; | ||
let combos = {}; | ||
let combos = { [prop]: null }; | ||
let ogProp = prop; | ||
@@ -40,0 +36,0 @@ |
import dot from "dot-prop-immutable" | ||
function camelDotMatch({ obj, prop }) { | ||
let result = dot.get(obj, prop) | ||
let result | ||
if (result) { | ||
return { prop, result } | ||
} | ||
for (let combo of camelCombos(prop)) { | ||
@@ -24,3 +20,3 @@ result = dot.get(obj, combo) | ||
let regexes = [/\.\w/, /\.[^.]+$/] | ||
let combos = {} | ||
let combos = { [prop]: null } | ||
let ogProp = prop | ||
@@ -27,0 +23,0 @@ |
{ | ||
"name": "camel-dot-prop-immutable", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": | ||
@@ -5,0 +5,0 @@ "dot-prop-immutable w/ check for flattened props", |
# camel-dot-prop-immutable | ||
This extension to [dot-prop-immutable](/debitoor/dot-prop-immutable) allows `foo.bar.buzz` to match `{ foo: { barBuzz } }` and `{ fooBar: { buzz } }`. | ||
This extension to [dot-prop-immutable](/debitoor/dot-prop-immutable) adds fuzzy matching. | ||
| Props | Matches | Type | | ||
| -------------- | ---------------------------- | ---------------- | | ||
| `foo.bar.buzz` | `{ foo: { bar: { buzz } } }` | Default behavior | | ||
| `foo.bar.buzz` | `{ foo: { barBuzz } }` | Collapse right | | ||
| `foo.bar.buzz` | `{ fooBar: { buzz } }` | Collapse left | | ||
### Example | ||
```js | ||
@@ -6,0 +14,0 @@ import dot from "camel-dot-prop-immutable" |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
50
0
9203
6
199