@tv2media/command-transpiler
Advanced tools
Comparing version 1.2.5 to 1.3.0
@@ -7,2 +7,3 @@ import { IModifier, IInterpreterContext, IInterpret } from '../../common/types'; | ||
export declare function interpretNot({ varname }: IInterpreterContext): IInterpret; | ||
export declare function interpretExists({ varname }: IInterpreterContext): IInterpret; | ||
export default function interpretModifier({ modifier: type, args }: IModifier, varname: string): IInterpret; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.interpretNot = exports.interpretDefault = exports.interpretEqual = exports.interpretToString = exports.interpretLength = void 0; | ||
exports.interpretExists = exports.interpretNot = exports.interpretDefault = exports.interpretEqual = exports.interpretToString = exports.interpretLength = void 0; | ||
function interpretLength({ varname }) { | ||
@@ -24,2 +24,6 @@ return (store) => ({ ...store, [varname]: store[varname].length ? store[varname].length : 0 }); | ||
exports.interpretNot = interpretNot; | ||
function interpretExists({ varname }) { | ||
return (store) => ({ ...store, [varname]: varname in store && store[varname] !== undefined }); | ||
} | ||
exports.interpretExists = interpretExists; | ||
// TODO: Check how to best use type here | ||
@@ -34,2 +38,3 @@ function interpretModifier({ modifier: type, args }, varname) { | ||
case 'not': return interpretNot(context); | ||
case 'exists': return interpretExists(context); | ||
default: | ||
@@ -36,0 +41,0 @@ throw Error(`Unknown General modifier: ${type}`); |
@@ -8,1 +8,2 @@ import { IParser } from '../../utilities/parser-combinator'; | ||
export declare function parseNot(): IParser<IModifier>; | ||
export declare function parseExists(): IParser<IModifier>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseNot = exports.parseEqual = exports.parseDefault = exports.parseToString = exports.parseLength = void 0; | ||
exports.parseExists = exports.parseNot = exports.parseEqual = exports.parseDefault = exports.parseToString = exports.parseLength = void 0; | ||
const combinators_1 = require("../../utilities/parser-combinator/combinators"); | ||
@@ -27,1 +27,5 @@ const parser_1 = require("../../base/parser"); | ||
exports.parseNot = parseNot; | ||
function parseExists() { | ||
return combinators_1.map(combinators_1.string('exists'), () => ({ domain, modifier: 'exists' })); | ||
} | ||
exports.parseExists = parseExists; |
{ | ||
"name": "@tv2media/command-transpiler", | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"description": "Transpiles commands from one protocol to another.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
64406
1557