Socket
Socket
Sign inDemoInstall

metaline

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metaline

A tiny language to write mapping functions as strings


Version published
Weekly downloads
97K
decreased by-24.95%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

metaline

A tiny language to write mapping functions as strings.

Install

npm i metaline

Example syntax

The string where.id.in.$>#id;limit:99 generates the equivalent function of:

function transform (input) {
  return {
    where: {
      id: {
        in: input.map((i) => i.id)
      }
    },
    limit: 99
  }
}

The string $>id.#directoryId generates the equivalent function of:

function transform (input) {
  return input.map((t) => {
    return {
      id: t.directoryId
    }
  })
}

Language Tokens

  • . separate properties in an object
  • $ the input
  • $> loop over the input
  • # access the following input property

License

Apache-2.0

Keywords

FAQs

Last updated on 06 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc