@cdxoo/block-quote
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@cdxoo/block-quote", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "simple indent sanitization for multi line strings", | ||
@@ -24,6 +24,5 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"mocha": "^7.1.1" | ||
}, | ||
"dependencies": {} | ||
"chai": "^4.3.4", | ||
"mocha": "^8.4.0" | ||
} | ||
} |
@@ -34,3 +34,3 @@ function blockquote (call_site, ...placeholder_values) { | ||
var arg = placeholder_values[i].replace( | ||
var arg = String(placeholder_values[i]).replace( | ||
/\n/g, | ||
@@ -37,0 +37,0 @@ '\n' + ' '.repeat(local_indent) |
@@ -6,3 +6,3 @@ 'use strict'; | ||
describe('block-quote', () => { | ||
it('trims beginning/end wheitespace', () => { | ||
it('trims beginning/end whitespace', () => { | ||
var str = blockquote` 2B or not 2A | ||
@@ -69,2 +69,22 @@ `; | ||
it('handles non string placeholder values properly', () => { | ||
var arrival = (date) => { | ||
var a = { | ||
t: new Date(date).getTime(), | ||
} | ||
a.toString = () => new Date(a.t).toISOString(); | ||
return a; | ||
}; | ||
var str = blockquote` | ||
Friendly Arm | ||
Arrival: ${arrival('1234-01-01T12:00:00.000Z')} | ||
Nashkell | ||
Arrival: ${arrival('1234-02-11T13:30:00.000Z')} | ||
`; | ||
//console.log(str); | ||
expect(str).to.equal( | ||
"Friendly Arm\n Arrival: 1234-01-01T12:00:00.000Z\nNashkell\n Arrival: 1234-02-11T13:30:00.000Z" | ||
); | ||
}) | ||
it('throws when called as function and call_site isnt an array', () => { | ||
@@ -71,0 +91,0 @@ var error = undefined; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6521
129