summaryrefslogtreecommitdiff
path: root/school/node_modules/string-trim-spaces-only/examples/_quickTake.js
blob: 041a49039e8cff48342901d20c5d70e6cddb9db4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Quick Take

import { strict as assert } from "assert";
import { trimSpaces } from "../dist/string-trim-spaces-only.esm.js";

assert.deepEqual(trimSpaces("  aaa   "), {
  res: "aaa",
  ranges: [
    [0, 2],
    [5, 8],
  ],
});

assert.deepEqual(trimSpaces("   \t  zz   \n    "), {
  res: "\t  zz   \n",
  ranges: [
    [0, 3],
    [12, 16],
  ],
});