The StringStream
is a that provides string-related methods.
trim()
Returns a that trims the produced output. ()
import {text} from '@fluentfixture/core';
const stream = text(' text ').trim();
console.log(stream.single());
// 'text'
trimStart()
Returns a that trims (from the start) the produced output. ()
import {text} from '@fluentfixture/core';
const stream = text(' text ').trimStart();
console.log(stream.single());
// 'text '
trimEnd()
import {text} from '@fluentfixture/core';
const stream = text(' text ').trimEnd();
console.log(stream.single());
// ' text'
padStart()
Parameter
Type
Default
Description
import {text} from '@fluentfixture/core';
const stream = text('text').padStart(7, '#');
console.log(stream.single());
// '###text'
padEnd()
Parameter
Type
Default
Description
import {text} from '@fluentfixture/core';
const stream = text('text').padEnd(7, '#');
console.log(stream.single());
// 'text###'
split()
Parameter
Type
Default
Description
import { text } from '@fluentfixture/core';
const stream = text('1,2,3')
.split(',')
.map(i => `#${i}`)
console.log(stream.single());
// ['#1', '#2', '#3']
lowerCase()
import { text } from '@fluentfixture/core';
const stream = text('HELLO').lowerCase();
console.log(stream.single());
// 'hello'
upperCase()
import { text } from '@fluentfixture/core';
const stream = text('hello').upperCase();
console.log(stream.single());
// 'HELLO'
camelCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').camelCase();
console.log(stream.single());
// 'helloWorld'
capitalCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').capitalCase();
console.log(stream.single());
// 'Hello World'
constantCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').constantCase();
console.log(stream.single());
// 'HELLO_WORLD'
pathCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').pathCase();
console.log(stream.single());
// 'hello/world'
dotCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').dotCase();
console.log(stream.single());
// 'hello.world'
import { text } from '@fluentfixture/core';
const stream = text('hello world').headerCase();
console.log(stream.single());
// 'Hello-World'
paramCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').paramCase();
console.log(stream.single());
// 'hello-world'
pascalCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').pascalCase();
console.log(stream.single());
// 'HelloWorld'
snakeCase()
import { text } from '@fluentfixture/core';
const stream = text('hello world').snakeCase();
console.log(stream.single());
// 'hello_world'