You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

json-placeholder-replacer

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-placeholder-replacer - npm Package Compare versions

Comparing version

to
2.0.3

2

package.json
{
"name": "json-placeholder-replacer",
"version": "2.0.1",
"version": "2.0.3",
"description": "Javascript/Typescript library/cli to replace placeholders in an javascript object",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -21,5 +21,3 @@ # jsonPlaceholderReplacer

```shell
json-placeholder-replacer [replaceable.json](/rep) [variable.map](/map)
```
$ json-placeholder-replacer [replaceable.json](/rep) [variable.map](/map)

@@ -49,4 +47,2 @@ ### Would result

As simples as:
```typescript

@@ -129,4 +125,6 @@ import { JsonPlaceholderReplacer } from "json-placeholder-replacer";

### It keeps original variable types. So, if, in the map, a variable is boolean/string/number/object when it's replaced, it remains as boolean/string/number/object
### It keeps original variable types
If a variable in the map is boolean/string/number/object, it remains as boolean/string/number/object when it's replaced
```typescript

@@ -235,3 +233,3 @@ placeHolderReplacer.addVariableMap({

const afterReplace: any = placeHolderReplacer.replace({
replaceable: "<<not-found-key=default-value>>", // Note the ':=:'
replaceable: "<<not-found-key:=:default-value>>", // Note the ':=:'
});

@@ -238,0 +236,0 @@

Sorry, the diff of this file is not supported yet