UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

23 lines (22 loc) 623 B
"use strict"; import { isString } from "./../../../core/Type"; import { BaseMethod } from "./_Base"; export class StrCharsCountExpression extends BaseMethod { // str_chars_count('bla') => 3 static requiredArguments() { return [["string", "string to count characters of"]]; } // findDependency(index_or_path: number | string): null { // return null // // return this.createDependencyFromIndexOrPath(index_or_path) // } async processArguments(args) { if (args.length == 1) { const string = args[0]; if (isString(string)) { return string.length; } } return 0; } }