Changelog
All notable changes to this project will be documented in this file.
See Conventional Commits for commit guidelines.
12.0.0
💥 BREAKING CHANGES
- Minimum supported Node version is v14.18; we’re dropping v12 support
11.1.0
✨ Features
11.0.16
🔧 Fixed
- tweak types (5da8102)
11.0.0
✨ Features
- migrate to ES Modules (8c9d95d)
💥 BREAKING CHANGES
- programs now are in ES Modules and won’t work with Common JS
require()
10.1.0
✨ Features
- config file based major bump blacklisting (e15f9bb)
10.0.15
⏪ Reverts
- Revert “chore: setup refresh” (23cf206)
10.0.1
🔧 Fixed
- add
testStats
to npmignore (f3c84e9)
10.0.0
✨ Features
- rewrite in TS, start using named exports (7c3419c)
💥 BREAKING CHANGES
- previously you’d consume like:
import jVar from …
— now:import { jVar } from …
9.0.0
Accidental version bump during migration to SourceHut. Sorry about that.
8.2.0
✨ Features
opts.allowUnresolved
can be supplied as string (ada2a42) — thanks to Thomas Ivall
8.1.0
✨ Features
opts.allowUnresolved
— boolean flag allows to resolve to optionally empty string instead ofthrow
ing — thanks to Thomas Ivall- some rebasing, two dependencies removed (05e9346)
8.0.37
Performance Improvements
- remove check-types-mini which gaves 6x times speed gain (21a1cb0)
7.7.0
- Various documentation and setup tweaks after we migrated to monorepo
- Setup refresh: updated dependencies and all config files using automated tools
7.5.0
- Updated all dependencies
- Restored unit test coverage tracking: reporting in terminal and coveralls.io
- Restored unit test linting
7.4.0
- Two
range-
dependencies have been renamed, namely ranges-push and ranges-apply. We tapped them.
7.3.0
- Migrated to BitBucket (to host repo + perform CI) and Codacy (for code quality audit)
- Dropped BitHound (RIP) and Travis
- Remove
package-lock
7.2.0
- Fixed one edge case where variables were resolving to non-strings and error was thrown.
- Set up prettier and removed
.editorconfig
.
7.1.2
- 🔧 Updated all dependencies again. I was/am tinkering with string-match-left-right and its previous version could have caused
throw
s on certain cases. Sorry about that. Big features are coming soon for compensation 😋.
7.1.0
- Updated all dependencies.
- Fixed some edge-cases where variables could have been wrapped where they shouldn’t have been wrapped and the opposite.
7.0.0
- Full rewrite. Same and more unit tests.
- Variables now can be fetched from the parent nodes, all the way up until root. Priority order: 1. key with variable’s name at the same level; 2. data store at same level; 3. key with variable’s name at parent node’s level; 4. data store at parent’s level … and so on, until root is reached.
- Now the program will pretty much never throw. If you feed incomplete heads or tails, it will leave them unouched rather than throw an error about them. I’ll implement strict mode later.
- Way leaner and efficient algorithm and dependencies’ choice.
- Added more unit tests too.
6.0.0
Small but nonetheless breaking changes.
✈️ Changes
- 💥 Mismatching wrapping/nonwrapping heads and tails are not permitted any more. Either both are wrapping or both are non-wrapping. If you used this library in normal ways you should not see the difference. The benefits of this changes are huge — 💥 We have completely rehauled head and tail detection (see below) and accepting only matching pairs allows us to identify more false-positives.
PS. Bumping semver major just in case (could have bumped minor) but let’s better be safe than sorry 😉
🏗️ Improvements
- Improved head and tail detection algorithm. Previously we used simple string search, without considering the order of the findings. Wrong order now will help to rule-out more false positives.
- Tapped ast-monkey-traverse directly, without the need for the whole ast-monkey.
- Many other improvements on the setup
5.0.0
- Rebased in ES Modules
- Set up Rollup to generate three builds: CommonJS, UMD and ES Modules
- Dropped JS Standard and tapped raw ESLint on
airbnb-base
preset, with an override to ban semicolons
4.6.0
- Replaced
object-assign
with ES6Object.assign
4.5.0
- Separated the
arrayiffy-if-string
into a standalone library and tapped it.
4.4.0
- Updated all deps
- Updated Codsen name
4.3.0
- Switched to check-types-mini and removed internal equivalents.
4.2.0
-
opts.resolveToFalseIfAnyValuesContainBool
(on by default) -
opts.throwWhenNonStringInsertedInString
(off by default) -
Now allowing to query deeper-level values. For example:
jv({ a: “some text %%_b.key2_%% more text”, b: { key1: “val1″, key2: “val2″, key3: “val3″, }, }); // => { // a: ‘some text val2 more text’, // b: { // key1: ‘val1′, // key2: ‘val2′, // key3: ‘val3′ // } // }
-
Obviously, the new changes above threw the
opts.dontWrapVars
out of track a little bit since instead ofkey
now we’ve possibly gotkey.key[element.key]
, so I fixed that too and added more unit tests.
Blimey, we’ve got 99 unit tests! 🍾 We’ll need to celebrate the 100th! 🍻✨
4.1.0
- Variables are not correctly resolved from linking to the same (deeper) level. If not found, search continues in that level’s data store key (default key name for data stores is
<same-key-name>_data
). If not found there, search jumps to root level, and looks for key there. If not found, search continues for data store at the root. If failed, error is thrown. - Some rebasing done to clean things up 🚿.
4.0.0
Breaking changes in the API, or rather output. When Boolean values are encountered and written as values (and no other string characters are present on the original placeholder), we output empty string, not false
or true
. Nobody needs Booleans converted to String. I need this for my email templating projects. 🦄
-
JSON specs allow various kinds of types to be placed as key values: Booleans, arrays, plain objects and even
null
. In this release we loosen the restrictions and allow these different types to be resolved as values, particularly,null
and Booleans. -
Added
opts.resolveToBoolIfAnyValuesContainBool
— iftrue
(default), if any variable’s value is Boolean, upon resolving it will set the whole value to itself. For example,aaaa %%_var_%% bbbbb
andvar=true
would resolve totrue
. If setting isfalse
, it will resolve to empty string, in this example’s case,aaaa bbbbb
. I don’t see why anybody would set it to other value thandefault
, but hey, the more freedom the better. -
opts.resolveToFalseIfAnyValuesContainBool
— if Boolean variable is enountered, the whole thing always resolves tofalse
. Even if the first encountered variable’s value wastrue
. This is needed for email templating, so that when Booleans are encountered, we bail setting the whole thing tofalse
.
3.0.0
opts.headsNoWrap
(default%%-
) &opts.tailsNoWrap
(default-%%
). When the same string has multiple occasions of a variable and we want some variables to be wrapped but some not it was previously impossible. Wrapping ignores were global. Now not. I came with an idea to allow different (customiseable)heads
andtails
which prevent wrapping on the variable it marks.- 💥
opts.wrapHeads
is nowopts.wrapHeadsWith
- 💥
opts.wrapTails
is nowopts.wrapTailsWith
2.0.0
- 💥 Breaking changes & major semver version bump:
opts.dontWrapVarsStartingWith
andopts.dontWrapVarsEndingWith
merged into one and allow wildcards now. It’s way more powerful since you can glob not only the starting/ending pieces of string but anything within it. You can put a wildcard in the middle now or even multiple wildcards!
1.2.0
- If any key’s value contains only a heads or tails marker and nothing else, it will not throw. You can force throwing (that’s previous version’s behaviour) setting
opts.noSingleMarkers
totrue
. But the default isfalse
. - Did some code rebasing.
1.1.0
- Fixed one edge case where the source was array, it was querying variable from
_data
key store, which was in turn querying variable from its key data store. - More tests to keep coverage at 100%
1.0.0
- First public release