rheactor-value-objects
Advanced tools
Comparing version 9.0.1 to 9.1.0
@@ -77,2 +77,13 @@ 'use strict'; | ||
/** | ||
* Returns a copy of the instance with the given string appended | ||
* @returns {URIValue} | ||
*/ | ||
}, { | ||
key: 'append', | ||
value: function append(str) { | ||
return new URIValue('' + this + str); | ||
} | ||
/** | ||
* Returns true if str is an URI | ||
@@ -79,0 +90,0 @@ * @param {String} str |
{ | ||
"name": "rheactor-value-objects", | ||
"description": "A collection of value objects", | ||
"version": "9.0.1", | ||
"version": "9.1.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -53,2 +53,10 @@ import {ValidationFailedError} from '@resourcefulhumans/rheactor-errors' | ||
/** | ||
* Returns a copy of the instance with the given string appended | ||
* @returns {URIValue} | ||
*/ | ||
append (str) { | ||
return new URIValue(`${this}${str}`) | ||
} | ||
/** | ||
* Returns true if str is an URI | ||
@@ -55,0 +63,0 @@ * @param {String} str |
@@ -166,2 +166,11 @@ import {URIValue, URIValueType, MaybeURIValueType} from '../src' | ||
}) | ||
describe('append()', () => { | ||
it('should return a new URL with the appended string', () => { | ||
const u = new URIValue('https://example.com') | ||
const u2 = u.append('/status') | ||
expect(u2.toString(), 'it should concatenate the string to the URI').to.equal('https://example.com/status') | ||
expect(u, 'it should create a new instance').to.not.equal(u2) | ||
}) | ||
}) | ||
}) |
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
58404
1640