@chubbyts/chubbyts-decode-encode 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,7 +34,7 @@ A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.
34
34
  Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-decode-encode][1].
35
35
 
36
36
  ```ts
37
- npm i @chubbyts/chubbyts-decode-encode@^2.0.0
37
+ npm i @chubbyts/chubbyts-decode-encode@^2.0.1
38
38
  ```
39
39
 
40
40
  ## Usage
@@ -1,4 +1,4 @@
1
- import type { Data } from '../index';
1
+ import type { Data } from '../index.js';
2
2
  export declare class DecodeError extends Error {
3
3
  constructor(message: string, stack?: string);
4
4
  }
@@ -1,2 +1,2 @@
1
- import type { TypeDecoder } from './index';
1
+ import type { TypeDecoder } from './index.js';
2
2
  export declare const createJsonTypeDecoder: () => TypeDecoder;
@@ -1,5 +1,5 @@
1
1
  import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/dist/throwable-to-error';
2
- import { DecodeError } from './index';
2
+ import { DecodeError } from './index.js';
3
3
  export const createJsonTypeDecoder = () => {
4
4
  return {
5
5
  decode: (encodedData) => {
@@ -1,2 +1,2 @@
1
- import type { TypeDecoder } from './index';
1
+ import type { TypeDecoder } from './index.js';
2
2
  export declare const createJsonxTypeDecoder: () => TypeDecoder;
@@ -1,7 +1,7 @@
1
1
  import { XMLParser } from 'fast-xml-parser';
2
2
  import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/dist/throwable-to-error';
3
- import { DATATYPE_ARRAY, DATATYPE_BOOLEAN, DATATYPE_NULL, DATATYPE_NUMBER, DATATYPE_OBJECT, DATATYPE_STRING, } from '../jsonx-datatypes';
4
- import { DecodeError } from './index';
3
+ import { DATATYPE_ARRAY, DATATYPE_BOOLEAN, DATATYPE_NULL, DATATYPE_NUMBER, DATATYPE_OBJECT, DATATYPE_STRING, } from '../jsonx-datatypes.js';
4
+ import { DecodeError } from './index.js';
5
5
  const decodeHtmlEntities = (string) => string.replace(/&#\d+;/gm, (code) => String.fromCharCode(code.match(/\d+/)[0]));
6
6
  const isWithName = (node) => typeof node === 'object' &&
7
7
  null !== node &&
@@ -1,2 +1,2 @@
1
- import type { TypeDecoder } from './index';
1
+ import type { TypeDecoder } from './index.js';
2
2
  export declare const createUrlEncodedTypeDecoder: () => TypeDecoder;
@@ -1,5 +1,5 @@
1
1
  import { parse } from 'qs';
2
- import { isArray, isObject } from '../index';
2
+ import { isArray, isObject } from '../index.js';
3
3
  const decodeValue = (value) => {
4
4
  if (isObject(value)) {
5
5
  return Object.fromEntries(Object.entries(value).map(([subKey, subValue]) => [subKey, decodeValue(subValue)]));
@@ -1,2 +1,2 @@
1
- import type { TypeDecoder } from './index';
1
+ import type { TypeDecoder } from './index.js';
2
2
  export declare const createYamlTypeDecoder: () => TypeDecoder;
@@ -1,6 +1,6 @@
1
1
  import { parse } from 'yaml';
2
2
  import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/dist/throwable-to-error';
3
- import { DecodeError } from './index';
3
+ import { DecodeError } from './index.js';
4
4
  export const createYamlTypeDecoder = () => {
5
5
  return {
6
6
  decode: (encodedData) => {
@@ -1,4 +1,4 @@
1
- import type { Data } from '../index';
1
+ import type { Data } from '../index.js';
2
2
  export declare class EncodeError extends Error {
3
3
  constructor(message: string, stack?: string);
4
4
  }
@@ -1,2 +1,2 @@
1
- import type { TypeEncoder } from './index';
1
+ import type { TypeEncoder } from './index.js';
2
2
  export declare const createJsonTypeEncoder: (prettyPrint?: boolean) => TypeEncoder;
@@ -1,2 +1,2 @@
1
- import type { TypeEncoder } from './index';
1
+ import type { TypeEncoder } from './index.js';
2
2
  export declare const createJsonxTypeEncoder: (prettyPrint?: boolean) => TypeEncoder;
@@ -1,8 +1,8 @@
1
1
  import { XMLBuilder } from 'fast-xml-parser';
2
2
  import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/dist/throwable-to-error';
3
- import { isArray, isBoolean, isNumber, isObject, isString, isNull } from '../index';
4
- import { DATATYPE_ARRAY, DATATYPE_BOOLEAN, DATATYPE_NULL, DATATYPE_NUMBER, DATATYPE_OBJECT, DATATYPE_STRING, } from '../jsonx-datatypes';
5
- import { EncodeError } from './index';
3
+ import { isArray, isBoolean, isNumber, isObject, isString, isNull } from '../index.js';
4
+ import { DATATYPE_ARRAY, DATATYPE_BOOLEAN, DATATYPE_NULL, DATATYPE_NUMBER, DATATYPE_OBJECT, DATATYPE_STRING, } from '../jsonx-datatypes.js';
5
+ import { EncodeError } from './index.js';
6
6
  const encodeHtmlEntities = (string) => string.replace(/[\u00A0-\u9999<>&]/g, (i) => '&#' + i.charCodeAt(0) + ';');
7
7
  const createXmlNode = () => {
8
8
  return {
@@ -1,2 +1,2 @@
1
- import type { TypeEncoder } from './index';
1
+ import type { TypeEncoder } from './index.js';
2
2
  export declare const createUrlEncodedTypeEncoder: () => TypeEncoder;
@@ -1,5 +1,5 @@
1
1
  import { stringify } from 'qs';
2
- import { isArray, isBoolean, isNull, isNumber, isObject } from '../index';
2
+ import { isArray, isBoolean, isNull, isNumber, isObject } from '../index.js';
3
3
  const encodeValue = (value) => {
4
4
  if (isObject(value)) {
5
5
  return Object.fromEntries(Object.entries(value).map(([subKey, subValue]) => [subKey, encodeValue(subValue)]));
@@ -1,2 +1,2 @@
1
- import type { TypeEncoder } from './index';
1
+ import type { TypeEncoder } from './index.js';
2
2
  export declare const createYamlTypeEncoder: () => TypeEncoder;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chubbyts/chubbyts-decode-encode",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.",
6
6
  "keywords": [
7
7
  "chubbyts",