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

quotifier

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quotifier

Functions to recursively add and remove quotes to strings inside objects or arrays

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

quotifier

Functions to recursively add and remove quotes to strings inside objects or arrays.

Usage

import { quotifier, unquotifier } from 'quotifier';

const withQuotes = quotifier({       // {
  myVariable: 'production',          //   myVariable: '"production"',
});                                  // }

const withoutQuotes = unquotifier([  // [
  '"production"',                    //  'production',
]);                                  // ]

// it will also do this recursively inside the object or array that it is given:

const deeperQuotes = quotifier({     // {
  myVariable: [                      //   myVariable: [
    'production',                    //     '"production"',
    {                                //     {
      'other-variable': [ 'yeah' ],  //       'other-variable': [ '"yeah"' ],
    }                                //     },
  ],                                 //   ],
  'JustBecause?': 'yup',             //   'JustBecause?': '"yup"',
});                                  // }

Why I use it

To define variables for Webpack.DefinePlugin and then re-use that code to to test the components/scripts that use those variables defined by the plugin.

Known limitations

Does not deal with any other data types aside from objects, arrays and strings... yet.

FAQs

Package last updated on 15 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