fluentfixture
ContributionCode of Conduct
  • Fluent Fixture
  • PACKAGES
    • @fluentfixture/core
      • Everything Is A Factory
      • Streams
        • Stream
        • Boolean Stream
        • Number Stream
        • String Stream
        • Date Stream
        • Array Stream
        • Object Stream
      • Generators
      • Live Demo
    • @fluentfixture/format
      • Structure
      • Pipe Functions
        • Built-In Pipes
        • Custom Pipes
      • How To Use
      • Error Handling
      • Live Demo
  • 🫂Contribution
  • 🐦Follow me on Twitter :)
Powered by GitBook
On this page
  • trim()
  • trimStart()
  • trimEnd()
  • padStart()
  • padEnd()
  • split()
  • lowerCase()
  • upperCase()
  • camelCase()
  • capitalCase()
  • constantCase()
  • pathCase()
  • dotCase()
  • headerCase()
  • paramCase()
  • pascalCase()
  • snakeCase()
Edit on GitHub
  1. PACKAGES
  2. @fluentfixture/core
  3. Streams

String Stream

PreviousNumber StreamNextDate Stream

Last updated 7 months ago

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

length

Integer

target length

char

String

' '

pad string

import {text} from '@fluentfixture/core';

const stream = text('text').padStart(7, '#');

console.log(stream.single());
// '###text'

padEnd()

Parameter
Type
Default
Description

length

Integer

target length

char

String

' '

pad string

import {text} from '@fluentfixture/core';

const stream = text('text').padEnd(7, '#');

console.log(stream.single());
// 'text###'

split()

Parameter
Type
Default
Description

separator

String or RegExp

separator

limit

Integer

0

split limit

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'

headerCase()

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'

Returns a that trims (from the end) the produced output. ()

Returns a that add pads (from the start) to the produced output. ()

Returns a that add pads (from the end) to the produced output. ()

Returns an that produces the split output. ()

Returns a that converts the produced output to the lower case. ()

Returns a that converts the produced output to the upper case. ()

Returns a that converts the produced output to the camel case. ()

Returns a that converts the produced output to the capital case. ()

Returns a that converts the produced output to the constant case. ()

Returns a that converts the produced output to the path case. ()

Returns a that converts the produced output to the dot case. ()

Returns a that converts the produced output to the header case. ()

Returns a that converts the produced output to the param case. ()

Returns a that converts the produced output to the pascal case. ()

Returns a that converts the produced output to the snake case. ()

Stream
StringStream
Mdn Docs
StringStream
Mdn Docs
StringStream
Mdn Docs
StringStream
Mdn Docs
StringStream
Mdn Docs
ArrayStream
Mdn Docs
StringStream
Mdn Docs
StringStream
Mdn Docs
StringStream
Library Docs
StringStream
Library Docs
StringStream
Library Docs
StringStream
Library Docs
StringStream
Library Docs
StringStream
Library Docs
StringStream
Library Docs
StringStream
Library Docs
StringStream
Library Docs