@teleology/fp
Advanced tools
Comparing version 3.0.1 to 3.0.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.dot = void 0; | ||
const LEADING_ARRAY = /\[/g; | ||
const TRAILING_ARRAY = /^\[|\]/g; | ||
const dot = (path) => path.replace(TRAILING_ARRAY, '').replace(LEADING_ARRAY, '.').split('.'); | ||
const dot = (path) => { | ||
const LEADING_ARRAY = /\[/g; | ||
const TRAILING_ARRAY = /^\[|\]/g; | ||
return path.replace(TRAILING_ARRAY, '').replace(LEADING_ARRAY, '.').split('.'); | ||
}; | ||
exports.dot = dot; |
@@ -17,1 +17,2 @@ export * from './parallel'; | ||
export * from './poll'; | ||
export * from './set'; |
@@ -33,1 +33,2 @@ "use strict"; | ||
__exportStar(require("./poll"), exports); | ||
__exportStar(require("./set"), exports); |
export declare type Iterable = { | ||
[key: string | number]: any; | ||
[key: string | number | symbol]: any; | ||
}; | ||
@@ -4,0 +4,0 @@ export declare type Equalizer = (v: any, i: number) => boolean | Object; |
{ | ||
"name": "@teleology/fp", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "A small collection of functional programming utils", | ||
@@ -5,0 +5,0 @@ "author": "Chris Sullivan <chrissullivan.dev@gmail.com>", |
@@ -85,3 +85,14 @@ # @teleology/fp | ||
## set | ||
Sets a value at a dot notation path within an object or array, can be curried. | ||
Example: | ||
```javascript | ||
const { set } = require('@teleology/fp'); | ||
set('a.b.c[1].z', 'hello')({}) // {"a":{"b":{"c":[null,{"z":"hello"}]}}} | ||
set('[0].z', 'hello', []) // [ { z: 'hello' } ] | ||
``` | ||
## get | ||
@@ -88,0 +99,0 @@ |
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
27751
47
452
424
0