Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jsupack

arlogy23MIT1.5.1

JavaScript Utilities

client-side, server-side, ecmascript, es2009, es2011, es5, es5.1, javascript, js, utility, jsutils, jsu, csv, csv parser, rfc 4180

readme

jsu

JavaScript utility library for ECMAScript 5.1 (or higher, due to backwards compatibility). See the list of browsers supporting ES5 here.

jsu (read JSU) stands for and provides JavaScript Utilities. It targets older browser versions first unless there is a security risk, missing functionality or poor performance in newer browsers. Explicit support (dedicated code) is not planned for Internet Explorer as Microsoft Edge is its successor.

The features provided by jsu were originally part of the nvc project. Some of these features, such as type checking or timer events can be found in other utility libraries. In case you find these libraries too large as a dependency, or if they require too new JavaScript technologies, among other disadvantages, you can use jsu as a possible fallback. For example, jsu_event.js supports generic and timer events in just a few lines of code. Also note that type checking is need-specific, i.e. not all use cases will accept a boolean object as a boolean, or a numeric string or an infinite number as a number; so even jsu implementation might not be of any help in checking data types.

Overall, jsu is not a substitute for libraries such as jQuery or others with convenient functions like isEqual() performing deep comparison of arbitrary objects.

How-To

Documentation and examples are available here. Version changelog is here.

See this file for development and maintenance notes.

changelog

Changelog

1.5.1 - 2023/05/06

  • Fix internal typo affecting the behavior of the parser. For example, given the CSV line "a"b,c where " is the field delimiter and , the field separator, parsing now yields one column ['a"b,c'] instead of two ['a"b', 'c']. Indeed, the opening field delimiter should be considered unclosed because the second one cannot be a closing delimiter (due to b being the next character to read).

1.5.0 - 2023/02/08

  • Update JsuCsvPsr.getConfig(): the returned object has a new regexOptimized property simplifying the initialization of smartRegex (which now only reflects the option of the same name passed to the constructor).
  • Make sure empty lines are ignored when skipEmptyLinesWhen is set to JsuCsvPsr.LineIsReallyEmpty.
  • Make sure line breaks are matched when regexOptimized is false (e.g. when smartRegex is false).

1.4.0 - 2022/10/10

  • Update JsuCmn.cloneDeep(value) to JsuCmn.cloneDeep(value, cache, cloneCustomImpl). The new parameters of the function are optional.

1.3.0 - 2022/09/18

  • Add LaTeX features under const JsuLtx = Jsu.Latex;.

1.2.0 - 2022/09/02

  • Add JsuCmn.cloneDeep(value) for convenient deep cloning.

1.1.0 - 2022/07/22

  • Add JsuCmn.isCssColorOrString(value): returns JsuCmn.isCssColor(value) if not null, or JsuCmn.isString(value) otherwise.
  • Update JsuCmn.isCssColor(value): returns null if CSS.supports() is not available, a boolean value otherwise.

1.0.0 - 2022/07/18

  • First release.