Comparing version 1.2.1 to 2.0.0
@@ -10,3 +10,3 @@ /** | ||
*/ | ||
module.exports = function(holder, propName){ | ||
export default (holder, propName) => { | ||
if (propName == null || !holder) return holder; | ||
@@ -20,3 +20,4 @@ var propParts = Array.isArray(propName) ? propName : (propName + '').split('.'); | ||
} | ||
return result; | ||
}; |
@@ -0,0 +0,0 @@ Copyright 2019 Dmitry Ivanov |
{ | ||
"name": "dotprop", | ||
"version": "1.2.1", | ||
"version": "2.0.0", | ||
"description": "Get property value by dot notation", | ||
@@ -9,2 +9,3 @@ "main": "index.js", | ||
}, | ||
"type": "module", | ||
"files": [ | ||
@@ -11,0 +12,0 @@ "index.js" |
@@ -1,2 +0,2 @@ | ||
# dotprop [![Build Status](https://travis-ci.org/dy/dotprop.svg?branch=master)](https://travis-ci.org/dy/dotprop) | ||
# dotprop [![test](https://github.com/dy/dotprop/actions/workflows/node.js.yml/badge.svg)](https://github.com/dy/dotprop/actions/workflows/node.js.yml) | ||
@@ -7,3 +7,3 @@ Get property by dot notation. | ||
```js | ||
var getProp = require('dotprop'); | ||
import getProp from 'dotprop'; | ||
@@ -21,6 +21,8 @@ getProp({a: { b: { c: 1}} }, 'a.b.c') // 1 | ||
* [sindresohrus/dot-prop](https://github.com/sindresorhus/dot-prop) - enables escaping `\.` at price of larger codebase | ||
* [developit/dlv](https://github.com/developit/dlv) | ||
* [developit/dlv](https://github.com/developit/dlv) – the most compact alternative. | ||
* [sindresohrus/dot-prop](https://github.com/sindresorhus/dot-prop) - enables escaping `\.` at price of larger codebase. | ||
* [facebookindicator/idx](https://github.com/facebookincubator/idx) | ||
[![NPM](https://nodei.co/npm/dotprop.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/dotprop/) | ||
<p align=center><a href="https://github.com/krishnized/license/">🕉</a></p> |
3533
27
Yes