# jungles-types

> Combines the datalayer and validators for jungles

Latest version **1.3.0** (published 2013-06-15) · 0 weekly downloads

## Install

```sh
npm install jungles-types
pnpm add jungles-types
yarn add jungles-types
bun add jungles-types
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2013-06-15 |
| First published | 2013-02-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Geert Pasteels |
| Maintainers | enome |
| Keywords | jungles, validation, validators, data |

## Links

- npm: https://www.npmjs.com/package/jungles-types
- npm.io page: https://npm.io/package/jungles-types

## Dependencies (4)

- [async](https://npm.io/package/async.md) ~0.2.3
- [underscore](https://npm.io/package/underscore.md) ~1.4.4
- [jungles-validation](https://npm.io/package/jungles-validation.md) *
- [jungles-validators](https://npm.io/package/jungles-validators.md) *

## Alternatives

- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads
- [@oridune/validator](https://npm.io/package/@oridune/validator.md) — 16 weekly downloads

## Recent versions

- 1.3.0 (latest) — 2013-06-15
- 1.2.2 — 2013-04-21
- 1.2.1 — 2013-04-21
- 1.2.0 — 2013-04-04
- 1.1.1 — 2013-02-07
- 1.1.0 — 2013-02-06
- 1.0.0 — 2013-02-06

## README

# Types

This module puts the validation layer infront of data.create, data.update and data.copy. So you don't always have to manually call validate when updating or creating data. 

## Create

```js
var dal = require('jungles-data-memory')([]);
var settings = [ /* array with your types and schemas */ ];

var t = types(settings, dal).create({ name: 'snowboard', type: 'product' });

t.success(function (response) {
  // response is the created object
});

t.error(function (errors) {
  // errors are validation errors
});
```

## Update

```js
var dal = require('jungles-data-memory')([]);
var settings = [ /* array with your types and schemas */ ];
var t = types(settings, dal).update({ path '/snowboard', name: 'skateboard' });

t.success(function (response) {
  // response is the updated object(s)
});

t.error(function (errors) {
  // errors are validation errors
});
```

## Copy

```js
var dal = require('jungles-data-memory')([]);
var settings = [ /* array with your types and schemas */ ];
var t = types(settings, dal).copy({ path: '/snowboard', parent: '/' });

t.success(function (response) {
  // response is the created object(s)
});

t.error(function (errors) {
  // errors are validation errors
});
```

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