bowhead-js
Advanced tools
Comparing version 3.0.1 to 4.0.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var regex = /{([0-9]+)(\:[a-z\:]+)?}/g; | ||
exports.muteExceptions = void 0; | ||
var regex = /{([0-9]+)(|[a-z|]+)?}/g; | ||
var isMuted = true; | ||
@@ -39,3 +40,3 @@ function muteExceptions(val) { | ||
: ''; | ||
var payloadStrings = payload.split(':'); | ||
var payloadStrings = payload.split('|'); | ||
var funcName = payloadStrings[0]; | ||
@@ -71,3 +72,3 @@ var extraParams = payloadStrings.slice(1); | ||
default: | ||
input = input + ":" + funcName; | ||
input = input + "|" + funcName; | ||
break; | ||
@@ -74,0 +75,0 @@ } |
{ | ||
"name": "bowhead-js", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"description": "Tiny string interpolation library", | ||
@@ -38,12 +38,12 @@ "main": "dist/main.js", | ||
"@types/mocha": "^8.0.3", | ||
"@types/node": "^14.6.0", | ||
"@typescript-eslint/eslint-plugin": "^3.9.1", | ||
"@typescript-eslint/parser": "^3.9.1", | ||
"@types/node": "^14.14.6", | ||
"@typescript-eslint/eslint-plugin": "^4.6.0", | ||
"@typescript-eslint/parser": "^4.6.0", | ||
"cross-env": "^7.0.2", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.7.0", | ||
"mocha": "^8.1.1", | ||
"typescript": "^3.8.3" | ||
"eslint": "^7.12.1", | ||
"mocha": "^8.2.0", | ||
"typescript": "^4.0.5" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -25,11 +25,11 @@ # bowhead-js | ||
// Custom functions. | ||
format('{0:uppercase}', 'haha'); // 'HAHA' | ||
format('{0|uppercase}', 'haha'); // 'HAHA' | ||
// Plurals. | ||
format('{0:countable:fish:fishes}', '1'); // 'fish'; | ||
format('{0:countable:fish:fishes}', '2'); // 'fishes' | ||
format('{0:countable:fish:fishes}', '0'); // 'fishes' | ||
format('{0|countable|fish|fishes}', '1'); // 'fish'; | ||
format('{0|countable|fish|fishes}', '2'); // 'fishes' | ||
format('{0|countable|fish|fishes}', '0'); // 'fishes' | ||
// "deer" is both singular and plural. | ||
format('{0:countable:deer}', '1'); // 'deer' | ||
format('{0:countable:deer}', '2'); // 'deer' | ||
format('{0|countable|deer}', '1'); // 'deer' | ||
format('{0|countable|deer}', '2'); // 'deer' | ||
``` | ||
@@ -36,0 +36,0 @@ |
Sorry, the diff of this file is not supported yet
8809
80