From 963168e7b4b710e3c0a54cdbf00d52eebbdb9245 Mon Sep 17 00:00:00 2001 From: SheetJS Date: Wed, 17 Jan 2024 15:22:38 -0500 Subject: [PATCH] netsuite-amd --- .../01-installation/04-amd.md | 34 ++++++--- docz/docs/03-demos/01-math/index.md | 20 +++-- docz/docs/03-demos/02-frontend/09-legacy.md | 2 +- .../docs/03-demos/03-net/01-network/index.mdx | 75 ++++++++++++++----- docz/docs/03-demos/03-net/02-upload/index.mdx | 53 +++---------- docz/docs/03-demos/03-net/09-dom.md | 49 ++++++------ .../03-demos/17-mobile/02-nativescript.md | 2 + docz/docs/03-demos/23-data/16-postgresql.md | 5 +- docz/docs/03-demos/23-data/17-mariadb.md | 5 +- docz/docs/03-demos/30-cloud/02-netsuite.md | 2 +- 10 files changed, 140 insertions(+), 107 deletions(-) diff --git a/docz/docs/02-getting-started/01-installation/04-amd.md b/docz/docs/02-getting-started/01-installation/04-amd.md index 68d12c0..3f09842 100644 --- a/docz/docs/02-getting-started/01-installation/04-amd.md +++ b/docz/docs/02-getting-started/01-installation/04-amd.md @@ -36,18 +36,34 @@ new versions are released! ## NetSuite -After adding to the File Cabinet, scripts can be referenced in `define` calls -in SuiteScripts. For example, if the `xlsx.full.min.js` script is placed in the -same folder as the SuiteScript, the relative import `"./xlsx.full.min"` works: +After downloading the script and uploading to the file cabinet, a module alias +must be added to the `@NAmdConfig` configuration file: -```js -define(['N/file', './xlsx.full.min'], function(file, XLSX) { - // ... use XLSX here -}) +```json title="JsLibraryConfig.json" +{ + "paths": { + // highlight-next-line + "xlsx": "/path/to/xlsx.full.min" + } +} ``` -As explained in the [NetSuite demo](/docs/demos/cloud/netsuite), module aliases -can be created in config files referenced via `@NAmdConfig` comments. +Once added, SuiteScripts can reference the package using the name `xlsx`: + +```js title="SuiteScript" +/** + * @NApiVersion 2.x + * ... more options ... + // highlight-next-line + * @NAmdConfig ./JsLibraryConfig.json + */ +// highlight-next-line +define(['N/file', 'xlsx'], function(file, XLSX) { + // ... use XLSX here ... +}); +``` + +**More details are included in the [NetSuite demo](/docs/demos/cloud/netsuite#installation)** ## SAP UI5 diff --git a/docz/docs/03-demos/01-math/index.md b/docz/docs/03-demos/01-math/index.md index 3627862..bb097fb 100644 --- a/docz/docs/03-demos/01-math/index.md +++ b/docz/docs/03-demos/01-math/index.md @@ -7,6 +7,8 @@ pagination_next: demos/frontend/index import DocCardList from '@theme/DocCardList'; import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; +Each valid number in Excel can be represented as an "IEEE754 double"[^1]. + With full support for IEEE754 doubles and singles, JavaScript is an excellent language for mathematics and statistical analysis. It has also proven to be a viable platform for machine learning. @@ -88,8 +90,8 @@ entries will be converted to quiet `NaN` values. #### Extracting Worksheet Data -The SheetJS `sheet_to_json`[^1] method with the option `header: 1`[^2] generates -an array of arrays from a worksheet object. The result is in row-major order: +The SheetJS `sheet_to_json`[^2] method with the option `header: 1` generates an +array of arrays from a worksheet object. The result is in row-major order: ```js const aoa = XLSX.utils.sheet_to_json(worksheet, {header: 1}); @@ -247,9 +249,9 @@ const petal_length = Float64Array.from(aoa[2].slice(1)); ### Writing to Sheets -The SheetJS `aoa_to_sheet`[^1] method can generate a worksheet from an array of -arrays. Similarly, `sheet_add_aoa`[^2] can add an array of arrays of data into -an existing worksheet object. The `origin` option[^3] controls where data will +The SheetJS `aoa_to_sheet`[^3] method can generate a worksheet from an array of +arrays. Similarly, `sheet_add_aoa`[^4] can add an array of arrays of data into +an existing worksheet object. The `origin` option[^5] controls where data will be written in the worksheet. Neither method understands typed arrays, so data columns must be converted to @@ -407,6 +409,8 @@ function SheetJSeriesToCols() { return (