Skip to content

v1.1.2

Choose a tag to compare

@uoctamika uoctamika released this 31 May 01:27
· 68 commits to master since this release
v1.1.2
b8a3474

This release for stable stdio.printf function and publish workflow, can be install now!

Installation

$ npm install @uoctamika/libraryjs

version now:

$ npm install @uoctamika/libraryjs@1.1.2

What Changes

stdio.printf

new specifiers

Specifier Description Example Input Output
%s String value "world" "world"
%d Decimal integer 42 "42"
%i Integer (parsed from input) "42px" "42"
%f Floating-point number (6 decimal places) 3.14159 "3.141590"
%c Character (first character of string) "ABC" "A"
%o Object (default string representation) {a:1} "[object Object]"
%O Object (full inspection, unlimited depth) {a:{b:2}} "{ a: { b: 2 } }"
%x Hexadecimal (lowercase) 255 "ff"
%X Hexadecimal (uppercase) 255 "FF"
%b Binary 5 "101"
%j JSON stringify {name:"Uoc"} "{\"name\":\"Uoc\"}"
%% Literal percent sign - "%"

possible invalid output

Specifier Invalid Input Behavior
%d Returns "NaN" when the value is not a valid integer
%i Returns "NaN" when no integer can be parsed from the input
%f Returns "NaN" when the value is not a valid number
%c Returns an empty string ("") when the input string is empty
%o Returns "[object Object]" for non-null values using default object conversion
%O Returns a string representation of the value, including nested structures
%x Returns "NaN" when the value cannot be converted to an integer
%X Returns "NaN" when the value cannot be converted to an integer
%b Returns "NaN" when the value cannot be converted to an integer
%j Returns "undefined" when JSON serialization fails or the value cannot be serialized

publish.yml

add run npm install -g npm@latest for supporting stage feature

Security Improvements

nothing to update

Special Thanks

thank you for:
@uoctamika
@dependabot