Skip to content

Commit

Permalink
feat(util): flatStr
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD authored and njfamirm committed May 18, 2023
1 parent 163a122 commit 09462ec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,20 @@
"bugs": {
"url": "https://github.com/AliMD/alwatr/issues"
},
"exports": {
".": {
"default": "./index.js"
},
"./node.js": {
"default": "./node/index.js"
}
},
"dependencies": {
"@alwatr/math": "^0.31.0",
"@alwatr/type": "^0.31.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"flatstr": "^1.0.12"
}
}
9 changes: 9 additions & 0 deletions core/util/src/flat-str.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Flattens the underlying C structures of a concatenated JavaScript string.
*/
export const flatStr = (s: string): string => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
s | 0;
return s;
};
1 change: 1 addition & 0 deletions core/util/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from './json.js';
export * from './local-storage.js';
export * from './client-id.js';
export * from './polyfill.js';
export * from './flat-str.js';

0 comments on commit 09462ec

Please sign in to comment.