New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

smapper

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smapper - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "smapper",
"version": "0.0.1",
"version": "0.0.2",
"author": "David Arenas (davejs136@gmail.com)",

@@ -5,0 +5,0 @@ "description": "Mapper function to transform the Strapi API response",

@@ -5,3 +5,2 @@ # Smapper

[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]

@@ -41,2 +40,38 @@

We have a graphql like this:
```graphql
query Posts {
posts {
data {
attributes {
title
content
slug
images {
data {
id
attributes {
name
formats
url
}
}
}
}
}
}
}
```
And you want remove the data and attributes wrappers, just call the function imported and pass the graphql result as parameter:
```javascript
import mapper from 'smapper';
import GetPost from './graphql';
const response = await graphql(GetPost);
const mapped = mapper(response);
```
## Development

@@ -67,5 +102,3 @@

[npm-downloads-href]: https://npmjs.com/package/smapper
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/smapper/main?style=flat&colorA=007ec6&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/smapper
[license-src]: https://img.shields.io/github/license/unjs/smapper.svg?style=flat&colorA=007ec6&colorB=F0DB4F
[license-href]: https://github.com/unjs/smapper/blob/main/LICENSE
[license-href]: https://github.com/Dave136/smapper/blob/main/README.md
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