# pacc

> property path utils

Latest version **11.17.4** (published 2026-09-23) · 0BSD license · 0 weekly downloads

## Install

```sh
npm install pacc
pnpm add pacc
yarn add pacc
bun add pacc
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 11.17.4 |
| Published | 2026-09-23 |
| First published | 2023-11-02 |
| Weekly downloads | 0 |
| License | 0BSD |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=26.8.1 |
| Dependencies | 0 |
| Unpacked size | 131.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Maintainers | arlac77 |
| Keywords | attributes, filtering, pratt, property path, xpath |

## Links

- npm: https://www.npmjs.com/package/pacc
- Repository: https://github.com/arlac77/pacc
- Homepage: https://github.com/arlac77/pacc#readme
- Issues: https://github.com/arlac77/pacc/issues
- npm.io page: https://npm.io/package/pacc

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 11.17.4 (latest) — 2026-09-23
- 11.17.3 — 2026-09-23
- 11.17.2 — 2026-09-22
- 11.17.1 — 2026-09-21
- 11.17.0 — 2026-09-21
- 11.16.0 — 2026-09-20
- 11.15.0 — 2026-09-19
- 11.14.0 — 2026-09-19
- 11.13.2 — 2026-09-17
- 11.13.1 — 2026-09-17
- 11.13.0 — 2026-09-16
- 11.12.6 — 2026-09-16
- 11.12.5 — 2026-09-16
- 11.12.4 — 2026-09-16
- 11.12.3 — 2026-09-14
- … 294 more at https://npm.io/package/pacc/versions

## README

[![npm](https://img.shields.io/npm/v/pacc.svg)](https://www.npmjs.com/package/pacc)
[![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
[![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
[![bundlejs](https://deno.bundlejs.com/?q=pacc\&badge=detailed)](https://bundlejs.com/?q=pacc)
[![downloads](http://img.shields.io/npm/dm/pacc.svg?style=flat-square)](https://npmjs.org/package/pacc)
[![GitHub Issues](https://img.shields.io/github/issues/arlac77/pacc.svg?style=flat-square)](https://github.com/arlac77/pacc/issues)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Fpacc%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/pacc/goto)
[![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Known Vulnerabilities](https://snyk.io/test/github/arlac77/pacc/badge.svg)](https://snyk.io/test/github/arlac77/pacc)

# pacc

propetty path utils

```js
import { getAttribute, expand } from "pacc";

const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
// result === 4

const result = expand("${a + 1}",{ current: { a: 2 }});
// result === 3

```

# Benchmark

benchmark                                     avg (min … max) p75 / p99    (min … top 1%)

***

"\[n<5].l"                                        1.17 µs/iter   1.67 µs █
(833.64 ns … 2.47 µs)   2.42 µs █
(281.78  b …   3.28 kb)   3.01 kb █▇▂▁▃▂▁▁▁▁▁▃▂▄▄▂▂▁▁▂▁
4.72 ipc (  2.55% stalls)  98.55% L1 data cache
3.75k cycles  17.68k instructions  39.84% retired LD/ST (  7.04k)

parse a.b.c.d.e.f.g.h.i.j.k.l.m.n                2.96 µs/iter   3.25 µs ▂█▂             ▅
(2.60 µs … 3.44 µs)   3.41 µs ███▅▅          ▅█▂▂▂▂
(  6.10 kb …   6.11 kb)   6.10 kb █████▄▁▁▁▁▁▁▄▄▁██████
5.09 ipc (  2.02% stalls)  99.10% L1 data cache
9.40k cycles  47.87k instructions  40.50% retired LD/ST ( 19.38k)

parseOnly a.b.c.d.e.f.g.h.i.j.k.l.m.n            2.51 µs/iter   2.85 µs █
(2.18 µs … 3.36 µs)   3.35 µs █▆
(  4.54 kb …   5.43 kb)   5.41 kb ██▄▄▂▁▁▁▁▃▂█▇█▂▁▂▁▂▁▂
5.12 ipc (  2.18% stalls)  98.98% L1 data cache
8.05k cycles  41.20k instructions  40.73% retired LD/ST ( 16.78k)

tokens a.b.c.d.e.f.g.h.i.j.k.l.m.n               1.66 µs/iter   1.68 µs  ▆ █▄   ▃
(1.61 µs … 1.75 µs)   1.74 µs ▅█▄██▄  █▂     ▂▅
(  4.41 kb …   4.42 kb)   4.41 kb ██████▅▁██▃▅▃▆▆██▃▃▁▆
5.67 ipc (  2.53% stalls)  99.12% L1 data cache
5.32k cycles  30.18k instructions  40.68% retired LD/ST ( 12.27k)

tokens "abc" "
" "abcdefghijklmnopqrstuvwxyz"   1.23 µs/iter   1.12 µs █
(1.02 µs … 2.23 µs)   1.85 µs █▆
(  2.52 kb …   4.17 kb)   3.43 kb ███▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▇▄▃
6.02 ipc (  2.26% stalls)  99.24% L1 data cache
3.94k cycles  23.72k instructions  39.67% retired LD/ST (  9.41k)

# API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

*   [AST](#ast)
    *   [Properties](#properties)
*   [prepareAttributesDefinitions](#prepareattributesdefinitions)
    *   [Parameters](#parameters)
*   [mergeAttributeDefinitions](#mergeattributedefinitions)
    *   [Parameters](#parameters-1)
*   [attributeIterator](#attributeiterator)
    *   [Parameters](#parameters-2)
*   [extendingAttributeIterator](#extendingattributeiterator)
    *   [Parameters](#parameters-3)
*   [parseBytes](#parsebytes)
    *   [Parameters](#parameters-4)
*   [AttributeDefinition](#attributedefinition)
    *   [Properties](#properties-1)
*   [default\_attribute](#default_attribute)
*   [default\_attribute\_writable](#default_attribute_writable)
*   [default\_collection\_attribute](#default_collection_attribute)
*   [default\_collection\_attribute\_writable](#default_collection_attribute_writable)
*   [string\_attribute](#string_attribute)
*   [string\_attribute\_writable](#string_attribute_writable)
*   [enum\_string\_attribute](#enum_string_attribute)
*   [enum\_string\_attribute\_writable](#enum_string_attribute_writable)
*   [string\_collection\_attribute](#string_collection_attribute)
*   [string\_collection\_attribute\_writable](#string_collection_attribute_writable)
*   [string\_set\_attribute](#string_set_attribute)
*   [string\_set\_attribute\_writable](#string_set_attribute_writable)
*   [name\_attribute](#name_attribute)
*   [name\_attribute\_writable](#name_attribute_writable)
*   [email\_attribute](#email_attribute)
*   [version\_attribute](#version_attribute)
*   [version\_attribute\_writable](#version_attribute_writable)
*   [description\_attribute](#description_attribute)
*   [type\_attribute](#type_attribute)
*   [type\_attribute\_writable](#type_attribute_writable)
*   [state\_attribute\_writable](#state_attribute_writable)
*   [boolean\_attribute](#boolean_attribute)
*   [boolean\_attribute\_writable](#boolean_attribute_writable)
*   [boolean\_attribute\_writable\_true](#boolean_attribute_writable_true)
*   [boolean\_attribute\_writable\_false](#boolean_attribute_writable_false)
*   [boolean\_attribute\_false](#boolean_attribute_false)
*   [active\_attribute](#active_attribute)
*   [yesno\_attribute](#yesno_attribute)
*   [empty\_attribute](#empty_attribute)
*   [uuid\_attribute](#uuid_attribute)
*   [secret\_attribute](#secret_attribute)
*   [secret\_attribute](#secret_attribute-1)
*   [secret\_attribute\_writable](#secret_attribute_writable)
*   [username\_attribute](#username_attribute)
*   [password\_attribute](#password_attribute)
*   [token\_attribute](#token_attribute)
*   [private\_key\_attribute](#private_key_attribute)
*   [public\_key\_attribute](#public_key_attribute)
*   [number\_attribute](#number_attribute)
*   [number\_attribute\_writable](#number_attribute_writable)
*   [integer\_attribute](#integer_attribute)
*   [integer\_attribute](#integer_attribute-1)
*   [integer\_attribute\_writable](#integer_attribute_writable)
*   [integer\_attribute\_writable](#integer_attribute_writable-1)
*   [size\_attribute](#size_attribute)
*   [object\_attribute](#object_attribute)
*   [object\_attribute\_writable](#object_attribute_writable)
*   [url\_attribute](#url_attribute)
*   [url\_attribute\_writable](#url_attribute_writable)
*   [hostname\_attribute](#hostname_attribute)
*   [port\_attribute](#port_attribute)
*   [port\_attribute\_writable](#port_attribute_writable)
*   [id\_attribute](#id_attribute)
*   [body\_attribute\_writable](#body_attribute_writable)
*   [title\_attribute\_writable](#title_attribute_writable)
*   [priority\_attribute](#priority_attribute)
*   [priority\_attribute](#priority_attribute-1)
*   [duration\_attribute](#duration_attribute)
*   [duration\_attribute\_writable](#duration_attribute_writable)
*   [duration\_ms\_attribute](#duration_ms_attribute)
*   [timeout\_attribute](#timeout_attribute)
*   [language\_attribute](#language_attribute)
*   [environmentValues](#environmentvalues)
    *   [Parameters](#parameters-5)
*   [expandContextDefault](#expandcontextdefault)
*   [expandContextDoubbleCurly](#expandcontextdoubblecurly)
*   [expand](#expand)
    *   [Parameters](#parameters-6)
*   [promises](#promises)
*   [filter](#filter)
    *   [Parameters](#parameters-7)
*   [setAttributes](#setattributes)
    *   [Parameters](#parameters-8)
*   [getAttributes](#getattributes)
    *   [Parameters](#parameters-9)
*   [getAttributesJSON](#getattributesjson)
    *   [Parameters](#parameters-10)
*   [tokens](#tokens)
*   [tokens](#tokens-1)
    *   [Parameters](#parameters-11)
*   [setAttribute](#setattribute)
    *   [Parameters](#parameters-12)
*   [getAttribute](#getattribute)
    *   [Parameters](#parameters-13)
*   [getAttributeAndOperator](#getattributeandoperator)
    *   [Parameters](#parameters-14)
*   [parseDuration](#parseduration)
    *   [Parameters](#parameters-15)
*   [formatDuration](#formatduration)
    *   [Parameters](#parameters-16)
*   [formatDurationISO](#formatdurationiso)
    *   [Parameters](#parameters-17)
*   [lookup](#lookup)
*   [Token](#token)
    *   [Properties](#properties-2)
*   [registerToken](#registertoken)
    *   [Parameters](#parameters-18)
*   [createToken](#createtoken)
    *   [Parameters](#parameters-19)
*   [PLUS](#plus)
*   [MINUS](#minus)
*   [STAR](#star)
*   [DIVIDE](#divide)
*   [NOT](#not)
*   [NOT\_EQUAL](#not_equal)
*   [EQUAL](#equal)
*   [GREATER](#greater)
*   [GREATER\_EQUAL](#greater_equal)
*   [LESS](#less)
*   [LESS\_EQUAL](#less_equal)
*   [OPEN\_ROUND](#open_round)
*   [CLOSE\_ROUND](#close_round)
*   [OPEN\_BRACKET](#open_bracket)
*   [CLOSE\_BRACKET](#close_bracket)
*   [OPEN\_CURLY](#open_curly)
*   [CLOSE\_CURLY](#close_curly)
*   [QUESTION](#question)
*   [COLON](#colon)
*   [SEMICOLON](#semicolon)
*   [COMMA](#comma)
*   [DOT](#dot)
*   [AMPERSAND](#ampersand)
*   [DOUBLE\_AMPERSAND](#double_ampersand)
*   [BAR](#bar)
*   [DOUBLE\_BAR](#double_bar)
*   [IDENTIFIER](#identifier)
*   [STRING](#string)
*   [NUMBER](#number)
*   [BOOLEAN](#boolean)
*   [EOF](#eof)
*   [Type](#type)
    *   [Properties](#properties-3)
*   [raiseOnUnknownType](#raiseonunknowntype)
    *   [Parameters](#parameters-20)
*   [create](#create)
    *   [Parameters](#parameters-21)
*   [isExtendingType](#isextendingtype)
    *   [Parameters](#parameters-22)
*   [asArray](#asarray)
    *   [Parameters](#parameters-23)
*   [asIterator](#asiterator)
    *   [Parameters](#parameters-24)
*   [asValueIterator](#asvalueiterator)
    *   [Parameters](#parameters-25)
*   [leafValues](#leafvalues)
    *   [Parameters](#parameters-26)

## AST

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### Properties

*   `eval` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;

## prepareAttributesDefinitions

Create attributes from its definition.

### Parameters

*   `newDefinitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
*   `presentDefinitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** optional merge in attributes

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** attributes

## mergeAttributeDefinitions

Merge attribute definitions.

### Parameters

*   `dest` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** attribute definitions to be used also the merge target
*   `atts` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** attribute definitions to be used

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** merged definitions (dest)

## attributeIterator

Iterate over attributes.

### Parameters

*   `definition` &#x20;
*   `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;
*   `path` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>?**  (optional, default `[]`)
*   `attribute` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** definition

Returns **Iterable<\[[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>, [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)]>**&#x20;

## extendingAttributeIterator

Iterate over all attributes of a type.

### Parameters

*   `type` **[Type](#type)** definition
*   `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;
*   `path` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>?**&#x20;

Returns **Iterable<\[[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>, [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)]>**&#x20;

## parseBytes

Convert byte size formatted string into number of bytes.

### Parameters

*   `value` **([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))**&#x20;

Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** number of total bytes

## AttributeDefinition

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### Properties

*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `type` **[Type](#type)**&#x20;
*   `key` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** are we an identifying attribute
*   `writable` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** can this attribute be modified
*   `mandatory` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
*   `collection` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** are we a collection (set, map, array, iterator, object)
*   `deferredExpression` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** are we a pacc expression to be evaluated
*   `private` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** should the value be shown
*   `credential` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** are we any type of credential
*   `persistent` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** should we be stored (especially critical for credentials)
*   `skipEmpty` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** do not write empty attribute values at all
*   `backpointer` **[AttributeDefinition](#attributedefinition)?**&#x20;
*   `constructor` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** (collection) constructor
*   `depends` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of an attribute we depend on
*   `description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** human readable
*   `default` **any?** the default value
*   `toInternal` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;
*   `toExternal` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;
*   `asMapEntry` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** deliver key and value for Map insertion
*   `externalName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** attribute name used by external system
*   `scope` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** where to apply value
*   `values` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\<any>?** allowed values
*   `env` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))?** environment variable(s) used to provide the value
*   `additionalValues` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** other values to be set in case our attribute is set
*   `separator` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** separator for string collections
*   `set` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** deprecated set the value
*   `get` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** deprecated get the value can be used to calculate default values

## default\_attribute

Common attribute properties.

Type: [AttributeDefinition](#attributedefinition)

## default\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## default\_collection\_attribute

Type: [AttributeDefinition](#attributedefinition)

## default\_collection\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## string\_attribute

Type: [AttributeDefinition](#attributedefinition)

## string\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## enum\_string\_attribute

Type: [AttributeDefinition](#attributedefinition)

## enum\_string\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## string\_collection\_attribute

Type: [AttributeDefinition](#attributedefinition)

## string\_collection\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## string\_set\_attribute

Type: [AttributeDefinition](#attributedefinition)

## string\_set\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## name\_attribute

Type: [AttributeDefinition](#attributedefinition)

## name\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## email\_attribute

Type: [AttributeDefinition](#attributedefinition)

## version\_attribute

Type: [AttributeDefinition](#attributedefinition)

## version\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## description\_attribute

The description of the object content.

Type: [AttributeDefinition](#attributedefinition)

## type\_attribute

Type: [AttributeDefinition](#attributedefinition)

## type\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## state\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## boolean\_attribute

Type: [AttributeDefinition](#attributedefinition)

## boolean\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## boolean\_attribute\_writable\_true

Type: [AttributeDefinition](#attributedefinition)

## boolean\_attribute\_writable\_false

Type: [AttributeDefinition](#attributedefinition)

## boolean\_attribute\_false

Type: [AttributeDefinition](#attributedefinition)

## active\_attribute

Type: [AttributeDefinition](#attributedefinition)

## yesno\_attribute

Type: [AttributeDefinition](#attributedefinition)

## empty\_attribute

Type: [AttributeDefinition](#attributedefinition)

## uuid\_attribute

Type: [AttributeDefinition](#attributedefinition)

## secret\_attribute

Type: [AttributeDefinition](#attributedefinition)

## secret\_attribute

Type: [AttributeDefinition](#attributedefinition)

## secret\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## username\_attribute

Type: [AttributeDefinition](#attributedefinition)

## password\_attribute

Type: [AttributeDefinition](#attributedefinition)

## token\_attribute

Type: [AttributeDefinition](#attributedefinition)

## private\_key\_attribute

Type: [AttributeDefinition](#attributedefinition)

## public\_key\_attribute

Type: [AttributeDefinition](#attributedefinition)

## number\_attribute

Type: [AttributeDefinition](#attributedefinition)

## number\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## integer\_attribute

Type: [AttributeDefinition](#attributedefinition)

## integer\_attribute

Type: [AttributeDefinition](#attributedefinition)

## integer\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## integer\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## size\_attribute

Type: [AttributeDefinition](#attributedefinition)

## object\_attribute

Type: [AttributeDefinition](#attributedefinition)

## object\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## url\_attribute

Type: [AttributeDefinition](#attributedefinition)

## url\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## hostname\_attribute

Type: [AttributeDefinition](#attributedefinition)

## port\_attribute

Type: [AttributeDefinition](#attributedefinition)

## port\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## id\_attribute

Unique id within.

Type: [AttributeDefinition](#attributedefinition)

## body\_attribute\_writable

The body text.

Type: [AttributeDefinition](#attributedefinition)

## title\_attribute\_writable

The one line description.

Type: [AttributeDefinition](#attributedefinition)

## priority\_attribute

In case there are several providers able to support a given source which one sould be used ?
this defines the order.

Type: [AttributeDefinition](#attributedefinition)

## priority\_attribute

Type: [AttributeDefinition](#attributedefinition)

## duration\_attribute

Duration in seconds.

Type: [AttributeDefinition](#attributedefinition)

## duration\_attribute\_writable

Type: [AttributeDefinition](#attributedefinition)

## duration\_ms\_attribute

Type: [AttributeDefinition](#attributedefinition)

## timeout\_attribute

Type: [AttributeDefinition](#attributedefinition)

## language\_attribute

Type: [AttributeDefinition](#attributedefinition)

## environmentValues

Extract values from environment.

### Parameters

*   `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as from process.env
*   `attributes` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as from process.env
*   `instanceIdentifier` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** part of variable name.

Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** undefined if no suitable environment variables have been found

## expandContextDefault

Default expand context
using '§{' and '}' as lead in/out

## expandContextDoubbleCurly

Expand context with doubble curly separaion '{{' '}}'

## expand

Expand expressions inside of object graphs.

### Parameters

*   `object` **any**&#x20;
*   `context` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

    *   `context.root` **any?** actual replacement values
    *   `context.current` **any?** actual replacement values
    *   `context.stopClass` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** do not expand instanceof
    *   `context.leadIn` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** starting separator
    *   `context.leadOut` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** ending separator

Returns **(any | [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<any>)**&#x20;

## promises

Type: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<any>>

## filter

Generate filter function.

### Parameters

*   `filterBy` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**&#x20;

Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**&#x20;

## setAttributes

Copies attribute values from a source object into a destination object.

### Parameters

*   `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** target object to be modified
*   `source` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** origin of the data to be copied
*   `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** attribute definitions to be used
*   `cb` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** callback to be executed for each copied value

## getAttributes

Retrive attribute values from an object.

### Parameters

*   `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** attribute value source
*   `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
*   `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** values

## getAttributesJSON

Retrive attribute values from an object.

### Parameters

*   `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** attribute value source
*   `definitions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
*   `filter` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** values

## tokens

## tokens

Split expression path into tokens.

### Parameters

*   `string` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `context` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

## setAttribute

Set object attribute.
The name may be a property path like 'a.b.c'.

### Parameters

*   `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
*   `expression` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `value` **any**&#x20;
*   `definition` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** type def

## getAttribute

Deliver attribute value.
The name may be a property path like 'a.b.c' or a\[2]

### Parameters

*   `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
*   `expression` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `definition` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**&#x20;

Returns **any** value associated with the given property name

## getAttributeAndOperator

Deliver attribute value and operator.
The name may be a property path like 'a.b.c <='.

### Parameters

*   `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
*   `expression` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;

Returns **\[any, [Token](#token)]** value associated with the given property name

## parseDuration

Convert duration formatted string into number of seconds.

### Parameters

*   `value` **([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))**&#x20;

Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** seconds

## formatDuration

### Parameters

*   `seconds` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** formatted duration

## formatDurationISO

### Parameters

*   `seconds` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** formatted duration

## lookup

Token lookup

## Token

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### Properties

*   `str` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `precedence` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;
*   `led` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**&#x20;
*   `nud` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**&#x20;

## registerToken

### Parameters

*   `token` **[Token](#token)**&#x20;

## createToken

### Parameters

*   `str` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `precedence` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**  (optional, default `0`)
*   `ledType` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**  (optional, default `PREFIX`)
*   `led` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**  (optional, default `(parser,node,value)=>node`)
*   `nud`   (optional, default `parser=>this`)

Returns **[Token](#token)**&#x20;

## PLUS

Type: [Token](#token)

## MINUS

Type: [Token](#token)

## STAR

Type: [Token](#token)

## DIVIDE

Type: [Token](#token)

## NOT

Type: [Token](#token)

## NOT\_EQUAL

Type: [Token](#token)

## EQUAL

Type: [Token](#token)

## GREATER

Type: [Token](#token)

## GREATER\_EQUAL

Type: [Token](#token)

## LESS

Type: [Token](#token)

## LESS\_EQUAL

Type: [Token](#token)

## OPEN\_ROUND

Type: [Token](#token)

## CLOSE\_ROUND

Type: [Token](#token)

## OPEN\_BRACKET

Type: [Token](#token)

## CLOSE\_BRACKET

Type: [Token](#token)

## OPEN\_CURLY

Type: [Token](#token)

## CLOSE\_CURLY

Type: [Token](#token)

## QUESTION

Type: [Token](#token)

## COLON

Type: [Token](#token)

## SEMICOLON

Type: [Token](#token)

## COMMA

Type: [Token](#token)

## DOT

Type: [Token](#token)

## AMPERSAND

Type: [Token](#token)

## DOUBLE\_AMPERSAND

Type: [Token](#token)

## BAR

Type: [Token](#token)

## DOUBLE\_BAR

Type: [Token](#token)

## IDENTIFIER

Type: [Token](#token)

## STRING

Type: [Token](#token)

## NUMBER

Type: [Token](#token)

## BOOLEAN

Type: [Token](#token)

## EOF

Type: [Token](#token)

## Type

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### Properties

*   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
*   `primitive` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**&#x20;
*   `extends` **[Type](#type)?**&#x20;
*   `members` **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)<[Type](#type)>?**&#x20;
*   `clazz` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;
*   `toInternal` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;
*   `toExternal` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**&#x20;

## raiseOnUnknownType

Throw if type is not known.

### Parameters

*   `type` **([Type](#type) | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))**&#x20;
*   `origin` **any**&#x20;

Returns **[Type](#type)**&#x20;

## create

Create object for a given type

### Parameters

*   `type` **[Type](#type)**&#x20;
*   `owner` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
*   `data` **any**&#x20;

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** newly created object

## isExtendingType

Is a type extending another one

### Parameters

*   `a` **[Type](#type)**&#x20;
*   `b` **[Type](#type)**&#x20;

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if a is extending b (or a is b)

## asArray

Convert scalar or iterable into an array.
The value undefined will be represented as an empty array.

### Parameters

*   `value` **(Iterable\<any> | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any> | any)**&#x20;

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any>** value encapsulated in an array

## asIterator

### Parameters

*   `value` **any**&#x20;

Returns **Iterable\<any>**&#x20;

## asValueIterator

### Parameters

*   `value` **any**&#x20;

Returns **Iterable\<any>**&#x20;

## leafValues

Walk all leavs

### Parameters

*   `value` **any**&#x20;

Returns **Iterable\<any>**&#x20;

# install

With [npm](http://npmjs.org) do:

```shell
npm install pacc
```

# license

BSD-2-Clause

---
_Source: https://npm.io/package/pacc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
