Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@goldyjs/natives

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goldyjs/natives - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

.prettierignore

6

@types/object.d.ts

@@ -7,2 +7,8 @@ declare global {

_stringify({ spacing } = { spacing: number }): string
/**
* const obj = { a: 1, b: undefined, c: null }
* obj._compact() -> { a: 1 }
*/
_compact(): string
}

@@ -9,0 +15,0 @@ }

@@ -32,2 +32,8 @@ declare global {

_stringify({ spacing } = { spacing: number }): string
/**
* const obj = { a: 1, b: undefined, c: null }
* obj._compact() -> { a: 1 }
*/
_compact(): string
}

@@ -34,0 +40,0 @@ }

@@ -32,2 +32,8 @@ declare global {

_stringify({ spacing } = { spacing: number }): string
/**
* const obj = { a: 1, b: undefined, c: null }
* obj._compact() -> { a: 1 }
*/
_compact(): string
}

@@ -34,0 +40,0 @@ }

2

package.json
{
"name": "@goldyjs/natives",
"version": "1.0.0",
"version": "1.1.0",
"LICENSE": "MIT",

@@ -5,0 +5,0 @@ "description": "Extending the native JavaScript API",

[![semantic-release: commitizen](https://img.shields.io/badge/semantic--release-commitizen-brightgreen?logo=semantic-release)](https://github.com/semantic-release/semantic-release) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
# Array
```js

@@ -10,1 +11,6 @@ ;[1, 2, 3]._last()

```
# Object
```js
obj._stringify() === JSON.stringify(obj, null, 2)
```

@@ -5,2 +5,4 @@ describe("Natives - object", describeObject)

it("stringify", itStringify)
it("compact", itCompact)
}

@@ -14,3 +16,9 @@

function itCompact() {
const obj = { a: 1, b: undefined, c: null }
expect(obj._compact()).toStrictEqual({ a: 1 })
}
// eslint-disable-next-line jest/no-export
export {}

@@ -14,1 +14,16 @@ import { isDev } from "../utils/env"

})
Object.defineProperty(Object.prototype, "_compact", {
writable: false,
enumerable: false,
configurable: false,
value() {
return Object.entries(this).reduce((acc, [key, value]) => {
if (![null, undefined].includes(value)) {
acc[key] = value
}
return acc
}, {})
},
})

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc