@abcnews/base-36-text
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,3 +0,4 @@ | ||
import 'fast-text-encoding'; | ||
export declare function encode(text: string): string; | ||
export declare function decode(base36string: string): string; | ||
declare function encode(text: string): string; | ||
declare function decode(base36string: string): string; | ||
export { decode, encode }; |
@@ -0,8 +1,49 @@ | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
'use strict' | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./base-36-text.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./base-36-text.cjs.development.js') | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
decode: () => decode, | ||
encode: () => encode | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_base_x = __toESM(require("base-x")); | ||
var BASE_36_CHARSET = "0123456789abcdefghijklmnopqrstuvwxyz"; | ||
var base36 = (0, import_base_x.default)(BASE_36_CHARSET); | ||
var encoder = new TextEncoder(); | ||
var decoder = new TextDecoder(); | ||
function encode(text) { | ||
return base36.encode(encoder.encode(text)); | ||
} | ||
function decode(base36string) { | ||
return decoder.decode(base36.decode(base36string)); | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
decode, | ||
encode | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@abcnews/base-36-text", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Tools for encoding / decoding text to / from base36 strings", | ||
@@ -21,3 +21,3 @@ "license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/base-36-text.esm.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
@@ -29,15 +29,22 @@ "files": [ | ||
"scripts": { | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"lint": "tsdx lint src", | ||
"example": "npm run build && rollup -c", | ||
"start": "tsup src/index.ts --dts --sourcemap --format esm,cjs --watch", | ||
"build": "tsup src/index.ts --dts --sourcemap --format esm,cjs", | ||
"test": "jest --coverage", | ||
"lint": "eslint src", | ||
"size": "npm run build && size-limit", | ||
"release": "np", | ||
"prepare": "husky install", | ||
"prepublishOnly": "npm run build", | ||
"release": "np", | ||
"test": "tsdx test" | ||
"example": "npm run build && rollup -c" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "tsdx lint src" | ||
"size-limit": [ | ||
{ | ||
"path": "dist/index.mjs", | ||
"limit": "1.5 kB" | ||
}, | ||
{ | ||
"path": "dist/index.js", | ||
"limit": "1.5 kB" | ||
} | ||
}, | ||
], | ||
"publishConfig": { | ||
@@ -50,24 +57,27 @@ "access": "public" | ||
"@babel/preset-env": "^7.12.1", | ||
"@types/jest": "^26.0.15", | ||
"husky": "^4.3.0", | ||
"@rollup/plugin-babel": "^6.0.3", | ||
"@rollup/plugin-commonjs": "^23.0.4", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@size-limit/preset-small-lib": "^8.1.0", | ||
"@types/jest": "^29.2.4", | ||
"@typescript-eslint/eslint-plugin": "^5.46.0", | ||
"@typescript-eslint/parser": "^5.46.0", | ||
"eslint": "^8.29.0", | ||
"husky": "^6.0.0", | ||
"install": "^0.13.0", | ||
"np": "^7.0.0", | ||
"npm": "^7.2.0", | ||
"rollup": "^2.33.2", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-serve": "^1.1.0", | ||
"tsdx": "^0.14.1", | ||
"jest": "^29.3.1", | ||
"np": "^7.6.2", | ||
"rollup": "^3.7.0", | ||
"rollup-plugin-serve": "^2.0.2", | ||
"size-limit": "^8.1.0", | ||
"ts-jest": "^29.0.3", | ||
"tslib": "^2.0.3", | ||
"tsup": "^6.5.0", | ||
"typescript": "^4.0.5" | ||
}, | ||
"dependencies": { | ||
"@types/fast-text-encoding": "^1.0.1", | ||
"base-x": "^3.0.8", | ||
"buffer": "^6.0.2", | ||
"base-x": "^4.0.0", | ||
"core-js": "^3.7.0", | ||
"fast-text-encoding": "^1.0.3", | ||
"sade": "^1.7.4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
101
1
0
8821
21
9
1
+ Addedbase-x@4.0.0(transitive)
- Removed@types/fast-text-encoding@^1.0.1
- Removedbuffer@^6.0.2
- Removedfast-text-encoding@^1.0.3
- Removed@types/fast-text-encoding@1.0.3(transitive)
- Removedbase-x@3.0.10(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbuffer@6.0.3(transitive)
- Removedfast-text-encoding@1.0.6(transitive)
- Removedieee754@1.2.1(transitive)
- Removedsafe-buffer@5.2.1(transitive)
Updatedbase-x@^4.0.0