New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lulo-plugin-json-to-string

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lulo-plugin-json-to-string

lulo json-to-string is a plugin for [lulo](https://github.com/carlnordenfelt/lulo).

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

lulo JSON to String

lulo json-to-string is a plugin for lulo.

Returns a string representation of the provided JSON structure.

Installation

$ npm install lulo-plugin-json-to-string --save

Usage

Properties

  • JSON: The original JSON structure. Required.
  • TypeCast: Attempts to cast primitive types back to their original type. See more on type casting below.

Return Values

The resource will return a string representation of the provided JSON structure which can be accessed via "Fn::GetAtt".

Parameters

{ "Fn::GetAtt: ["ResourceName", "String"] }" Gives The JSON structure as a string

Required IAM Permissions

The Custom Resource Lambda requires no additional IAM Permissions.

License

The MIT License (MIT)

Change Log

Change Log

Type Casting

CloudFormation has a tendency to convert all properties to strings before giving them to a CustomResource.

In a nutshell this means that:

// Input
{
    "JSON": {
        "anInteger": 1
    }
}

// Becomes:
{
    "JSON": {
        "anInteger": "1"
    }
}

This oftentimes becomes a problem since a lot of AWS sdk calls does not accept "1" in place of 1 for an integer value.

If you provide the TypeCast property it will attempt to cast all primitives type back to their original type.

In other words:

'1' => 1
'1.1' => 1.1
'true' => true,
'false' => false

This works recursively as well as on arrays.

Note: The type casting is very eager and will cast anything it finds that matches a given regex (see src/index.js). There is no way to make exceptions from this.

Keywords

AWS

FAQs

Package last updated on 17 Nov 2017

Did you know?

Socket

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