@truto/replace-placeholders 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +3 -4
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -15,8 +15,8 @@ npm install @truto/replace-placeholders
15
15
  ```javascript
16
16
  import replacePlaceholders from '@truto/replace-placeholders';
17
17
 
18
- const result = replacePlaceholders('{{foo}}', { foo: 'bar' });
19
- console.log(result); // Outputs: 'bar'
18
+ const result = replacePlaceholders('Foo: {{foo}}', { foo: 'bar' });
19
+ console.log(result); // Outputs: 'Foo: bar'
20
20
  ```
21
21
 
22
22
  ### Advanced Usage with Different Data Types
@@ -32,7 +32,7 @@ console.log(replacePlaceholders('{{foo}} {{bar:bool}}', { foo: 'bar', bar: 'fals
32
32
  #### Arrays
33
33
 
34
34
  ```javascript
35
- console.log(replacePlaceholders(['{{foo}}'], { foo: 'bar' })); // Outputs: ['bar']
35
+ console.log(replacePlaceholders(['Foo: {{foo}}'], { foo: 'bar' })); // Outputs: ['Foo: bar']
36
36
  console.log(replacePlaceholders(['{{foo}}', '{{bar:num}}'], { foo: 'bar', bar: '1.34' })); // Outputs: ['bar', 1.34]
37
37
  ```
38
38
 
@@ -51,7 +51,6 @@ console.log(replacePlaceholders('{{foo:num}}', { foo: '1.1' })); // Outputs: 1.
51
51
  console.log(replacePlaceholders('{{foo:bool}}', { foo: 'true' })); // Outputs: true
52
52
  console.log(replacePlaceholders('{{foo:json}}', { foo: '{"foo":"bar"}' })); // Outputs: { foo: 'bar' }
53
53
  console.log(replacePlaceholders('{{foo:null}}', { foo: 'null' })); // Outputs: null
54
- // ... add other examples ...
55
54
  ```
56
55
 
57
56
  ### Conditional Replacements (Fallback Values)
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@truto/replace-placeholders",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Efficiently replace placeholders in strings, arrays, and objects using data from specified paths. Powered by 'wild-wild-path' and 'lodash' for robust functionality.",
5
5
  "repository": "https://github.com/trutohq/replace-placeholders.git",
6
6
  "dependencies": {
7
- "wild-wild-path": "4.0.0",
8
7
  "lodash-es": "4.17.21",
9
- "traverse": "0.6.7"
8
+ "traverse": "0.6.7",
9
+ "wild-wild-path": "4.0.0"
10
10
  },
11
11
  "source": "index.ts",
12
12
  "main": "dist/main.cjs",