1.9.1 • Published 7 months ago

@nlighten/json-transform-core v1.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@nlighten/json-transform-core

npm.io

Core types and utilities for handling JSON transformers

Installation

npm install @nlighten/json-transform-core

API

{
  ContextVariablesSchemas: Record<string, TypeSchema>,
  getFunctionInlineSignature:  (name: string, func: FunctionDescriptor, requiredOnly?: boolean) => string,
  getFunctionObjectSignature:  (name: string, func: FunctionDescriptor) => string,
  functionsParser:  {
    get(name: string) => FunctionDescriptor,
    getNames() => Set<string>,
    resolveDocsUrl(funcName: string, functionDescriptor ? : FunctionDescriptor) => string,
    matchInline(
      data: any,
      callback?: (
        funcName: EmbeddedTransformerFunction,
        func: FunctionDescriptor,
        value: any,
        args: Record<string, any>,
      ) => any): FunctionDescriptor | null,
    matchObject(data: any, extractOutputTypeRecursively ? : boolean):ObjectFunctionMatchResult | undefined,
    matchAllObjectFunctionsInLine(line: string) => IterableIterator,
    matchAllInlineFunctionsInLine(line: string) => IterableIterator,
  },
  parseArgs: (func: FunctionDescriptor, args?: string) => {},
  type Argument,
  type ArgumentCondition,
  type ConditionalSubFunction,
  type FunctionDefinition,
  type FunctionDescriptor,
  EmbeddedTransformerFunction, // enum
  EmbeddedTransformerFunctions: EmbeddedTransformerFunction[],
  type JsonTransformExample,
  jsonpathJoin: (...args: (string | null | undefined)[]): string,
  JsonPathFunctionRegex: RegExp,
  parseTransformer: (
    definition: any,
    targetPath: string,
    previousPaths: string[],
    paths: string[] = [],
    typesMap? : Record<string, TypeSchema>,
    additionalContext? : Record<string, TypeSchema>,
  ) => void,
  ParseContext: {
    resolve(name: string) => TypeSchema,
  },
  type ParseMethod,
  type HandleFunctionMethod,
  definitions: Record<EmbeddedTransformerFunction, FunctionDefinition>,
  examples: Record<EmbeddedTransformerFunction, JsonTransformExample>,
  functions: Record<EmbeddedTransformerFunction, FunctionDescriptor>, 
  transformUtils: { //TransformUtils
    setAdditionalContext: (additionalContext: Set<string>) => void,
    getAdditionalContext: () => Set<string>,
    setSpecialKeys: (specialKeys: Set<string>) => void,
    getSpecialKeys: () => Set<string>,
    setContextVariablesSchemas: (contextVariablesSchemas: Record<string, TypeSchema>) => void,
    getContextVariablesSchemas: () => Record<string, TypeSchema>,
    setScopedContextVariablesSchema: (scopedContextVariablesSchema: Record<string, TypeSchema | null>) => void,
    getScopedContextVariablesSchema: () => Record<string, TypeSchema | null>,
    matchesAnyOfContextVariables: (variableName: string) => boolean,
    matchesAnyOfAdditionalContext: (variableName: string) => boolean,
    matchesAnyOfSpecialKeys: (variableName: string) => boolean,
    variableDetectionRegExpFactory: (flags = "g") => RegExp,
  }
}
;

License

MIT

1.1.1

11 months ago

1.9.1

7 months ago

1.8.2

8 months ago

1.9.0

7 months ago

1.8.1

9 months ago

1.7.2

10 months ago

1.8.0

10 months ago

1.7.1

10 months ago

1.7.0

10 months ago

1.5.2

10 months ago

1.3.4

11 months ago

1.6.0

10 months ago

1.5.1

10 months ago

1.3.3

11 months ago

1.5.0

10 months ago

1.3.2

11 months ago

1.4.0

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.8.5

7 months ago

1.8.4

7 months ago

1.8.3

7 months ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago