Options
All
  • Public
  • Public/Protected
  • All
Menu

Package yarnpkg-parsers

Type aliases

Resolution

Resolution: object

Type declaration

  • descriptor: object
    • Optional description?: undefined | string
    • fullName: string
  • Optional from?: undefined | object

Variables

Const ANSI_C_STRING_ESCAPE_TESTS

ANSI_C_STRING_ESCAPE_TESTS: Array<[]> = [[`\\\\`, `\\`],[`\\"`, `"`],[`\\'`, `'`],[`\\e`, `\x1b`],[`\\0`, `\x00`],[`\\x7`, `\x07`],[`\\u0027`, `'`],[`\\U0001F601`, `😁`],]

Const DOUBLE_QUOTE_STRING_ESCAPE_TESTS

DOUBLE_QUOTE_STRING_ESCAPE_TESTS: Array<[]> = [[`\\\n`, ``],[`\\\\`, `\\`],[`\\"`, `"`],[`\\$`, `$`],]

Const INVALID_COMMANDS

INVALID_COMMANDS: string[] = [// Empty shell lines...[// Only fish supports these`;;`,`echo foo;;`,// Only zsh and fish support these`; ;`,`echo foo; ;`,],`echo }`,`echo foo}`,// It shouldn't allow shell lines to start with semicolons.// Bash doesn't allow it, but ZSH and Fish do. We don't, because// we don't need the extra complexity. Also, it's more common to// end a shell line with a semicolon, rather than start one with a semicolon.// Anyways, I can't think of any reason why anybody would like to start// a script with a semicolon. ¯\_(ツ)_/¯.`; echo foo`,`& echo foo`,]

Const LEGACY_REGEXP

LEGACY_REGEXP: RegExp = /^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i

Const STRINGIFIER_TESTS

STRINGIFIER_TESTS: Array<[]> = [[`echo foo`, `echo foo`],[`echo foo; echo bar`, `echo foo; echo bar`],[`echo foo; echo bar;`, `echo foo; echo bar`],[`echo foo &`, `echo foo &`],[`echo foo & echo bar`, `echo foo & echo bar`],[`echo foo & echo bar &`, `echo foo & echo bar &`],[`echo foo && echo bar || echo baz`, `echo foo && echo bar || echo baz`],[`echo foo | wc --chars`, `echo foo | wc --chars`],[`ls **/foo/*.txt`, `ls **/foo/*.txt`],[`echo foo > bar`, `echo foo > bar`],[`echo a$B"c"'d'`, `echo a\${B}cd`],[`echo a$B"c"'d'`, `echo a\${B}cd`],[`echo $(( 1 + 2 * 3 - 4 / 5 ))`, `echo $(( ( 1 + ( 2 * 3 ) ) - ( 4 / 5 ) ))`],[`echo $(( 7 - 2 - 3 * 5 / 6 ))`, `echo $(( ( 7 - 2 ) - ( ( 3 * 5 ) / 6 ) ))`],[`(echo foo && echo bar)`, `(echo foo && echo bar)`],[`{echo foo && echo bar}`, `{ echo foo && echo bar; }`],[`FOO=bar echo foo`, `FOO=bar echo foo`],[`FOO=bar BAZ=qux`, `FOO=bar BAZ=qux`],[`FOO=$'\\x09'`, `FOO=$'\\t'`],[`FOO=$'\\u0027'`, `FOO=$'\\''`],[`FOO=$'\\U0001F601'`, `FOO=😁`],]

Const VALID_COMMANDS

VALID_COMMANDS: string[] = [`echo {`,`echo {foo`,`echo { foo`,`echo {}`,`echo foo{}bar`,// It should allow shell lines to end with semicolons`echo foo;`,// Redirections...[`echo foo >& 1`,`echo foo >&1`,`echo foo 2> bar`,],// Groups...[// Parsable by bash`{ echo foo; }`,`{ echo foo;}`,// Unparsable by bash, parsable by zsh`{ echo foo }`,`{echo foo }`,`{ echo foo}`,`{echo foo}`,],// Background jobs// "&" should have the same precedence as ";"...[`echo foo &`,`echo foo & echo bar`,`echo foo & echo bar &`,`echo foo && echo bar &`,`echo foo; echo bar &`,`sleep 3 && echo foo & echo bar`,`echo foo | wc --chars &`,`echo foo | wc --chars & echo bar`,],]

Const simpleStringPattern

simpleStringPattern: RegExp = /^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/

Const specialObjectKeys

specialObjectKeys: string[] = [`__metadata`, `version`, `resolution`, `dependencies`, `peerDependencies`, `dependenciesMeta`, `peerDependenciesMeta`, `binaries`]

Functions

isRemovableField

  • isRemovableField(value: any): boolean

parseResolution

parseShell

  • parseShell(source: string, options?: object): ShellLine
  • Parameters

    • source: string
    • Default value options: object = {isGlobPattern: () => false}
      • isGlobPattern: function
          • (arg: string): boolean
          • Parameters

            • arg: string

            Returns boolean

    Returns ShellLine

parseSyml

  • parseSyml(source: string): object

parseViaJsYaml

  • parseViaJsYaml(source: string): object

parseViaPeg

  • parseViaPeg(source: string): object

peg$SyntaxError

  • peg$SyntaxError(message: any, expected: any, found: any, location: any): void

peg$SyntaxError

  • peg$SyntaxError(message: any, expected: any, found: any, location: any): void

peg$SyntaxError

  • peg$SyntaxError(message: any, expected: any, found: any, location: any): void

peg$parse

  • peg$parse(input: any, options: any): any

peg$parse

  • peg$parse(input: any, options: any): any

peg$parse

  • peg$parse(input: any, options: any): any

peg$subclass

  • peg$subclass(child: any, parent: any): void

peg$subclass

  • peg$subclass(child: any, parent: any): void

peg$subclass

  • peg$subclass(child: any, parent: any): void

stringifyArgument

  • stringifyArgument(argument: Argument): string

stringifyArgumentSegment

  • stringifyArgumentSegment(argumentSegment: ArgumentSegment): string

stringifyArithmeticExpression

  • stringifyArithmeticExpression(argument: ArithmeticExpression): string

stringifyCommand

  • stringifyCommand(command: Command): string

stringifyCommandChain

  • stringifyCommandChain(commandChain: CommandChain): string

stringifyCommandChainThen

  • stringifyCommandChainThen(commandChainThen: CommandChainThen): string

stringifyCommandLine

  • stringifyCommandLine(commandLine: CommandLine): string

stringifyCommandLineThen

  • stringifyCommandLineThen(commandLineThen: CommandLineThen): string

stringifyEnvSegment

  • stringifyEnvSegment(envSegment: EnvSegment): string

stringifyRedirectArgument

  • stringifyRedirectArgument(argument: RedirectArgument): string

stringifyResolution

  • stringifyResolution(resolution: Resolution): string

stringifyShellLine

  • stringifyShellLine(shellLine: ShellLine, __namedParameters?: object): string

stringifyString

  • stringifyString(value: string): string

stringifySyml

  • stringifySyml(value: any): string

stringifyValue

  • stringifyValue(value: any, indentLevel: number, newLineIfObject: boolean): string

stringifyValueArgument

  • stringifyValueArgument(argument: ValueArgument): string

Generated using TypeDoc