accessor-fn

WebJar for accessor-fn

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

accessor-fn
Last Version

Last Version

1.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

accessor-fn
WebJar for accessor-fn
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/vasturiano/accessor-fn

Download accessor-fn

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/accessor-fn/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>accessor-fn</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/accessor-fn/
implementation 'org.webjars.npm:accessor-fn:1.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/accessor-fn/
implementation ("org.webjars.npm:accessor-fn:1.2.2")
'org.webjars.npm:accessor-fn:jar:1.2.2'
<dependency org="org.webjars.npm" name="accessor-fn" rev="1.2.2">
  <artifact name="accessor-fn" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='accessor-fn', version='1.2.2')
)
libraryDependencies += "org.webjars.npm" % "accessor-fn" % "1.2.2"
[org.webjars.npm/accessor-fn "1.2.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Accessor function

NPM package Build Size Dependencies

A wrapper for property accessors supporting functions, property strings or constant values.

Quick start

import accessorFn from 'accessor-fn';

or

var accessorFn = require('accessor-fn');

or even

<script src="//unpkg.com/accessor-fn"></script>

Usage example

Given an object

var obj = {
    a: 1,
    b: 2
}

Use accessorFn to access object values via property strings or transformation functions:

var aFn = accessorFn('a');
aFn(obj); // 1

var sumFn = accessorFn(d => d.a + d.b);
sumFn(obj); // 3

var constantFn = accessorFn(7);
constantFn(obj); // 7

Versions

Version
1.2.2