feat:node-modules

This commit is contained in:
houjunxiang
2025-11-24 10:26:18 +08:00
parent 753766893b
commit 8a3e48d856
8825 changed files with 567399 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
export var binDocs = {
name: 'bin',
category: 'Utils',
syntax: ['bin(value)'],
description: 'Format a number as binary',
examples: ['bin(2)'],
seealso: ['oct', 'hex']
};

View File

@@ -0,0 +1,8 @@
export var cloneDocs = {
name: 'clone',
category: 'Utils',
syntax: ['clone(x)'],
description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices',
examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone("hello world")'],
seealso: []
};

View File

@@ -0,0 +1,8 @@
export var formatDocs = {
name: 'format',
category: 'Utils',
syntax: ['format(value)', 'format(value, precision)'],
description: 'Format a value of any type as string.',
examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'],
seealso: ['print']
};

View File

@@ -0,0 +1,8 @@
export var hasNumericValueDocs = {
name: 'hasNumericValue',
category: 'Utils',
syntax: ['hasNumericValue(x)'],
description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.',
examples: ['hasNumericValue(2)', 'hasNumericValue("2")', 'isNumeric("2")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, "foo", false])'],
seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']
};

View File

@@ -0,0 +1,8 @@
export var hexDocs = {
name: 'hex',
category: 'Utils',
syntax: ['hex(value)'],
description: 'Format a number as hexadecimal',
examples: ['hex(240)'],
seealso: ['bin', 'oct']
};

View File

@@ -0,0 +1,8 @@
export var isIntegerDocs = {
name: 'isInteger',
category: 'Utils',
syntax: ['isInteger(x)'],
description: 'Test whether a value is an integer number.',
examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'],
seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']
};

View File

@@ -0,0 +1,8 @@
export var isNaNDocs = {
name: 'isNaN',
category: 'Utils',
syntax: ['isNaN(x)'],
description: 'Test whether a value is NaN (not a number)',
examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'],
seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']
};

View File

@@ -0,0 +1,8 @@
export var isNegativeDocs = {
name: 'isNegative',
category: 'Utils',
syntax: ['isNegative(x)'],
description: 'Test whether a value is negative: smaller than zero.',
examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'],
seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']
};

View File

@@ -0,0 +1,8 @@
export var isNumericDocs = {
name: 'isNumeric',
category: 'Utils',
syntax: ['isNumeric(x)'],
description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',
examples: ['isNumeric(2)', 'isNumeric("2")', 'hasNumericValue("2")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, "foo", false])'],
seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue']
};

View File

@@ -0,0 +1,8 @@
export var isPositiveDocs = {
name: 'isPositive',
category: 'Utils',
syntax: ['isPositive(x)'],
description: 'Test whether a value is positive: larger than zero.',
examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'],
seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']
};

View File

@@ -0,0 +1,8 @@
export var isPrimeDocs = {
name: 'isPrime',
category: 'Utils',
syntax: ['isPrime(x)'],
description: 'Test whether a value is prime: has no divisors other than itself and one.',
examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'],
seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']
};

View File

@@ -0,0 +1,8 @@
export var isZeroDocs = {
name: 'isZero',
category: 'Utils',
syntax: ['isZero(x)'],
description: 'Test whether a value is zero.',
examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'],
seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']
};

View File

@@ -0,0 +1,8 @@
export var numericDocs = {
name: 'numeric',
category: 'Utils',
syntax: ['numeric(x)'],
description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',
examples: ['numeric("4")', 'numeric("4", "number")', 'numeric("4", "bigint")', 'numeric("4", "BigNumber")', 'numeric("4", "Fraction")', 'numeric(4, "Fraction")', 'numeric(fraction(2, 5), "number")'],
seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']
};

View File

@@ -0,0 +1,8 @@
export var octDocs = {
name: 'oct',
category: 'Utils',
syntax: ['oct(value)'],
description: 'Format a number as octal',
examples: ['oct(56)'],
seealso: ['bin', 'hex']
};

View File

@@ -0,0 +1,8 @@
export var printDocs = {
name: 'print',
category: 'Utils',
syntax: ['print(template, values)', 'print(template, values, precision)'],
description: 'Interpolate values into a string template.',
examples: ['print("Lucy is $age years old", {age: 5})', 'print("The value of pi is $pi", {pi: pi}, 3)', 'print("Hello, $user.name!", {user: {name: "John"}})', 'print("Values: $1, $2, $3", [6, 9, 4])'],
seealso: ['format']
};

View File

@@ -0,0 +1,8 @@
export var typeOfDocs = {
name: 'typeOf',
category: 'Utils',
syntax: ['typeOf(x)'],
description: 'Get the type of a variable.',
examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf("hello world")'],
seealso: ['getMatrixDataType']
};