# safer-object

> Flattened objects with non configurable, and non writable fields.

Latest version **0.2.1** (published 2019-06-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install safer-object
pnpm add safer-object
yarn add safer-object
bun add safer-object
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-06-03 |
| First published | 2019-05-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Andrea Giammarchi |
| Maintainers | webreflection |
| Keywords | secure, function, call, apply, bind |

## Links

- npm: https://www.npmjs.com/package/safer-object
- Repository: https://github.com/WebReflection/safer-object
- Homepage: https://github.com/WebReflection/safer-object#readme
- Issues: https://github.com/WebReflection/safer-object/issues
- npm.io page: https://npm.io/package/safer-object

## Dependencies (1)

- [safer-function](https://npm.io/package/safer-function.md) ^0.1.2

## Recent versions

- 0.2.1 (latest) — 2019-06-03
- 0.2.0 — 2019-05-16
- 0.1.0 — 2019-05-15
- 0.0.0 — 2019-05-15

## README

# safer-object

<sup>**Social Media Photo by [freestocks.org](https://unsplash.com/@freestocks) on [Unsplash](https://unsplash.com/)**</sup>

[![Build Status](https://travis-ci.com/WebReflection/safer-object.svg?branch=master)](https://travis-ci.com/WebReflection/safer-object) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/safer-object/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/safer-promise?branch=master) ![WebReflection status](https://offline.report/status/webreflection.svg)

Flattened objects with non configurable, and non writable fields (i.e. to freeze prototypes).

```js
const obj = saferObject({
  __proto__: {
    name: 'shadowed',
    parent: 'super'
  },
  name: 'test'
});

obj.name = 'nope';
obj.parent = {nope: true};

console.assert(obj.name === 'test');
console.assert(obj.parent === 'super');
console.assert(obj.hasOwnProperty('parent'));
console.assert(obj.hasOwnProperty('hasOwnProperty'));
```

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