@fuel-ts/utils
Advanced tools
Comparing version 0.0.0-next-20230628110522 to 0.0.0-next-20230628121010
@@ -1,12 +0,3 @@ | ||
import './test'; | ||
/** | ||
* Converts `some.string-value` into `SomeStringValue`. | ||
* | ||
* Examples: | ||
* my-simple.test —— MySimpleTest | ||
* myFile.ts —— MyFileTs | ||
* my-abi.json —— MyAbiJson | ||
*/ | ||
declare const normalizeString: (str: string) => string; | ||
export { normalizeString }; | ||
import './test-utils.js'; | ||
export * from './utils/normalizeString'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -21,2 +21,6 @@ "use strict"; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
@@ -67,4 +71,4 @@ mod | ||
var objectToString = objectProto.toString; | ||
var Symbol = root.Symbol; | ||
var symbolProto = Symbol ? Symbol.prototype : void 0; | ||
var Symbol2 = root.Symbol; | ||
var symbolProto = Symbol2 ? Symbol2.prototype : void 0; | ||
var symbolToString = symbolProto ? symbolProto.toString : void 0; | ||
@@ -131,7 +135,13 @@ function baseSlice(array, start, end) { | ||
(s) => s.replace(/\s+/g, "-"), | ||
// spaces to - | ||
(s) => s.replace(/\./g, "-"), | ||
// dots to - | ||
(s) => s.replace(/_/g, "-"), | ||
// underscore to - | ||
(s) => s.replace(/-[a-z]/g, (match) => match.slice(-1).toUpperCase()), | ||
// delete '-' and capitalize the letter after them | ||
(s) => s.replace(/-/g, ""), | ||
// delete any '-' left | ||
(s) => s.replace(/^\d+/, ""), | ||
// removes leading digits | ||
(s) => (0, import_lodash.default)(s) | ||
@@ -138,0 +148,0 @@ ]; |
@@ -21,2 +21,6 @@ "use strict"; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
@@ -27,8 +31,8 @@ mod | ||
// src/utils/index.ts | ||
var utils_exports = {}; | ||
__export(utils_exports, { | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
normalizeString: () => normalizeString | ||
}); | ||
module.exports = __toCommonJS(utils_exports); | ||
module.exports = __toCommonJS(src_exports); | ||
@@ -40,7 +44,13 @@ // src/utils/normalizeString.ts | ||
(s) => s.replace(/\s+/g, "-"), | ||
// spaces to - | ||
(s) => s.replace(/\./g, "-"), | ||
// dots to - | ||
(s) => s.replace(/_/g, "-"), | ||
// underscore to - | ||
(s) => s.replace(/-[a-z]/g, (match) => match.slice(-1).toUpperCase()), | ||
// delete '-' and capitalize the letter after them | ||
(s) => s.replace(/-/g, ""), | ||
// delete any '-' left | ||
(s) => s.replace(/^\d+/, ""), | ||
// removes leading digits | ||
(s) => (0, import_lodash.default)(s) | ||
@@ -47,0 +57,0 @@ ]; |
{ | ||
"name": "@fuel-ts/utils", | ||
"version": "0.0.0-next-20230628110522", | ||
"version": "0.0.0-next-20230628121010", | ||
"description": "Utilities (and test utilities) collection", | ||
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./test": { | ||
"import": "./dist/test.mjs", | ||
"require": "./dist/test.js", | ||
"types": "./dist/test.d.ts" | ||
"./test-utils": { | ||
"require": "./dist/test-utils.js", | ||
"import": "./dist/test-utils.mjs", | ||
"types": "./dist/test-utils.d.ts" | ||
} | ||
@@ -20,7 +23,4 @@ }, | ||
"*": { | ||
"index": [ | ||
"./dist/index.d.ts" | ||
], | ||
"test": [ | ||
"./dist/test.d.ts" | ||
"test-utils": [ | ||
"./dist/test-utils.d.ts" | ||
] | ||
@@ -44,4 +44,4 @@ } | ||
"build": "tsup", | ||
"build:watch": "tsup --watch" | ||
"postbuild": "tsx ../../scripts/postbuild.ts" | ||
} | ||
} |
@@ -43,3 +43,3 @@ # `@fuel-ts/utils` | ||
```ts | ||
import { safeExec } from "@fuel-ts/utils/test"; // note the `test` suffix | ||
import { safeExec } from "@fuel-ts/utils/test-utils"; // note the `test` suffix | ||
@@ -46,0 +46,0 @@ console.log(safeExec(() => 123)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
228492
25
1863
2