https://github.com/guseyn/cutie-object
Cutie extension for working with Object in JavaScript.
https://github.com/guseyn/cutie-object
Last synced: 13 days ago
JSON representation
Cutie extension for working with Object in JavaScript.
- Host: GitHub
- URL: https://github.com/guseyn/cutie-object
- Owner: Guseyn
- License: mit
- Created: 2018-05-27T08:15:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T16:02:02.000Z (over 4 years ago)
- Last Synced: 2025-06-06T05:39:37.737Z (about 1 year ago)
- Language: JavaScript
- Size: 112 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cutie-object
[](https://npmjs.org/package/@cuties/object)
[](https://travis-ci.org/Guseyn/cutie-object)
[](https://codecov.io/gh/Guseyn/cutie-object)
[Cutie](https://github.com/Guseyn/cutie) extension for work with Object in JavaScript. It's based on the [Async Tree Pattern](https://github.com/Guseyn/async-tree-patern/blob/master/Async_Tree_Patern.pdf).
## Examples
You can find examples of using this library in the [test directory](https://github.com/Guseyn/cutie-object/tree/master/test).
## Install
`npm install @cuties/object`
## Run test
`npm test`
## Run build
`npm run build`
## Usage
```js
const {
// Needed async objects here from the table below
} = require('@cuties/object');
```
For more information about parameters in the async objects visit [MDN docs for Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object).
| Async Object | Async/sync call | Parameters(default value/description) | Representation result |
| ------------- | ----------------| ---------- | --------------------- |
| `AreObjectsEqual` | `Object.is` | `obj1, obj2` | `boolean` |
| `AssignedObject` | `Object.assign` | `target, ...sources` | `object` |
| `CreatedObject` | `Object.create` | `proto, propertiesObject` | `object` |
| `CreatedOptions` | [syncCall](https://github.com/Guseyn/cutie-object/blob/master/src/CreatedOptions.js#L12) | `key1, value1, key2, value2, ...` | `{ key1: value1, key2: value2, ... }` |
| `FrozenObject` | `Object.freeze` | `obj` | `obj` |
| `HasOwnProperty` | `obj.hasOwnProperty` | `obj, prop` | `boolean` |
| `IsExtensible` | `Object.isExtensible` | `obj` | `boolean` |
| `IsFrozen` | `Object.isFrozen` | `obj` | `boolean` |
| `IsPrototypeEnumerable` | `obj.propertyIsEnumerable` | `obj, prop` | `boolean` |
| `IsPrototypeOf` | `prototypeObj.isPrototypeOf` | `prototypeObj, obj` | `boolean` |
| `IsSealed` | `Object.isSealed` | `obj` | `boolean` |
| `Keys` | `Object.keys` | `obj` | `string[]` |
| `LocaleStringFrom` | `obj.toLocaleString` | `obj` | `string` |
| `NotExtensibleObject` | `Object.preventExtensions` | `obj` | `obj` |
| `ObjectWithDefinedProperties` | `Object.defineProperties` | `obj, props` | `obj` |
| `ObjectWithDefinedProperty` | `Object.defineProperty` | `obj, prop, descriptor` | `obj` |
| `ObjectWithPrototypeOf` | `Object.setPrototypeOf` | `obj, prototype` | `obj` |
| `ObjectWithValue` | `Object.assign({}, obj)[key] = value` | `obj, key, value` | `obj` |
| `OwnPropertyDescriptor` | `Object.getOwnPropertyDescriptor` | `obj, prop` | `obj` |
| `OwnPropertyNames` | `Object.getOwnPropertyNames` | `obj, prop` | `string[]` |
| `OwnPropertySymbols` | `Object.getOwnPropertySymbols` | `obj` | `string[]` |
| `ProcessedObject` | [processedObject](https://github.com/Guseyn/cutie-object/blob/master/src/Keys.js) | `obj, iterator, ...additionalArgs` | `obj` |
| `PrototypeOf` | `Object.getPrototypeOf` | `obj` | `prototype` |
| `SealedObject` | `Object.seal` | `obj` | `obj` |
| `StringFrom` | `obj.toString` | `obj` | `string` |
| `ObjectWithValue` | `obj[key] = value` | `obj, key, value` | `obj` |
| `Value` | `obj[key]` | `obj, key` | `value` |
| `ValueOf` | `obj.valueOf` | `obj` | `value` |
| `Values` | `Object.values` | `obj` | `string[]` |